public final class NettyRemoteBlockReader extends Object implements RemoteBlockReader
RemoteBlockReader.Factory
Constructor and Description |
---|
NettyRemoteBlockReader()
Creates a new
NettyRemoteBlockReader . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Release the underlying buffer of previous/current read response.
|
ByteBuffer |
readRemoteBlock(InetSocketAddress address,
long blockId,
long offset,
long length)
Reads a remote block with a offset and length.
|
public NettyRemoteBlockReader()
NettyRemoteBlockReader
.
TODO(gene): Creating a new remote block reader may be expensive, so consider a connection pool.public ByteBuffer readRemoteBlock(InetSocketAddress address, long blockId, long offset, long length) throws IOException
RemoteBlockReader
readRemoteBlock
in interface RemoteBlockReader
address
- The InetSocketAddress
of the data server.blockId
- the id of the block trying to read.offset
- the offset of the block.length
- the length the client wants to read.IOException
- if the remote server is not reachable or responds with failures.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2015. All Rights Reserved.