org.apache.cassandra.hadoop
Class ColumnFamilyRecordReader

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<java.nio.ByteBuffer,java.util.SortedMap<java.nio.ByteBuffer,IColumn>>
      extended by org.apache.cassandra.hadoop.ColumnFamilyRecordReader
All Implemented Interfaces:
java.io.Closeable

public class ColumnFamilyRecordReader
extends org.apache.hadoop.mapreduce.RecordReader<java.nio.ByteBuffer,java.util.SortedMap<java.nio.ByteBuffer,IColumn>>


Constructor Summary
ColumnFamilyRecordReader()
           
 
Method Summary
 void close()
          Close the record reader.
 java.nio.ByteBuffer getCurrentKey()
          Get the current key
 java.util.SortedMap<java.nio.ByteBuffer,IColumn> getCurrentValue()
          Get the current value.
 float getProgress()
          The current progress of the record reader through its data.
 void initialize(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context)
          Called once at initialization.
 boolean nextKeyValue()
          Read the next key, value pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnFamilyRecordReader

public ColumnFamilyRecordReader()
Method Detail

close

public void close()
Description copied from class: org.apache.hadoop.mapreduce.RecordReader
Close the record reader.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class org.apache.hadoop.mapreduce.RecordReader<java.nio.ByteBuffer,java.util.SortedMap<java.nio.ByteBuffer,IColumn>>

getCurrentKey

public java.nio.ByteBuffer getCurrentKey()
Description copied from class: org.apache.hadoop.mapreduce.RecordReader
Get the current key

Specified by:
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<java.nio.ByteBuffer,java.util.SortedMap<java.nio.ByteBuffer,IColumn>>
Returns:
the current key or null if there is no current key

getCurrentValue

public java.util.SortedMap<java.nio.ByteBuffer,IColumn> getCurrentValue()
Description copied from class: org.apache.hadoop.mapreduce.RecordReader
Get the current value.

Specified by:
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<java.nio.ByteBuffer,java.util.SortedMap<java.nio.ByteBuffer,IColumn>>
Returns:
the object that was read

getProgress

public float getProgress()
Description copied from class: org.apache.hadoop.mapreduce.RecordReader
The current progress of the record reader through its data.

Specified by:
getProgress in class org.apache.hadoop.mapreduce.RecordReader<java.nio.ByteBuffer,java.util.SortedMap<java.nio.ByteBuffer,IColumn>>
Returns:
a number between 0.0 and 1.0 that is the fraction of the data read

initialize

public void initialize(org.apache.hadoop.mapreduce.InputSplit split,
                       org.apache.hadoop.mapreduce.TaskAttemptContext context)
                throws java.io.IOException
Description copied from class: org.apache.hadoop.mapreduce.RecordReader
Called once at initialization.

Specified by:
initialize in class org.apache.hadoop.mapreduce.RecordReader<java.nio.ByteBuffer,java.util.SortedMap<java.nio.ByteBuffer,IColumn>>
Parameters:
split - the split that defines the range of records to read
context - the information about the task
Throws:
java.io.IOException

nextKeyValue

public boolean nextKeyValue()
                     throws java.io.IOException
Description copied from class: org.apache.hadoop.mapreduce.RecordReader
Read the next key, value pair.

Specified by:
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<java.nio.ByteBuffer,java.util.SortedMap<java.nio.ByteBuffer,IColumn>>
Returns:
true if a key/value pair was read
Throws:
java.io.IOException


Copyright © 2011 The Apache Software Foundation