@NotThreadSafe public class LocalFileBlockWriter extends BlockWriter
BlockClient.Type
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() |
toString
public LocalFileBlockWriter(String path)
path
- file path of the blockpublic long append(ByteBuffer inputBuf)
BlockWriter
ByteBuffer
.append
in class BlockWriter
inputBuf
- ByteBuffer
that input data is stored inpublic long append(io.netty.buffer.ByteBuf buf) throws IOException
BlockWriter
append
in class BlockWriter
buf
- the byte buffer that holds the dataIOException
public long append(DataBuffer buffer) throws IOException
BlockWriter
append
in class BlockWriter
buffer
- the byte buffer that holds the dataIOException
public long getPosition()
getPosition
in class BlockWriter
public WritableByteChannel getChannel()
getChannel
in class BlockWriter
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class BlockClient
IOException
Copyright © 2023. All Rights Reserved.