@NotThreadSafe public final class GrpcDataWriter extends Object implements DataWriter
DataWriter.Factory| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels an operation.
|
int |
chunkSize() |
void |
close() |
static GrpcDataWriter |
create(FileSystemContext context,
alluxio.wire.WorkerNetAddress address,
long id,
long length,
alluxio.grpc.RequestType type,
OutStreamOptions options) |
void |
flush()
Flushes all the pending chunks.
|
long |
pos() |
void |
writeChunk(io.netty.buffer.ByteBuf buf)
Writes a chunk.
|
void |
writeFallbackInitRequest(long pos)
Notifies the server UFS fallback endpoint to start writing a new block by resuming the given
number of bytes from block store.
|
public static GrpcDataWriter create(FileSystemContext context, alluxio.wire.WorkerNetAddress address, long id, long length, alluxio.grpc.RequestType type, OutStreamOptions options) throws IOException
context - the file system contextaddress - the data server addressid - the block or UFS IDlength - the length of the block or file to write, set to Long.MAX_VALUE if unknowntype - type of the write requestoptions - the options of the output streamGrpcDataWriterIOExceptionpublic long pos()
pos in interface DataWriterpublic void writeChunk(io.netty.buffer.ByteBuf buf)
throws IOException
DataWriterwriteChunk in interface DataWriterbuf - the chunkIOExceptionpublic void writeFallbackInitRequest(long pos)
throws IOException
pos - number of bytes already written to block storeIOExceptionpublic void cancel()
Cancelablecancel in interface Cancelablepublic void flush()
throws IOException
DataWriterflush in interface DataWriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic int chunkSize()
chunkSize in interface DataWriterCopyright © 2024. All Rights Reserved.