@NotThreadSafe
public class BufferCachingGrpcDataReader
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected long |
mPosToRead
The next pos to read.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BufferCachingGrpcDataReader(WorkerNetAddress address,
CloseableResource<BlockWorkerClient> client,
long dataTimeoutMs,
ReadRequest readRequest,
GrpcBlockingStream<ReadRequest,ReadResponse> stream)
Creates an instance of
BufferCachingGrpcDataReader. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the
BufferCachingGrpcDataReader. |
static BufferCachingGrpcDataReader |
create(FileSystemContext context,
WorkerNetAddress address,
ReadRequest readRequest)
Creates an instance of
BufferCachingGrpcDataReader for block reads. |
int |
deRef()
Decreases the reference count and return the current count.
|
int |
getRefCount() |
protected DataBuffer |
readChunk()
Reads a chunk of data.
|
DataBuffer |
readChunk(int index)
Reads a specific chunk from the block.
|
int |
ref()
Increases the reference count and return the current count.
|
protected BufferCachingGrpcDataReader(WorkerNetAddress address, CloseableResource<BlockWorkerClient> client, long dataTimeoutMs, ReadRequest readRequest, GrpcBlockingStream<ReadRequest,ReadResponse> stream)
BufferCachingGrpcDataReader.address - the data server addressclient - the block worker client to read data fromdataTimeoutMs - the maximum time to wait for a data responsereadRequest - the read requeststream - the underlying gRPC stream to read data@Nullable public DataBuffer readChunk(int index) throws java.io.IOException
index - the chunk indexjava.io.IOException@Nullable protected DataBuffer readChunk() throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
BufferCachingGrpcDataReader.java.io.IOExceptionpublic int ref()
public int deRef()
public int getRefCount()
public static BufferCachingGrpcDataReader create(FileSystemContext context, WorkerNetAddress address, ReadRequest readRequest) throws java.io.IOException
BufferCachingGrpcDataReader for block reads.context - the file system contextaddress - the worker addressreadRequest - the read requestBufferCachingGrpcDataReaderjava.io.IOExceptionCopyright © 2022. All Rights Reserved.