Class BCFile.Writer.BlockAppender
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.DataOutputStream
-
- org.apache.accumulo.core.file.rfile.bcfile.BCFile.Writer.BlockAppender
-
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,AutoCloseable
- Enclosing class:
- BCFile.Writer
public class BCFile.Writer.BlockAppender extends DataOutputStream
Access point to stuff data into a block.
-
-
Field Summary
-
Fields inherited from class java.io.DataOutputStream
written
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Signaling the end of write to the block.void
flush()
long
getCompressedSize()
Get the compressed size of the block in progress.long
getRawSize()
Get the raw size of the block.long
getStartPos()
-
Methods inherited from class java.io.DataOutputStream
size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Methods inherited from class java.io.FilterOutputStream
write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.io.DataOutput
write
-
-
-
-
Method Detail
-
getRawSize
public long getRawSize()
Get the raw size of the block. Caution: size() comes from DataOutputStream which returns Integer.MAX_VALUE on an overflow. This results in a value of 2GiB meaning that an unknown amount of data, at least 2GiB large, has been written. RFiles handle this issue by keeping track of the position of blocks instead of relying on blocks to provide this information.- Returns:
- the number of uncompressed bytes written through the BlockAppender so far.
-
getCompressedSize
public long getCompressedSize() throws IOException
Get the compressed size of the block in progress.- Returns:
- the number of compressed bytes written to the underlying FS file. The size may be smaller than actual need to compress the all data written due to internal buffering inside the compressor.
- Throws:
IOException
-
getStartPos
public long getStartPos()
-
flush
public void flush()
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classDataOutputStream
-
close
public void close() throws IOException
Signaling the end of write to the block. The block register will be called for registering the finished block.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
-