edu.arsc.multisearch
Class ServiceRecordReader

java.lang.Object
  extended by edu.arsc.multisearch.ServiceRecordReader
All Implemented Interfaces:
org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.Text,ServiceWritable>

public class ServiceRecordReader
extends java.lang.Object
implements org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.Text,ServiceWritable>


Nested Class Summary
static class ServiceRecordReader.ServiceReader
          A class that provides the reader from an input stream.
 
Constructor Summary
ServiceRecordReader(org.apache.hadoop.conf.Configuration job, org.apache.hadoop.mapred.FileSplit split)
           
 
Method Summary
 void close()
          Close this split to future operations.
 org.apache.hadoop.io.Text createKey()
          Generate an object for this to be used as a key.
 ServiceWritable createValue()
          Create a ServiceWritable object to be use as the value for this key, value pair
 long getPos()
           
 float getProgress()
          Returns number of bytes used by object.
 int getSize()
          Return the new size.
 boolean next(org.apache.hadoop.io.Text key, ServiceWritable service)
          Reads the next service into the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceRecordReader

public ServiceRecordReader(org.apache.hadoop.conf.Configuration job,
                           org.apache.hadoop.mapred.FileSplit split)
                    throws java.io.IOException
Parameters:
Configuration -
FileSplit -
String -
Throws:
java.io.IOException
Method Detail

getPos

public long getPos()
Specified by:
getPos in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.Text,ServiceWritable>
Returns:
long

getProgress

public float getProgress()
                  throws java.io.IOException
Returns number of bytes used by object. (Between 0 and 1 should be returned)

Specified by:
getProgress in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.Text,ServiceWritable>
Returns:
float
Throws:
java.io.IOException

close

public void close()
Close this split to future operations.

Specified by:
close in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.Text,ServiceWritable>

createValue

public ServiceWritable createValue()
Create a ServiceWritable object to be use as the value for this key, value pair

Specified by:
createValue in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.Text,ServiceWritable>
Returns:
ServiceWritable

getSize

public int getSize()
Return the new size.

Returns:
int

createKey

public org.apache.hadoop.io.Text createKey()
Generate an object for this to be used as a key.

Specified by:
createKey in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.Text,ServiceWritable>
Returns:
Text

next

public boolean next(org.apache.hadoop.io.Text key,
                    ServiceWritable service)
             throws java.io.IOException
Reads the next service into the object

Specified by:
next in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.Text,ServiceWritable>
Parameters:
Text - key
ServiceWritable - service
Returns:
boolean
Throws:
java.io.IOException