@NotThreadSafe public final class LocalFileDataWriter extends java.lang.Object implements DataWriter
DataWriter.Factory| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels an operation.
|
int |
chunkSize() |
void |
close() |
static LocalFileDataWriter |
create(FileSystemContext context,
WorkerNetAddress address,
long blockId,
long blockSize,
OutStreamOptions options)
Creates an instance of
LocalFileDataWriter. |
void |
flush()
Flushes all the pending chunks.
|
long |
pos() |
void |
writeChunk(io.netty.buffer.ByteBuf buf)
Writes a chunk.
|
public static LocalFileDataWriter create(FileSystemContext context, WorkerNetAddress address, long blockId, long blockSize, OutStreamOptions options) throws java.io.IOException
LocalFileDataWriter. This requires the block to be locked
beforehand.context - the file system contextaddress - the worker network addressblockId - the block IDblockSize - the block size in bytesoptions - the output stream optionsLocalFileDataWriter createdjava.io.IOExceptionpublic long pos()
pos in interface DataWriterpublic int chunkSize()
chunkSize in interface DataWriterpublic void writeChunk(io.netty.buffer.ByteBuf buf)
throws java.io.IOException
DataWriterwriteChunk in interface DataWriterbuf - the chunkjava.io.IOExceptionpublic void cancel()
throws java.io.IOException
Cancelablecancel in interface Cancelablejava.io.IOExceptionpublic void flush()
DataWriterflush in interface DataWriterpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionCopyright © 2022. All Rights Reserved.