@NotThreadSafe public final class LocalFilePacketWriter extends Object implements PacketWriter
PacketWriter.Factory
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels an operation.
|
void |
close() |
static LocalFilePacketWriter |
create(FileSystemContext context,
WorkerNetAddress address,
long blockId,
OutStreamOptions options)
Creates an instance of
LocalFilePacketWriter . |
void |
flush()
Flushes all the pending packets.
|
int |
packetSize() |
long |
pos() |
void |
writePacket(io.netty.buffer.ByteBuf buf)
Writes a packet.
|
public static LocalFilePacketWriter create(FileSystemContext context, WorkerNetAddress address, long blockId, OutStreamOptions options) throws IOException
LocalFilePacketWriter
. This requires the block to be locked
beforehand.context
- the file system contextaddress
- the worker network addressblockId
- the block IDoptions
- the output stream optionsLocalFilePacketWriter
createdIOException
public long pos()
pos
in interface PacketWriter
public int packetSize()
packetSize
in interface PacketWriter
public void writePacket(io.netty.buffer.ByteBuf buf) throws IOException
PacketWriter
writePacket
in interface PacketWriter
buf
- the packetIOException
public void cancel() throws IOException
Cancelable
cancel
in interface Cancelable
IOException
public void flush()
PacketWriter
flush
in interface PacketWriter
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.