@NotThreadSafe public final class BlockWorkerDataWriter extends Object implements DataWriter
GrpcDataWriter
except
that all communication with the local worker is via internal method call instead of external RPC
frameworks.DataWriter.Factory
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels an operation.
|
int |
chunkSize() |
void |
close() |
static BlockWorkerDataWriter |
create(FileSystemContext context,
long blockId,
long blockSize,
OutStreamOptions options)
Creates an instance of
BlockWorkerDataWriter . |
void |
flush()
Flushes all the pending chunks.
|
Optional<String> |
getUfsContentHash() |
long |
pos() |
void |
writeChunk(io.netty.buffer.ByteBuf buf)
Writes a chunk.
|
public static BlockWorkerDataWriter create(FileSystemContext context, long blockId, long blockSize, OutStreamOptions options) throws IOException
BlockWorkerDataWriter
.context
- the file system contextblockId
- the block IDblockSize
- the block size in bytesoptions
- the output stream optionsBlockWorkerDataWriter
createdIOException
public long pos()
pos
in interface DataWriter
public int chunkSize()
chunkSize
in interface DataWriter
public Optional<String> getUfsContentHash()
getUfsContentHash
in interface DataWriter
public void writeChunk(io.netty.buffer.ByteBuf buf) throws IOException
DataWriter
writeChunk
in interface DataWriter
buf
- the chunkIOException
public void cancel() throws IOException
Cancelable
cancel
in interface Cancelable
IOException
public void flush()
DataWriter
flush
in interface DataWriter
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.