org.apache.cassandra.io
Class SequenceFile.AbstractReader

java.lang.Object
  extended by org.apache.cassandra.io.SequenceFile.AbstractReader
All Implemented Interfaces:
IFileReader
Direct Known Subclasses:
SequenceFile.Reader
Enclosing class:
SequenceFile

public abstract static class SequenceFile.AbstractReader
extends java.lang.Object
implements IFileReader


Field Summary
protected  java.io.RandomAccessFile file_
           
protected  java.lang.String filename_
           
 
Method Summary
 java.lang.String getFileName()
           
 long getPositionFromBlockIndex(java.lang.String key)
          Return the position of the given key from the block index.
 long next(DataOutputBuffer bufOut)
          This method dumps the next key/value into the DataOuputStream passed in.
 long next(java.lang.String key, DataOutputBuffer bufOut, Coordinate section)
          This method dumps the next key/value into the DataOuputStream passed in.
 long next(java.lang.String key, DataOutputBuffer bufOut, java.lang.String columnFamilyName, java.util.List<java.lang.String> columnNames, IndexHelper.TimeRange timeRange, Coordinate section)
          This method dumps the next key/value into the DataOuputStream passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cassandra.io.IFileReader
close, getCurrentPosition, getEOF, isEOF, isHealthyFileDescriptor, readDirect, readLong, seek
 

Field Detail

file_

protected java.io.RandomAccessFile file_

filename_

protected java.lang.String filename_
Method Detail

getFileName

public java.lang.String getFileName()
Specified by:
getFileName in interface IFileReader

getPositionFromBlockIndex

public long getPositionFromBlockIndex(java.lang.String key)
                               throws java.io.IOException
Return the position of the given key from the block index.

Specified by:
getPositionFromBlockIndex in interface IFileReader
Parameters:
key - the key whose offset is to be extracted from the current block index
Throws:
java.io.IOException

next

public long next(java.lang.String key,
                 DataOutputBuffer bufOut,
                 java.lang.String columnFamilyName,
                 java.util.List<java.lang.String> columnNames,
                 IndexHelper.TimeRange timeRange,
                 Coordinate section)
          throws java.io.IOException
This method dumps the next key/value into the DataOuputStream passed in. Always use this method to query for application specific data as it will have indexes.

Specified by:
next in interface IFileReader
Parameters:
key - key we are interested in.
bufOut - DataOutputStream that needs to be filled.
columnFamilyName - name of the columnFamily
columnNames - columnNames we are interested in OR
timeRange - time range we are interested in
section - region of the file that needs to be read
Returns:
number of bytes that were read.
Throws:
java.io.IOException

next

public long next(DataOutputBuffer bufOut)
          throws java.io.IOException
This method dumps the next key/value into the DataOuputStream passed in.

Specified by:
next in interface IFileReader
Parameters:
bufOut - DataOutputStream that needs to be filled.
Returns:
total number of bytes read/considered
Throws:
java.io.IOException

next

public long next(java.lang.String key,
                 DataOutputBuffer bufOut,
                 Coordinate section)
          throws java.io.IOException
This method dumps the next key/value into the DataOuputStream passed in.

Specified by:
next in interface IFileReader
Parameters:
key - - key we are interested in.
bufOut - DataOutputStream that needs to be filled.
section - region of the file that needs to be read
Returns:
total number of bytes read/considered
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation