Class TsBlockBuilder
- java.lang.Object
-
- org.apache.iotdb.tsfile.read.common.block.TsBlockBuilder
-
public class TsBlockBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TsBlockBuilder(int initialExpectedEntries, java.util.List<TSDataType> types)TsBlockBuilder(java.util.List<TSDataType> types)Create a TsBlockBuilder with given types.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TsBlockbuild()voidbuildValueColumnBuilders(java.util.List<TSDataType> types)static TsBlockBuildercreateWithOnlyTimeColumn()voiddeclarePosition()voiddeclarePositions(int deltaPositions)ColumnBuildergetColumnBuilder(int channel)intgetPositionCount()longgetRetainedSizeInBytes()longgetSizeInBytes()TimeColumnBuildergetTimeColumnBuilder()TSDataTypegetType(int channel)ColumnBuilder[]getValueColumnBuilders()booleanisEmpty()booleanisFull()TsBlockBuildernewTsBlockBuilderLike()voidreset()static TsBlockBuilderwithMaxTsBlockSize(int maxTsBlockBytes, java.util.List<TSDataType> types)voidwriteNullableText(int columnIndex, java.lang.String value)Write a text value to the columnIndex.
-
-
-
Constructor Detail
-
TsBlockBuilder
public TsBlockBuilder(java.util.List<TSDataType> types)
Create a TsBlockBuilder with given types.A TsBlockBuilder instance created with this constructor has no estimation about bytes per entry, therefore it can resize frequently while appending new rows.
This constructor should only be used to get the initial TsBlockBuilder. Once the TsBlockBuilder is full use reset() or createTsBlockBuilderLike() to create a new TsBlockBuilder instance with its size estimated based on previous data.
-
TsBlockBuilder
public TsBlockBuilder(int initialExpectedEntries, java.util.List<TSDataType> types)
-
-
Method Detail
-
createWithOnlyTimeColumn
public static TsBlockBuilder createWithOnlyTimeColumn()
-
withMaxTsBlockSize
public static TsBlockBuilder withMaxTsBlockSize(int maxTsBlockBytes, java.util.List<TSDataType> types)
-
buildValueColumnBuilders
public void buildValueColumnBuilders(java.util.List<TSDataType> types)
-
reset
public void reset()
-
newTsBlockBuilderLike
public TsBlockBuilder newTsBlockBuilderLike()
-
getTimeColumnBuilder
public TimeColumnBuilder getTimeColumnBuilder()
-
getColumnBuilder
public ColumnBuilder getColumnBuilder(int channel)
-
getValueColumnBuilders
public ColumnBuilder[] getValueColumnBuilders()
-
getType
public TSDataType getType(int channel)
-
declarePosition
public void declarePosition()
-
declarePositions
public void declarePositions(int deltaPositions)
-
isFull
public boolean isFull()
-
isEmpty
public boolean isEmpty()
-
getPositionCount
public int getPositionCount()
-
getSizeInBytes
public long getSizeInBytes()
-
getRetainedSizeInBytes
public long getRetainedSizeInBytes()
-
build
public TsBlock build()
-
writeNullableText
public void writeNullableText(int columnIndex, java.lang.String value)Write a text value to the columnIndex. If the value is null, then the place will be recorded with null.- Parameters:
columnIndex- the target column index.value- the text value to be inserted.
-
-