@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) throws IOException
path
- file path of the blockIOException
public long append(ByteBuffer inputBuf) throws IOException
BlockWriter
ByteBuffer
.append
in class BlockWriter
inputBuf
- ByteBuffer
that input data is stored inIOException
public 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.