java.lang.AutoCloseable, org.apache.hadoop.fs.ByteBufferReadable, java.io.CloseableBlockReaderRemote, ExternalBlockReader@Private
public interface BlockReader
extends org.apache.hadoop.fs.ByteBufferReadable, java.io.Closeable
| 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 |
readAll(byte[] buf,
int offset,
int len) |
Similar to
readFully(byte[], int, int) except that it will
not throw an exception on EOF. |
void |
readFully(byte[] buf,
int readOffset,
int amtToRead) |
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
|
int read(byte[] buf,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionlong skip(long n) throws java.io.IOException
java.io.IOExceptionint available()
void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionvoid readFully(byte[] buf,
int readOffset,
int amtToRead)
throws java.io.IOException
java.io.IOExceptionint readAll(byte[] buf,
int offset,
int len)
throws java.io.IOException
readFully(byte[], int, int) except that it will
not throw an exception on EOF. However, it differs from the simple
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.java.io.IOExceptionboolean isShortCircuit()
ClientMmap getClientMmap(java.util.EnumSet<org.apache.hadoop.fs.ReadOption> opts)
opts - The read options to use.org.apache.hadoop.util.DataChecksum getDataChecksum()
int getNetworkDistance()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.