Package org.apache.hadoop.io
Class ArrayFile.Reader
java.lang.Object
org.apache.hadoop.io.MapFile.Reader
org.apache.hadoop.io.ArrayFile.Reader
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- ArrayFile
Provide access to an existing array file.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.io.MapFile.Reader
MapFile.Reader.Option -
Constructor Summary
ConstructorsConstructorDescriptionReader(FileSystem fs, String file, Configuration conf) Construct an array reader for the named file. -
Method Summary
Modifier and TypeMethodDescriptionReturn thenth value in the file.longkey()Returns the key associated with the most recent call toseek(long),next(Writable), orget(long,Writable).Read and return the next value in the file.voidseek(long n) Positions the reader before itsnth value.Methods inherited from class org.apache.hadoop.io.MapFile.Reader
close, comparator, createDataFileReader, finalKey, get, getClosest, getClosest, getKeyClass, getValueClass, midKey, next, open, reset, seek
-
Constructor Details
-
Reader
Construct an array reader for the named file.- Parameters:
fs- FileSystem.file- file.conf- configuration.- Throws:
IOException- raised on errors performing I/O.
-
-
Method Details
-
seek
Positions the reader before itsnth value.- Parameters:
n- n key.- Throws:
IOException- raised on errors performing I/O.
-
next
Read and return the next value in the file.- Parameters:
value- value.- Returns:
- Writable.
- Throws:
IOException- raised on errors performing I/O.
-
key
Returns the key associated with the most recent call toseek(long),next(Writable), orget(long,Writable).- Returns:
- key key.
- Throws:
IOException- raised on errors performing I/O.
-
get
Return thenth value in the file.- Parameters:
n- n key.value- value.- Returns:
- writable.
- Throws:
IOException- raised on errors performing I/O.
-