@NotThreadSafe public final class LocalFileBlockWriter extends Object implements BlockWriter
Constructor and Description |
---|
LocalFileBlockWriter(String path)
Constructs a Block writer given the file path of the block.
|
Modifier and Type | Method and Description |
---|---|
long |
append(io.netty.buffer.ByteBuf buf)
Appends buf.readableBytes() bytes to the end of this block writer from the given buf.
|
long |
append(ByteBuffer inputBuf)
Appends data to the end of a block from an input
ByteBuffer . |
long |
append(DataBuffer buffer)
Appends buffer.readableBytes() bytes to the end of this block writer from the given buffer.
|
void |
close() |
WritableByteChannel |
getChannel() |
long |
getPosition() |
public LocalFileBlockWriter(String path) throws IOException
path
- file path of the blockIOException
public long append(ByteBuffer inputBuf) throws IOException
BlockWriter
ByteBuffer
.append
in interface BlockWriter
inputBuf
- ByteBuffer
that input data is stored inIOException
public long append(io.netty.buffer.ByteBuf buf) throws IOException
BlockWriter
append
in interface BlockWriter
buf
- the byte buffer that holds the dataIOException
public long append(DataBuffer buffer) throws IOException
BlockWriter
append
in interface BlockWriter
buffer
- the byte buffer that holds the dataIOException
public long getPosition()
getPosition
in interface BlockWriter
public WritableByteChannel getChannel()
getChannel
in interface BlockWriter
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.