org.apache.pig.piggybank.storage
Class IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
      extended by org.apache.pig.piggybank.storage.IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader
All Implemented Interfaces:
Closeable
Enclosing class:
IndexedStorage.IndexedStorageInputFormat

public static class IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader
extends org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>

Internal RecordReader class


Nested Class Summary
static class IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader
           
static class IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageRecordReaderComparator
          Class to compare record readers using underlying indexes
 
Constructor Summary
IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader(IndexedStorage.IndexManager im)
           
 
Method Summary
 void close()
           
 org.apache.hadoop.io.LongWritable getCurrentKey()
           
 org.apache.hadoop.io.Text getCurrentValue()
           
 float getProgress()
           
 void initialize(org.apache.hadoop.mapreduce.InputSplit genericSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context)
           
 boolean nextKeyValue()
           
 void seek(long offset)
           
 boolean seekNear(Tuple keys)
          Scan the index for given key and seek to appropriate offset in the data
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader

public IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader(IndexedStorage.IndexManager im)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

initialize

public void initialize(org.apache.hadoop.mapreduce.InputSplit genericSplit,
                       org.apache.hadoop.mapreduce.TaskAttemptContext context)
                throws IOException,
                       InterruptedException
Specified by:
initialize in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

seek

public void seek(long offset)
          throws IOException
Throws:
IOException

seekNear

public boolean seekNear(Tuple keys)
                 throws IOException
Scan the index for given key and seek to appropriate offset in the data

Parameters:
keys - to look for
Returns:
true if the given key was found, false otherwise
Throws:
IOException

nextKeyValue

public boolean nextKeyValue()
                     throws IOException,
                            InterruptedException
Specified by:
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

getCurrentKey

public org.apache.hadoop.io.LongWritable getCurrentKey()
                                                throws IOException,
                                                       InterruptedException
Specified by:
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

getCurrentValue

public org.apache.hadoop.io.Text getCurrentValue()
                                          throws IOException,
                                                 InterruptedException
Specified by:
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

getProgress

public float getProgress()
                  throws IOException,
                         InterruptedException
Specified by:
getProgress in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException


Copyright © 2007-2012 The Apache Software Foundation