java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.fs.ByteBufferReadable, BlockReader@Private public final class ExternalBlockReader extends java.lang.Object implements BlockReader
| Modifier and Type | Method | Description |
|---|---|---|
int |
available() |
Returns an estimate of the number of bytes that can be read
(or skipped over) from this input stream without performing
network I/O.
|
void |
close() |
Close the block reader.
|
ClientMmap |
getClientMmap(java.util.EnumSet<org.apache.hadoop.fs.ReadOption> opts) |
Get a ClientMmap object for this BlockReader.
|
org.apache.hadoop.util.DataChecksum |
getDataChecksum() |
|
int |
getNetworkDistance() |
Return the network distance between local machine and the remote machine.
|
boolean |
isShortCircuit() |
|
int |
read(byte[] buf,
int off,
int len) |
|
int |
read(java.nio.ByteBuffer buf) |
|
int |
readAll(byte[] buf,
int offset,
int len) |
Similar to
BlockReader.readFully(byte[], int, int) except that it will
not throw an exception on EOF. |
void |
readFully(byte[] buf,
int offset,
int len) |
Read exactly the given amount of data, throwing an exception
if EOF is reached before that amount
|
long |
skip(long n) |
Skip the given number of bytes
|
public int read(byte[] buf,
int off,
int len)
throws java.io.IOException
read in interface BlockReaderjava.io.IOExceptionpublic int read(java.nio.ByteBuffer buf)
throws java.io.IOException
read in interface org.apache.hadoop.fs.ByteBufferReadablejava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
BlockReaderskip in interface BlockReaderjava.io.IOExceptionpublic int available()
BlockReaderavailable in interface BlockReaderpublic void close()
throws java.io.IOException
BlockReaderclose in interface java.lang.AutoCloseableclose in interface BlockReaderclose in interface java.io.Closeablejava.io.IOExceptionpublic void readFully(byte[] buf,
int offset,
int len)
throws java.io.IOException
BlockReaderreadFully in interface BlockReaderjava.io.IOExceptionpublic int readAll(byte[] buf,
int offset,
int len)
throws java.io.IOException
BlockReaderBlockReader.readFully(byte[], int, int) except that it will
not throw an exception on EOF. However, it differs from the simple
BlockReader.read(byte[], int, int) call in that it is guaranteed to
read the data if it is available. In other words, if this call
does not throw an exception, then either the buffer has been
filled or the next call will return EOF.readAll in interface BlockReaderjava.io.IOExceptionpublic boolean isShortCircuit()
isShortCircuit in interface BlockReaderpublic ClientMmap getClientMmap(java.util.EnumSet<org.apache.hadoop.fs.ReadOption> opts)
BlockReadergetClientMmap in interface BlockReaderopts - The read options to use.public org.apache.hadoop.util.DataChecksum getDataChecksum()
getDataChecksum in interface BlockReaderpublic int getNetworkDistance()
BlockReadergetNetworkDistance in interface BlockReaderCopyright © 2008–2025 Apache Software Foundation. All rights reserved.