|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.file.map.MySequenceFile.Reader
public static class MySequenceFile.Reader
Reads key/value pairs from a sequence-format file.
Constructor Summary | |
---|---|
MySequenceFile.Reader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
org.apache.hadoop.conf.Configuration conf)
Open the named file. |
Method Summary | |
---|---|
void |
close()
Close the file. |
MySequenceFile.ValueBytes |
createValueBytes()
|
org.apache.hadoop.io.compress.CompressionCodec |
getCompressionCodec()
Returns the compression codec of data in this file. |
java.lang.Object |
getCurrentValue(java.lang.Object val)
Get the 'value' corresponding to the last read 'key'. |
void |
getCurrentValue(org.apache.hadoop.io.Writable val)
Get the 'value' corresponding to the last read 'key'. |
java.lang.Class |
getKeyClass()
Returns the class of keys in this file. |
java.lang.String |
getKeyClassName()
Returns the name of the key class. |
MySequenceFile.Metadata |
getMetadata()
Returns the metadata object of the file |
long |
getPosition()
Return the current byte position in the input file. |
java.lang.Class<?> |
getValueClass()
Returns the class of values in this file. |
java.lang.String |
getValueClassName()
Returns the name of the value class. |
boolean |
isBlockCompressed()
Returns true if records are block-compressed. |
boolean |
isCompressed()
Returns true if values are compressed. |
int |
next(org.apache.hadoop.io.DataOutputBuffer buffer)
Deprecated. Call nextRaw(DataOutputBuffer,MySequenceFile.ValueBytes) . |
java.lang.Object |
next(java.lang.Object key)
Read the next key in the file, skipping its value. |
boolean |
next(org.apache.hadoop.io.Writable key)
Read the next key in the file into key , skipping its value. |
boolean |
next(org.apache.hadoop.io.Writable key,
org.apache.hadoop.io.Writable val)
Read the next key/value pair in the file into key and val . |
int |
nextRaw(org.apache.hadoop.io.DataOutputBuffer key,
MySequenceFile.ValueBytes val)
Read 'raw' records. |
int |
nextRawKey(org.apache.hadoop.io.DataOutputBuffer key)
Read 'raw' keys. |
int |
nextRawValue(MySequenceFile.ValueBytes val)
Read 'raw' values. |
protected org.apache.hadoop.fs.FSDataInputStream |
openFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
int bufferSize,
long length)
Override this method to specialize the type of FSDataInputStream returned. |
void |
seek(long position)
Set the current byte position in the input file. |
void |
sync(long position)
Seek to the next sync mark past a given position. |
boolean |
syncSeen()
Returns true iff the previous call to next passed a sync mark. |
java.lang.String |
toString()
Returns the name of the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MySequenceFile.Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
java.io.IOException
Method Detail |
---|
protected org.apache.hadoop.fs.FSDataInputStream openFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, int bufferSize, long length) throws java.io.IOException
FSDataInputStream
returned.
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
java.io.IOException
public java.lang.String getKeyClassName()
public java.lang.Class getKeyClass()
public java.lang.String getValueClassName()
public java.lang.Class<?> getValueClass()
public boolean isCompressed()
public boolean isBlockCompressed()
public org.apache.hadoop.io.compress.CompressionCodec getCompressionCodec()
public MySequenceFile.Metadata getMetadata()
public void getCurrentValue(org.apache.hadoop.io.Writable val) throws java.io.IOException
val
- : The 'value' to be read.
java.io.IOException
public java.lang.Object getCurrentValue(java.lang.Object val) throws java.io.IOException
val
- : The 'value' to be read.
java.io.IOException
public boolean next(org.apache.hadoop.io.Writable key) throws java.io.IOException
key
, skipping its value. True if another entry exists, and false at end of file.
java.io.IOException
public boolean next(org.apache.hadoop.io.Writable key, org.apache.hadoop.io.Writable val) throws java.io.IOException
key
and val
. Returns true if such a pair exists and false when at end of file
java.io.IOException
@Deprecated public int next(org.apache.hadoop.io.DataOutputBuffer buffer) throws java.io.IOException
nextRaw(DataOutputBuffer,MySequenceFile.ValueBytes)
.
java.io.IOException
public MySequenceFile.ValueBytes createValueBytes()
public int nextRaw(org.apache.hadoop.io.DataOutputBuffer key, MySequenceFile.ValueBytes val) throws java.io.IOException
key
- - The buffer into which the key is readval
- - The 'raw' value
java.io.IOException
public int nextRawKey(org.apache.hadoop.io.DataOutputBuffer key) throws java.io.IOException
key
- - The buffer into which the key is read
java.io.IOException
public java.lang.Object next(java.lang.Object key) throws java.io.IOException
java.io.IOException
public int nextRawValue(MySequenceFile.ValueBytes val) throws java.io.IOException
val
- - The 'raw' value
java.io.IOException
public void seek(long position) throws java.io.IOException
The position passed must be a position returned by MySequenceFile.Writer.getLength()
when writing this file. To seek to an arbitrary position,
use sync(long)
.
java.io.IOException
public void sync(long position) throws java.io.IOException
java.io.IOException
public boolean syncSeen()
public long getPosition() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |