|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.nutch.io.SequenceFile.Reader
Writes key/value pairs from a sequence-format file.
Constructor Summary | |
SequenceFile.Reader(NutchFileSystem nfs,
String file)
Open the named file. |
Method Summary | |
void |
close()
Close the file. |
Class |
getKeyClass()
Returns the class of keys in this file. |
long |
getPosition()
Return the current byte position in the input file. |
Class |
getValueClass()
Returns the class of values in this file. |
int |
next(DataOutputBuffer buffer)
Read the next key/value pair in the file into buffer . |
boolean |
next(Writable key)
Read the next key in the file into key , skipping its
value. |
boolean |
next(Writable key,
Writable val)
Read the next key/value pair in the file into key and
val . |
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. |
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 SequenceFile.Reader(NutchFileSystem nfs, String file) throws IOException
Method Detail |
public void close() throws IOException
IOException
public Class getKeyClass()
public Class getValueClass()
public boolean next(Writable key) throws IOException
key
, skipping its
value. True if another entry exists, and false at end of file.
IOException
public boolean next(Writable key, Writable val) throws IOException
key
and
val
. Returns true if such a pair exists and false when at
end of file
IOException
public int next(DataOutputBuffer buffer) throws IOException
buffer
.
Returns the length of the key read, or -1 if at end of file. The length
of the value may be computed by calling buffer.getLength() before and
after calls to this method.
IOException
public void seek(long position) throws IOException
IOException
public void sync(long position) throws IOException
IOException
public boolean syncSeen()
public long getPosition() throws IOException
IOException
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |