|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.io.ReadaheadPool
@InterfaceAudience.Private @InterfaceStability.Evolving public class ReadaheadPool
Manages a pool of threads which can issue readahead requests on file descriptors.
Nested Class Summary | |
---|---|
static interface |
ReadaheadPool.ReadaheadRequest
An outstanding readahead request that has been submitted to the pool. |
Method Summary | |
---|---|
static ReadaheadPool |
getInstance()
Return the singleton instance for the current process. |
ReadaheadPool.ReadaheadRequest |
readaheadStream(String identifier,
FileDescriptor fd,
long curPos,
long readaheadLength,
long maxOffsetToRead,
ReadaheadPool.ReadaheadRequest lastReadahead)
Issue a request to readahead on the given file descriptor. |
ReadaheadPool.ReadaheadRequest |
submitReadahead(String identifier,
FileDescriptor fd,
long off,
long len)
Submit a request to readahead on the given file descriptor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ReadaheadPool getInstance()
public ReadaheadPool.ReadaheadRequest readaheadStream(String identifier, FileDescriptor fd, long curPos, long readaheadLength, long maxOffsetToRead, ReadaheadPool.ReadaheadRequest lastReadahead)
identifier
- a textual identifier that will be used in error
messages (e.g. the file name)fd
- the file descriptor to read aheadcurPos
- the current offset at which reads are being issuedreadaheadLength
- the configured length to read aheadmaxOffsetToRead
- the maximum offset that will be readahead
(useful if, for example, only some segment of the file is
requested by the user). Pass Long.MAX_VALUE
to allow
readahead to the end of the file.lastReadahead
- the result returned by the previous invocation
of this function on this file descriptor, or null if this is
the first call
public ReadaheadPool.ReadaheadRequest submitReadahead(String identifier, FileDescriptor fd, long off, long len)
identifier
- a textual identifier used in error messages, etc.fd
- the file descriptor to readaheadoff
- the offset at which to start the readaheadlen
- the number of bytes to read
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |