public class FixedWidthBlockBuilder extends AbstractFixedWidthBlock implements BlockBuilder
fixedSize| Constructor and Description |
|---|
FixedWidthBlockBuilder(int fixedSize,
BlockBuilderStatus blockBuilderStatus,
int expectedEntries) |
FixedWidthBlockBuilder(int fixedSize,
int positionCount) |
| Modifier and Type | Method and Description |
|---|---|
BlockBuilder |
appendNull()
Appends a null value to the block.
|
Block |
build()
Builds the block.
|
BlockBuilder |
closeEntry()
Write a byte to the current entry;
|
Block |
copyPositions(List<Integer> positions)
Returns a block containing the specified positions.
|
Block |
copyRegion(int positionOffset,
int length)
Returns a block starting at the specified position and extends for the
specified length.
|
int |
getPositionCount()
Returns the number of positions in this block.
|
protected io.airlift.slice.Slice |
getRawSlice() |
Block |
getRegion(int positionOffset,
int length)
Returns a block starting at the specified position and extends for the
specified length.
|
int |
getRetainedSizeInBytes()
Returns the retained size of this block in memory.
|
int |
getSizeInBytes()
Returns the logical size of this block in memory.
|
protected boolean |
isEntryNull(int position) |
String |
toString() |
BlockBuilder |
writeByte(int value)
Write a byte to the current entry;
|
BlockBuilder |
writeBytes(io.airlift.slice.Slice source,
int sourceIndex,
int length)
Write a byte sequences to the current entry;
|
BlockBuilder |
writeDouble(double value)
Write a double to the current entry;
|
BlockBuilder |
writeFloat(float value)
Write a float to the current entry;
|
BlockBuilder |
writeInt(int value)
Write a int to the current entry;
|
BlockBuilder |
writeLong(long value)
Write a long to the current entry;
|
BlockBuilder |
writeShort(int value)
Write a short to the current entry;
|
assureLoaded, bytesCompare, bytesEqual, checkReadablePosition, compareTo, equals, getByte, getDouble, getEncoding, getFixedSize, getFloat, getInt, getLength, getLong, getShort, getSingleValueBlock, getSlice, hash, isNull, writeBytesTo, writePositionToclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbeginBlockEntry, writeObjectassureLoaded, bytesCompare, bytesEqual, compareTo, equals, getByte, getDouble, getEncoding, getFloat, getInt, getLength, getLong, getObject, getShort, getSingleValueBlock, getSlice, hash, isNull, writeBytesTo, writePositionTopublic FixedWidthBlockBuilder(int fixedSize,
BlockBuilderStatus blockBuilderStatus,
int expectedEntries)
public FixedWidthBlockBuilder(int fixedSize,
int positionCount)
protected io.airlift.slice.Slice getRawSlice()
getRawSlice in class AbstractFixedWidthBlockpublic int getPositionCount()
BlockgetPositionCount in interface Blockpublic int getSizeInBytes()
BlockgetSizeInBytes in interface Blockpublic int getRetainedSizeInBytes()
BlockgetRetainedSizeInBytes in interface Blockpublic Block copyPositions(List<Integer> positions)
BlockThe returned block must be a compact representation of the original block.
copyPositions in interface Blockpublic BlockBuilder writeByte(int value)
BlockBuilderwriteByte in interface BlockBuilderpublic BlockBuilder writeShort(int value)
BlockBuilderwriteShort in interface BlockBuilderpublic BlockBuilder writeInt(int value)
BlockBuilderwriteInt in interface BlockBuilderpublic BlockBuilder writeLong(long value)
BlockBuilderwriteLong in interface BlockBuilderpublic BlockBuilder writeFloat(float value)
BlockBuilderwriteFloat in interface BlockBuilderpublic BlockBuilder writeDouble(double value)
BlockBuilderwriteDouble in interface BlockBuilderpublic BlockBuilder writeBytes(io.airlift.slice.Slice source, int sourceIndex, int length)
BlockBuilderwriteBytes in interface BlockBuilderpublic BlockBuilder closeEntry()
BlockBuildercloseEntry in interface BlockBuilderpublic BlockBuilder appendNull()
BlockBuilderappendNull in interface BlockBuilderprotected boolean isEntryNull(int position)
isEntryNull in class AbstractFixedWidthBlockpublic Block getRegion(int positionOffset, int length)
BlockThe region can be a view over this block. If this block is released the region block may also be released. If the region block is released this block may also be released.
public Block copyRegion(int positionOffset, int length)
BlockThe region returned must be a compact representation of the original block, unless their internal representation will be exactly the same. This method is useful for operators that hold on to a range of values without holding on to the entire block.
copyRegion in interface Blockpublic Block build()
BlockBuilderbuild in interface BlockBuilderCopyright © 2012-2016. All Rights Reserved.