@NotThreadSafe public final class GrpcDataWriter extends java.lang.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,
WorkerNetAddress address,
long id,
long length,
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, WorkerNetAddress address, long id, long length, RequestType type, OutStreamOptions options) throws java.io.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 streamGrpcDataWriterjava.io.IOExceptionpublic long pos()
pos in interface DataWriterpublic void writeChunk(io.netty.buffer.ByteBuf buf)
throws java.io.IOException
DataWriterwriteChunk in interface DataWriterbuf - the chunkjava.io.IOExceptionpublic void writeFallbackInitRequest(long pos)
throws java.io.IOException
pos - number of bytes already written to block storejava.io.IOExceptionpublic void cancel()
Cancelablecancel in interface Cancelablepublic void flush()
throws java.io.IOException
DataWriterflush in interface DataWriterjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic int chunkSize()
chunkSize in interface DataWriterCopyright © 2022. All Rights Reserved.