You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2024/11/29 02:07:28 UTC
(iotdb) branch master updated: Tsfile java interfaces & Subscription: The usage of bitmap in SubscriptionSessionDataSet may cause npe (#14124)
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 87dc2ca7245 Tsfile java interfaces & Subscription: The usage of bitmap in SubscriptionSessionDataSet may cause npe (#14124)
87dc2ca7245 is described below
commit 87dc2ca72458ed5ca16573c8a111b2c5e8c5dcff
Author: shuwenwei <55...@users.noreply.github.com>
AuthorDate: Fri Nov 29 10:07:22 2024 +0800
Tsfile java interfaces & Subscription: The usage of bitmap in SubscriptionSessionDataSet may cause npe (#14124)
* fix compile
* fix compile
* fix compile
* fix row count
* make Tablet.rowSize access to private
* update tsfile version
* fix example
* remove tsfile-java module
* remove tsfile-java module
* fix ut
* fix example
* spotless
* revert example/session/pom.xml
* fix ut
* fix ut
* fix npe
* update tsfile version
---
.../java/org/apache/iotdb/CountPointProcessor.java | 3 +-
.../iotdb/AlignedTimeseriesSessionExample.java | 59 +++----
.../org/apache/iotdb/DataMigrationExample.java | 26 +--
.../iotdb/HybridTimeseriesSessionExample.java | 10 +-
.../org/apache/iotdb/SessionConcurrentExample.java | 16 +-
.../main/java/org/apache/iotdb/SessionExample.java | 62 +++----
.../org/apache/iotdb/TableModelSessionExample.java | 28 +--
.../apache/iotdb/TableModelSessionPoolExample.java | 30 ++--
.../main/java/org/apache/iotdb/TabletExample.java | 3 +-
.../iotdb/trigger/StatisticsUpdaterTrigger.java | 6 +-
.../trigger/example/TriggerFireTimesCounter.java | 2 +-
.../org/apache/iotdb/it/utils/TsFileGenerator.java | 28 +--
.../org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java | 24 +--
.../iotdb/db/it/IoTDBPartialInsertionIT.java | 8 +-
.../pipe/it/autocreate/IoTDBPipeNullValueIT.java | 4 +-
.../pipe/it/manual/IoTDBPipeReqAutoSliceIT.java | 22 +--
.../manual/IoTDBPipeTypeConversionISessionIT.java | 39 +++--
.../iotdb/pipe/it/tablemodel/TableModelUtils.java | 32 ++--
.../relational/it/db/it/IoTDBInsertTableIT.java | 178 ++++++++++++-------
.../it/query/old/orderBy/IoTDBOrderByTableIT.java | 48 +++---
.../pool/IoTDBInsertTableSessionPoolIT.java | 69 +++++---
.../session/it/IoTDBSessionAlignedInsertIT.java | 10 +-
.../iotdb/session/it/IoTDBSessionComplexIT.java | 24 +--
.../it/IoTDBSessionDisableMemControlIT.java | 12 +-
.../IoTDBSessionInsertWithTriggerExecutionIT.java | 6 +-
.../iotdb/session/it/IoTDBSessionRelationalIT.java | 181 +++++++++++++-------
.../iotdb/session/it/IoTDBSessionSimpleIT.java | 126 +++++++-------
.../session/it/IoTDBSessionSyntaxConventionIT.java | 4 +-
.../org/apache/iotdb/session/it/SessionIT.java | 21 +--
.../it/local/IoTDBSubscriptionBasicIT.java | 2 +-
.../it/triple/IoTDBSubscriptionSharingIT.java | 6 +-
.../IoTDBDefaultPullConsumerDataSetIT.java | 2 +-
.../IoTDBDefaultTsfilePushConsumerIT.java | 2 +-
.../IoTDBRootDatasetPushConsumerIT.java | 2 +-
.../IoTDBRootPullConsumeTsfileIT.java | 2 +-
...merPullConsumerWith1TopicShareProcessMixIT.java | 2 +-
.../param/IoTDBTestParamPullConsumerIT.java | 2 +-
.../param/IoTDBTestParamPushConsumerIT.java | 2 +-
...DBTestAutoCommitFalseDataSetPullConsumerIT.java | 4 +-
...TDBTestAutoCommitTrueDataSetPullConsumerIT.java | 4 +-
.../format/IoTDBDBDataSetPullConsumerIT.java | 2 +-
.../format/IoTDBDBTsfilePullConsumerIT.java | 2 +-
.../IoTDBAllTsDatasetPullConsumerIT.java | 2 +-
.../IoTDBAllTsTsfilePullConsumerIT.java | 2 +-
.../IoTDBAllTsfilePullConsumerSnapshotIT.java | 2 +-
.../IoTDBPathDeviceDataSetPullConsumerIT.java | 2 +-
.../IoTDBPathDeviceTsfilePullConsumerIT.java | 2 +-
.../IoTDBTimeTsDatasetPullConsumerIT.java | 2 +-
.../IoTDBTimeTsTsfilePullConsumerIT.java | 2 +-
.../IoTDBSnapshotDevicePullConsumerDataSetIT.java | 2 +-
.../IoTDBSnapshotDevicePullConsumerTsfileIT.java | 2 +-
...DBConsumer2With1TopicShareProcessDataSetIT.java | 2 +-
...TDBConsumer2With1TopicShareProcessTsfileIT.java | 2 +-
.../multi/IoTDBMultiGroupVsMultiConsumerIT.java | 4 +-
.../IoTDBOneConsumerMultiTopicsDatasetIT.java | 2 +-
.../multi/IoTDBOneConsumerMultiTopicsMixIT.java | 5 +-
.../multi/IoTDBOneConsumerMultiTopicsTsfileIT.java | 2 +-
.../pattern/IoTDBDBPatternPullConsumeTsfileIT.java | 2 +-
.../IoTDBDBPatternPullConsumerDataSetIT.java | 2 +-
.../IoTDBDefaultPatternPullConsumerDataSetIT.java | 2 +-
.../IoTDBDevicePatternPullConsumeTsfileIT.java | 2 +-
.../IoTDBDevicePatternPullConsumerDataSetIT.java | 2 +-
...DBMiddleMatch2PatternPullConsumerDataSetIT.java | 2 +-
...IoTDBMiddleMatchPatternPullConsumeTsfileIT.java | 2 +-
...TDBMiddleMatchPatternPullConsumerDataSetIT.java | 2 +-
.../IoTDBRootPatternPullConsumeTsfileIT.java | 2 +-
.../pattern/IoTDBTSPatternPullConsumeTsfileIT.java | 2 +-
.../IoTDBTSPatternPullConsumerDataSetIT.java | 2 +-
.../time/IoTDBAllPullConsumerDataSetIT.java | 2 +-
.../time/IoTDBHistoryPullConsumerDataSetIT.java | 2 +-
.../time/IoTDBRealTimePullConsumerDataSetIT.java | 2 +-
...oTDBTimeRangeAccuratePullConsumerDataSetIT.java | 2 +-
.../time/IoTDBTimeRangePullConsumerDataSetIT.java | 2 +-
.../format/IoTDBTestPushConsumeDataSetIT.java | 2 +-
.../IoTDBTestPushConsumeNoTargetDirTsfileIT.java | 2 +-
.../format/IoTDBTestPushConsumeTsfileIT.java | 2 +-
.../IoTDBLooseAllTsDatasetPushConsumerIT.java | 2 +-
...TDBLooseAllTsDatasetPushConsumerSnapshotIT.java | 2 +-
.../IoTDBLooseAllTsfilePushConsumerIT.java | 2 +-
.../IoTDBPathLooseDeviceTsfilePushConsumerIT.java | 2 +-
.../IoTDBPathLooseTsDatasetPushConsumerIT.java | 2 +-
.../IoTDBPathLooseTsfilePushConsumerIT.java | 2 +-
.../IoTDBPathTsLooseDatasetPushConsumerIT.java | 2 +-
.../IoTDBTimeLooseTsDatasetPushConsumerIT.java | 2 +-
.../IoTDBTimeLooseTsTsfilePushConsumerIT.java | 2 +-
.../IoTDBTimeLooseTsfilePushConsumerIT.java | 2 +-
.../IoTDBTimeTsLooseDatasetPushConsumerIT.java | 2 +-
...oTDBSnapshotTSPatternDatasetPushConsumerIT.java | 2 +-
...IoTDBSnapshotTSPatternTsfilePushConsumerIT.java | 2 +-
...DBConsumer2With1TopicShareProcessDataSetIT.java | 2 +-
...TDBConsumer2With1TopicShareProcessTsfileIT.java | 2 +-
.../multi/IoTDBMultiGroupVsMultiConsumerIT.java | 6 +-
.../IoTDBOneConsumerMultiTopicsDatasetIT.java | 2 +-
.../multi/IoTDBOneConsumerMultiTopicsMixIT.java | 2 +-
.../multi/IoTDBOneConsumerMultiTopicsTsfileIT.java | 2 +-
.../IoTDBDBPatternDatasetPushConsumerIT.java | 2 +-
.../IoTDBDBPatternTsfilePushConsumerIT.java | 2 +-
.../IoTDBDefaultPatternTsfilePushConsumerIT.java | 2 +-
.../IoTDBDevicePatternDatasetPushConsumerIT.java | 2 +-
.../IoTDBDevicePatternTsfilePushConsumerIT.java | 2 +-
.../IoTDBRootPatternDatasetPushConsumerIT.java | 2 +-
.../IoTDBTSPatternDatasetPushConsumerIT.java | 2 +-
.../IoTDBTSPatternTsfilePushConsumerIT.java | 2 +-
.../IoTDBHistoryRootDatasetPushConsumerIT.java | 2 +-
.../time/IoTDBHistoryRootTsFilePushConsumerIT.java | 2 +-
.../time/IoTDBRealTimeDBDatasetPushConsumerIT.java | 2 +-
.../time/IoTDBRealTimeDBTsfilePushConsumerIT.java | 2 +-
...DBTimeRangeAccurateDBDataSetPushConsumerIT.java | 2 +-
.../IoTDBTimeRangeDBDataSetPushConsumerIT.java | 2 +-
.../time/IoTDBTimeRangeDBTsfilePushConsumerIT.java | 2 +-
.../topic/IoTDBDataSet1TopicConsumerSpecialIT.java | 2 +-
.../regression/topic/IoTDBTestTopicNameIT.java | 2 +-
.../regression/user/IoTDBOtherUserConsumerIT.java | 2 +-
.../org/apache/iotdb/tool/tsfile/ExportTsFile.java | 19 +--
.../java/org/apache/iotdb/session/Session.java | 41 +++--
.../payload/SubscriptionSessionDataSet.java | 6 +-
.../apache/iotdb/session/util/SessionUtils.java | 27 ++-
.../iotdb/session/SessionCacheLeaderTest.java | 190 +++++++++++----------
.../java/org/apache/iotdb/session/SessionTest.java | 96 +++++------
.../java/org/apache/iotdb/session/TabletTest.java | 2 +-
.../session/pool/SessionPoolExceptionTest.java | 24 +--
.../apache/iotdb/session/pool/SessionPoolTest.java | 72 ++++----
.../iotdb/session/util/SessionUtilsTest.java | 114 ++++++-------
.../batch/PipeTabletEventTsFileBatch.java | 8 +-
.../request/PipeTransferTabletRawReq.java | 4 +-
.../request/PipeTransferTabletRawReqV2.java | 4 +-
.../protocol/legacy/IoTDBLegacyPipeConnector.java | 2 +-
.../connector/protocol/opcua/OpcUaNameSpace.java | 8 +-
.../pipe/connector/util/PipeTabletEventSorter.java | 16 +-
.../db/pipe/event/common/row/PipeRowCollector.java | 14 +-
.../tablet/PipeInsertNodeTabletInsertionEvent.java | 2 +-
.../common/tablet/PipeRawTabletInsertionEvent.java | 4 +-
.../tablet/parser/TabletInsertionEventParser.java | 25 +--
.../TabletInsertionEventTablePatternParser.java | 8 +-
.../TabletInsertionEventTreePatternParser.java | 2 +-
...ileInsertionEventQueryParserTabletIterator.java | 6 +-
.../scan/TsFileInsertionEventScanParser.java | 6 +-
...ileInsertionEventTableParserTabletIterator.java | 24 ++-
.../twostage/plugin/TwoStageCountProcessor.java | 1 -
.../resource/memory/InsertNodeMemoryEstimator.java | 2 +-
.../common/schematree/ClusterSchemaTree.java | 4 +-
.../schematree/visitor/SchemaTreeVisitor.java | 2 +-
.../execution/MemoryEstimationHelper.java | 4 +-
.../db/queryengine/plan/analyze/TemplatedInfo.java | 2 +-
.../load/TreeSchemaAutoCreatorAndVerifier.java | 12 +-
.../plan/parser/StatementGenerator.java | 6 +-
.../plan/planner/plan/node/write/InsertNode.java | 6 +-
.../planner/plan/node/write/InsertRowNode.java | 2 +-
.../planner/plan/node/write/InsertTabletNode.java | 2 +-
.../plan/relational/metadata/TableSchema.java | 12 +-
.../metadata/fetcher/cache/SchemaCacheEntry.java | 4 +-
.../cache/TreeDeviceSchemaCacheManager.java | 6 +-
.../plan/statement/crud/InsertBaseStatement.java | 2 +-
.../reader/impl/TimeseriesReaderWithViewFetch.java | 3 +-
.../schemaregion/utils/MNodeUtils.java | 2 +-
.../schemaregion/utils/ResourceByPathUtils.java | 4 +-
.../iotdb/db/schemaengine/template/Template.java | 2 +-
.../impl/ReadPointCompactionPerformer.java | 2 +-
.../execute/utils/CompactionTableSchema.java | 28 +--
...BatchedFastAlignedSeriesCompactionExecutor.java | 4 +-
...edReadChunkAlignedSeriesCompactionExecutor.java | 2 +-
.../utils/AlignedSeriesBatchCompactionUtils.java | 2 +-
.../FirstBatchCompactionAlignedChunkWriter.java | 8 +-
...FollowingBatchCompactionAlignedChunkWriter.java | 2 +-
.../fast/FastAlignedSeriesCompactionExecutor.java | 2 +-
.../FastNonAlignedSeriesCompactionExecutor.java | 2 +-
.../readchunk/AlignedSeriesCompactionExecutor.java | 2 +-
.../ReadChunkAlignedSeriesCompactionExecutor.java | 4 +-
.../readchunk/SingleSeriesCompactionExecutor.java | 2 +-
.../compaction/io/CompactionTsFileWriter.java | 6 +-
.../dataregion/memtable/AbstractMemTable.java | 10 +-
.../memtable/AlignedReadOnlyMemChunk.java | 2 +-
.../memtable/AlignedWritableMemChunk.java | 12 +-
.../dataregion/memtable/WritableMemChunkGroup.java | 2 +-
.../dataregion/wal/utils/WALWriteUtils.java | 4 +-
.../splitter/BatchedAlignedValueChunkData.java | 2 +-
.../iotdb/db/tools/TsFileSplitByPartitionTool.java | 4 +-
.../db/trigger/executor/TriggerFireVisitor.java | 5 +-
.../apache/iotdb/db/utils/QueryDataSetUtils.java | 4 +-
.../mtree/schemafile/WrappedSegmentTest.java | 4 +-
.../connector/PipeDataNodeThriftRequestTest.java | 37 ++--
.../pipe/connector/PipeTabletEventSorterTest.java | 60 +++----
.../pipe/event/PipeTabletInsertionEventTest.java | 12 +-
.../pipe/event/TsFileInsertionEventParserTest.java | 1 -
.../resource/PipeTsFileResourceManagerTest.java | 31 ++--
.../common/schematree/ClusterSchemaTreeTest.java | 4 +-
.../AlignedSeriesAggregationScanOperatorTest.java | 2 +-
.../operator/AlignedSeriesScanOperatorTest.java | 10 +-
.../execution/operator/AlignedSeriesTestUtil.java | 12 +-
.../schema/SchemaFetchScanOperatorTest.java | 2 +-
.../plan/parser/StatementGeneratorTest.java | 6 +-
.../logical/RegionScanLogicalPlannerTest.java | 75 +++++++-
.../storageengine/buffer/BloomFilterCacheTest.java | 12 +-
.../db/storageengine/buffer/ChunkCacheTest.java | 8 +-
.../storageengine/dataregion/DataRegionTest.java | 60 +++----
.../dataregion/LastFlushTimeMapTest.java | 20 +--
.../compaction/AbstractCompactionTest.java | 2 +-
.../compaction/CompactionDataTypeNotMatchTest.java | 24 +--
.../compaction/CompactionValidationTest.java | 12 +-
.../dataregion/compaction/cross/MergeTest.java | 8 +-
.../compaction/cross/MergeUpgradeTest.java | 6 +-
.../cross/RewriteCompactionFileSelectorTest.java | 38 ++---
.../inner/AbstractInnerSpaceCompactionTest.java | 8 +-
.../inner/FastCompactionPerformerAlignedTest.java | 16 +-
.../FastCompactionPerformerNoAlignedTest.java | 2 +-
.../inner/InnerCompactionMoreDataTest.java | 8 +-
.../compaction/inner/InnerCompactionTest.java | 8 +-
.../inner/InnerSpaceCompactionExceptionTest.java | 12 +-
.../ReadChunkCompactionPerformerAlignedTest.java | 16 +-
.../ReadChunkCompactionPerformerNoAlignedTest.java | 2 +-
.../inner/ReadChunkCompactionPerformerOldTest.java | 2 +-
.../SizeTieredCompactionRecoverTest.java | 44 +++--
.../inner/sizetiered/SizeTieredCompactionTest.java | 26 +--
.../settle/SettleRequestHandlerTest.java | 2 +-
.../CompactionTableModelTestFileWriter.java | 6 +-
.../CompactionTableSchemaCollectorTest.java | 54 +++---
.../compaction/utils/CompactionCheckerUtils.java | 2 +-
.../dataregion/memtable/TsFileProcessorTest.java | 48 +++---
.../read/reader/series/SeriesReaderTestUtil.java | 10 +-
.../wal/recover/WALRecoverManagerTest.java | 20 +--
.../file/SealedTsFileRecoverPerformerTest.java | 36 ++--
.../wal/recover/file/TsFilePlanRedoerTest.java | 20 +--
.../file/UnsealedTsFileRecoverPerformerTest.java | 20 +--
.../rescon/memory/ResourceManagerTest.java | 8 +-
.../iotdb/db/tools/TsFileAndModSettleToolTest.java | 6 +-
.../iotdb/db/tools/TsFileSelfCheckToolTest.java | 12 +-
.../iotdb/db/tools/TsFileSketchToolTest.java | 20 +--
.../org/apache/iotdb/db/utils/MemUtilsTest.java | 2 +-
.../org/apache/iotdb/commons/path/AlignedPath.java | 2 +-
.../iotdb/commons/path/NonAlignedFullPath.java | 4 +-
.../schema/table/column/TsTableColumnCategory.java | 12 +-
.../commons/schema/view/LogicalViewSchema.java | 22 +--
pom.xml | 2 +-
233 files changed, 1653 insertions(+), 1424 deletions(-)
diff --git a/example/pipe-count-point-processor/src/main/java/org/apache/iotdb/CountPointProcessor.java b/example/pipe-count-point-processor/src/main/java/org/apache/iotdb/CountPointProcessor.java
index 38ba661e7d5..8444ad5e1eb 100644
--- a/example/pipe-count-point-processor/src/main/java/org/apache/iotdb/CountPointProcessor.java
+++ b/example/pipe-count-point-processor/src/main/java/org/apache/iotdb/CountPointProcessor.java
@@ -59,7 +59,7 @@ public class CountPointProcessor implements PipeProcessor {
public void process(
final TabletInsertionEvent tabletInsertionEvent, final EventCollector eventCollector) {
tabletInsertionEvent.processTablet(
- (tablet, rowCollector) -> writePointCount.addAndGet(tablet.rowSize));
+ (tablet, rowCollector) -> writePointCount.addAndGet(tablet.getRowSize()));
}
@Override
@@ -71,7 +71,6 @@ public class CountPointProcessor implements PipeProcessor {
Collections.singletonList(
new MeasurementSchema(aggregateSeries.getMeasurement(), TSDataType.INT64)),
1);
- tablet.rowSize = 1;
tablet.addTimestamp(0, System.currentTimeMillis());
tablet.addValue(aggregateSeries.getMeasurement(), 0, writePointCount.get());
eventCollector.collect(
diff --git a/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java b/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
index 1c412482800..208ef6b2b92 100644
--- a/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
@@ -309,20 +309,21 @@ public class AlignedTimeseriesSessionExample {
long timestamp = 1;
for (long row = 1; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue(
- schemaList.get(0).getMeasurementId(), rowIndex, new SecureRandom().nextLong());
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, new SecureRandom().nextInt());
+ schemaList.get(0).getMeasurementName(), rowIndex, new SecureRandom().nextLong());
+ tablet.addValue(
+ schemaList.get(1).getMeasurementName(), rowIndex, new SecureRandom().nextInt());
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertAlignedTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertAlignedTablet(tablet);
tablet.reset();
}
@@ -344,8 +345,8 @@ public class AlignedTimeseriesSessionExample {
Object[] values = tablet.values;
for (long time = 100; time < 200; time++) {
- int row = tablet.rowSize++;
- timestamps[row] = time;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, time);
long[] sensor1 = (long[]) values[0];
sensor1[row] = new SecureRandom().nextLong();
@@ -353,13 +354,13 @@ public class AlignedTimeseriesSessionExample {
int[] sensor2 = (int[]) values[1];
sensor2[row] = new SecureRandom().nextInt();
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertAlignedTablet(tablet, true);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertAlignedTablet(tablet, true);
tablet.reset();
}
@@ -385,8 +386,8 @@ public class AlignedTimeseriesSessionExample {
bitMaps[1] = new BitMap(tablet.getMaxRowNumber());
for (long time = 200; time < 300; time++) {
- int row = tablet.rowSize++;
- timestamps[row] = time;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, time);
long[] sensor1 = (long[]) values[0];
sensor1[row] = new SecureRandom().nextLong();
@@ -399,14 +400,14 @@ public class AlignedTimeseriesSessionExample {
bitMaps[1].mark(row);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertAlignedTablet(tablet, true);
tablet.reset();
bitMaps[1].reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertAlignedTablet(tablet, true);
tablet.reset();
}
@@ -567,19 +568,19 @@ public class AlignedTimeseriesSessionExample {
// Method 1 to add tablet data
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
tablet1.addTimestamp(row1, timestamp);
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 2; i++) {
long value = new SecureRandom().nextLong();
- tablet1.addValue(schemaList1.get(i).getMeasurementId(), row1, value);
- tablet2.addValue(schemaList2.get(i).getMeasurementId(), row2, value);
- tablet3.addValue(schemaList3.get(i).getMeasurementId(), row3, value);
+ tablet1.addValue(schemaList1.get(i).getMeasurementName(), row1, value);
+ tablet2.addValue(schemaList2.get(i).getMeasurementName(), row2, value);
+ tablet3.addValue(schemaList3.get(i).getMeasurementName(), row3, value);
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
session.insertAlignedTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -588,7 +589,7 @@ public class AlignedTimeseriesSessionExample {
timestamp++;
}
- if (tablet1.rowSize != 0) {
+ if (tablet1.getRowSize() != 0) {
session.insertAlignedTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -604,12 +605,12 @@ public class AlignedTimeseriesSessionExample {
Object[] values3 = tablet3.values;
for (long time = 0; time < 100; time++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
- timestamps1[row1] = time;
- timestamps2[row2] = time;
- timestamps3[row3] = time;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
+ tablet1.addTimestamp(row1, time);
+ tablet2.addTimestamp(row2, time);
+ tablet3.addTimestamp(row3, time);
for (int i = 0; i < 2; i++) {
long[] sensor1 = (long[]) values1[i];
sensor1[row1] = i;
@@ -618,7 +619,7 @@ public class AlignedTimeseriesSessionExample {
long[] sensor3 = (long[]) values3[i];
sensor3[row3] = i;
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
session.insertAlignedTablets(tabletMap, true);
tablet1.reset();
@@ -627,7 +628,7 @@ public class AlignedTimeseriesSessionExample {
}
}
- if (tablet1.rowSize != 0) {
+ if (tablet1.getRowSize() != 0) {
session.insertAlignedTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
diff --git a/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java b/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
index 288ed7eaa03..fb130cce40a 100644
--- a/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
@@ -141,53 +141,55 @@ public class DataMigrationExample {
}
tablet = new Tablet(device, schemaList, 300000);
while (dataIter.next()) {
- int row = tablet.rowSize++;
- tablet.timestamps[row] = dataIter.getLong(1);
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, dataIter.getLong(1));
for (int j = 0; j < schemaList.size(); ++j) {
if (dataIter.isNull(j + 2)) {
- tablet.addValue(schemaList.get(j).getMeasurementId(), row, null);
+ tablet.addValue(schemaList.get(j).getMeasurementName(), row, null);
continue;
}
switch (schemaList.get(j).getType()) {
case BOOLEAN:
tablet.addValue(
- schemaList.get(j).getMeasurementId(), row, dataIter.getBoolean(j + 2));
+ schemaList.get(j).getMeasurementName(), row, dataIter.getBoolean(j + 2));
break;
case INT32:
- tablet.addValue(schemaList.get(j).getMeasurementId(), row, dataIter.getInt(j + 2));
+ tablet.addValue(
+ schemaList.get(j).getMeasurementName(), row, dataIter.getInt(j + 2));
break;
case INT64:
case TIMESTAMP:
- tablet.addValue(schemaList.get(j).getMeasurementId(), row, dataIter.getLong(j + 2));
+ tablet.addValue(
+ schemaList.get(j).getMeasurementName(), row, dataIter.getLong(j + 2));
break;
case FLOAT:
tablet.addValue(
- schemaList.get(j).getMeasurementId(), row, dataIter.getFloat(j + 2));
+ schemaList.get(j).getMeasurementName(), row, dataIter.getFloat(j + 2));
break;
case DOUBLE:
tablet.addValue(
- schemaList.get(j).getMeasurementId(), row, dataIter.getDouble(j + 2));
+ schemaList.get(j).getMeasurementName(), row, dataIter.getDouble(j + 2));
break;
case TEXT:
case STRING:
tablet.addValue(
- schemaList.get(j).getMeasurementId(), row, dataIter.getString(j + 2));
+ schemaList.get(j).getMeasurementName(), row, dataIter.getString(j + 2));
break;
case DATE:
case BLOB:
tablet.addValue(
- schemaList.get(j).getMeasurementId(), row, dataIter.getObject(j + 2));
+ schemaList.get(j).getMeasurementName(), row, dataIter.getObject(j + 2));
break;
default:
LOGGER.info("Migration of this type of data is not supported");
}
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
writerPool.insertTablet(tablet, true);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
writerPool.insertTablet(tablet);
tablet.reset();
}
diff --git a/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java b/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
index 63f91072c39..34f529d257d 100644
--- a/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
@@ -88,19 +88,19 @@ public class HybridTimeseriesSessionExample {
long timestamp = minTime;
for (long row = minTime; row < maxTime; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, row * 10 + 1L);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (int) (row * 10 + 2));
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, row * 10 + 1L);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (int) (row * 10 + 2));
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertAlignedTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertAlignedTablet(tablet);
tablet.reset();
}
diff --git a/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java b/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
index 68e2696724d..694789fe5a6 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
@@ -154,20 +154,20 @@ public class SessionConcurrentExample {
// Method 1 to add tablet data
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
long value = random.nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -177,19 +177,19 @@ public class SessionConcurrentExample {
Object[] values = tablet.values;
for (long time = 0; time < 100; time++) {
- int row = tablet.rowSize++;
- timestamps[row] = time;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, time);
for (int i = 0; i < 3; i++) {
long[] sensor = (long[]) values[i];
sensor[row] = i;
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
diff --git a/example/session/src/main/java/org/apache/iotdb/SessionExample.java b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
index 47254abfae6..ede303b18c5 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
@@ -405,20 +405,20 @@ public class SessionExample {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
long value = random.nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -428,19 +428,19 @@ public class SessionExample {
Object[] values = tablet.values;
for (long time = 0; time < 100; time++) {
- int row = tablet.rowSize++;
- timestamps[row] = time;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, time);
for (int i = 0; i < 3; i++) {
long[] sensor = (long[]) values[i];
sensor[row] = i;
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -478,7 +478,7 @@ public class SessionExample {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
long value = random.nextLong();
@@ -486,16 +486,16 @@ public class SessionExample {
if (row % 3 == s) {
tablet.bitMaps[s].mark((int) row);
}
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -512,8 +512,8 @@ public class SessionExample {
tablet.bitMaps = bitMaps;
for (long time = 0; time < 100; time++) {
- int row = tablet.rowSize++;
- timestamps[row] = time;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, time);
for (int i = 0; i < 3; i++) {
long[] sensor = (long[]) values[i];
// mark null value
@@ -522,13 +522,13 @@ public class SessionExample {
}
sensor[row] = i;
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -554,19 +554,19 @@ public class SessionExample {
// Method 1 to add tablet data
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
tablet1.addTimestamp(row1, timestamp);
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 3; i++) {
long value = random.nextLong();
- tablet1.addValue(schemaList.get(i).getMeasurementId(), row1, value);
- tablet2.addValue(schemaList.get(i).getMeasurementId(), row2, value);
- tablet3.addValue(schemaList.get(i).getMeasurementId(), row3, value);
+ tablet1.addValue(schemaList.get(i).getMeasurementName(), row1, value);
+ tablet2.addValue(schemaList.get(i).getMeasurementName(), row2, value);
+ tablet3.addValue(schemaList.get(i).getMeasurementName(), row3, value);
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
session.insertTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -575,7 +575,7 @@ public class SessionExample {
timestamp++;
}
- if (tablet1.rowSize != 0) {
+ if (tablet1.getRowSize() != 0) {
session.insertTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -591,9 +591,9 @@ public class SessionExample {
Object[] values3 = tablet3.values;
for (long time = 0; time < 100; time++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
timestamps1[row1] = time;
timestamps2[row2] = time;
timestamps3[row3] = time;
@@ -605,7 +605,7 @@ public class SessionExample {
long[] sensor3 = (long[]) values3[i];
sensor3[row3] = i;
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
session.insertTablets(tabletMap, true);
tablet1.reset();
@@ -614,7 +614,7 @@ public class SessionExample {
}
}
- if (tablet1.rowSize != 0) {
+ if (tablet1.getRowSize() != 0) {
session.insertTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -646,10 +646,10 @@ public class SessionExample {
schemaList.add(new MeasurementSchema("s2", TSDataType.TEXT));
Tablet tablet = new Tablet(device, schemaList, 100);
for (int i = 0; i < datas.size(); i++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, i);
// write data of String type or Binary type
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, datas.get(i));
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, datas.get(i));
}
session.insertTablet(tablet);
try (SessionDataSet dataSet = session.executeQueryStatement("select s1, s2 from " + device)) {
diff --git a/example/session/src/main/java/org/apache/iotdb/TableModelSessionExample.java b/example/session/src/main/java/org/apache/iotdb/TableModelSessionExample.java
index cff91ff617d..91923566118 100644
--- a/example/session/src/main/java/org/apache/iotdb/TableModelSessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/TableModelSessionExample.java
@@ -88,18 +88,24 @@ public class TableModelSessionExample {
new MeasurementSchema("model", TSDataType.STRING),
new MeasurementSchema("temperature", TSDataType.FLOAT),
new MeasurementSchema("humidity", TSDataType.DOUBLE)));
- List<Tablet.ColumnType> columnTypeList =
+ List<Tablet.ColumnCategory> columnTypeList =
new ArrayList<>(
Arrays.asList(
- Tablet.ColumnType.ID,
- Tablet.ColumnType.ID,
- Tablet.ColumnType.ID,
- Tablet.ColumnType.ATTRIBUTE,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT));
- Tablet tablet = new Tablet("test1", measurementSchemaList, columnTypeList, 100);
+ Tablet.ColumnCategory.ID,
+ Tablet.ColumnCategory.ID,
+ Tablet.ColumnCategory.ID,
+ Tablet.ColumnCategory.ATTRIBUTE,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT));
+ Tablet tablet =
+ new Tablet(
+ "test1",
+ IMeasurementSchema.getMeasurementNameList(measurementSchemaList),
+ IMeasurementSchema.getDataTypeList(measurementSchemaList),
+ columnTypeList,
+ 100);
for (long timestamp = 0; timestamp < 100; timestamp++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("region_id", rowIndex, "1");
tablet.addValue("plant_id", rowIndex, "5");
@@ -107,12 +113,12 @@ public class TableModelSessionExample {
tablet.addValue("model", rowIndex, "A");
tablet.addValue("temperature", rowIndex, 37.6F);
tablet.addValue("humidity", rowIndex, 111.1);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
diff --git a/example/session/src/main/java/org/apache/iotdb/TableModelSessionPoolExample.java b/example/session/src/main/java/org/apache/iotdb/TableModelSessionPoolExample.java
index eaaa68fcb90..cb161925319 100644
--- a/example/session/src/main/java/org/apache/iotdb/TableModelSessionPoolExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/TableModelSessionPoolExample.java
@@ -28,7 +28,7 @@ import org.apache.iotdb.session.pool.TableSessionPoolBuilder;
import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.write.record.Tablet;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
@@ -106,18 +106,24 @@ public class TableModelSessionPoolExample {
new MeasurementSchema("model", TSDataType.STRING),
new MeasurementSchema("temperature", TSDataType.FLOAT),
new MeasurementSchema("humidity", TSDataType.DOUBLE)));
- List<ColumnType> columnTypeList =
+ List<ColumnCategory> columnTypeList =
new ArrayList<>(
Arrays.asList(
- ColumnType.ID,
- ColumnType.ID,
- ColumnType.ID,
- ColumnType.ATTRIBUTE,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT));
- Tablet tablet = new Tablet("test1", measurementSchemaList, columnTypeList, 100);
+ ColumnCategory.ID,
+ ColumnCategory.ID,
+ ColumnCategory.ID,
+ ColumnCategory.ATTRIBUTE,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT));
+ Tablet tablet =
+ new Tablet(
+ "test1",
+ IMeasurementSchema.getMeasurementNameList(measurementSchemaList),
+ IMeasurementSchema.getDataTypeList(measurementSchemaList),
+ columnTypeList,
+ 100);
for (long timestamp = 0; timestamp < 100; timestamp++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("region_id", rowIndex, "1");
tablet.addValue("plant_id", rowIndex, "5");
@@ -125,12 +131,12 @@ public class TableModelSessionPoolExample {
tablet.addValue("model", rowIndex, "A");
tablet.addValue("temperature", rowIndex, 37.6F);
tablet.addValue("humidity", rowIndex, 111.1);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
diff --git a/example/session/src/main/java/org/apache/iotdb/TabletExample.java b/example/session/src/main/java/org/apache/iotdb/TabletExample.java
index 39f1223efca..f85dba2215b 100644
--- a/example/session/src/main/java/org/apache/iotdb/TabletExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/TabletExample.java
@@ -172,8 +172,7 @@ public class TabletExample {
String deviceId = "root.sg" + i % 8 + "." + i;
Tablet ta = new Tablet(deviceId, schemas, rowSize);
- ta.rowSize = rowSize;
- for (int t = 0; t < ta.rowSize; t++) {
+ for (int t = 0; t < rowSize; t++) {
ta.addTimestamp(t, (Long) data.get(TIME_STR).get(t));
for (Entry<String, TSDataType> entry : measureTSTypeInfos.entrySet()) {
String mea = entry.getKey();
diff --git a/example/trigger/src/main/java/org/apache/iotdb/trigger/StatisticsUpdaterTrigger.java b/example/trigger/src/main/java/org/apache/iotdb/trigger/StatisticsUpdaterTrigger.java
index 6d9f260175a..c8d1c3ece8e 100644
--- a/example/trigger/src/main/java/org/apache/iotdb/trigger/StatisticsUpdaterTrigger.java
+++ b/example/trigger/src/main/java/org/apache/iotdb/trigger/StatisticsUpdaterTrigger.java
@@ -82,15 +82,15 @@ public class StatisticsUpdaterTrigger implements Trigger {
public boolean fire(Tablet tablet) throws Exception {
ensureSession();
if (tablet.bitMaps == null) {
- cnt.addAndGet((long) tablet.rowSize * tablet.getSchemas().size());
+ cnt.addAndGet((long) tablet.getRowSize() * tablet.getSchemas().size());
return true;
}
for (int column = 0; column < tablet.getSchemas().size(); column++) {
BitMap bitMap = tablet.bitMaps[column];
if (bitMap == null) {
- cnt.addAndGet(tablet.rowSize);
+ cnt.addAndGet(tablet.getRowSize());
} else {
- for (int row = 0; row < tablet.rowSize; row++) {
+ for (int row = 0; row < tablet.getRowSize(); row++) {
if (!bitMap.isMarked(row)) {
cnt.incrementAndGet();
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/db/trigger/example/TriggerFireTimesCounter.java b/integration-test/src/main/java/org/apache/iotdb/db/trigger/example/TriggerFireTimesCounter.java
index 2ddfbb17125..fd682a03a29 100644
--- a/integration-test/src/main/java/org/apache/iotdb/db/trigger/example/TriggerFireTimesCounter.java
+++ b/integration-test/src/main/java/org/apache/iotdb/db/trigger/example/TriggerFireTimesCounter.java
@@ -86,7 +86,7 @@ public class TriggerFireTimesCounter implements Trigger {
Thread.sleep(100);
}
}
- int rows = tablet.rowSize;
+ int rows = tablet.getRowSize();
if (fileLock != null && fileLock.isValid()) {
String records = System.lineSeparator() + rows;
ByteBuffer byteBuffer = ByteBuffer.allocate(1024);
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/utils/TsFileGenerator.java b/integration-test/src/main/java/org/apache/iotdb/it/utils/TsFileGenerator.java
index 491e15d280d..a248ceba018 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/utils/TsFileGenerator.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/utils/TsFileGenerator.java
@@ -104,17 +104,17 @@ public class TsFileGenerator implements AutoCloseable {
long startTime = timeSet.isEmpty() ? 0L : timeSet.last();
for (long r = 0; r < number; r++) {
- int row = tablet.rowSize++;
+ int row = tablet.getRowSize();
startTime += timeGap;
- timestamps[row] = startTime;
+ tablet.addTimestamp(row, startTime);
timeSet.add(startTime);
for (int i = 0; i < sensorNum; i++) {
generateDataPoint(values[i], row, schemas.get(i));
}
// write
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
if (!isAligned) {
- writer.write(tablet);
+ writer.writeTree(tablet);
} else {
writer.writeAligned(tablet);
}
@@ -122,9 +122,9 @@ public class TsFileGenerator implements AutoCloseable {
}
}
// write
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
if (!isAligned) {
- writer.write(tablet);
+ writer.writeTree(tablet);
} else {
writer.writeAligned(tablet);
}
@@ -150,17 +150,17 @@ public class TsFileGenerator implements AutoCloseable {
long startTime = startTimestamp;
for (long r = 0; r < number; r++) {
- final int row = tablet.rowSize++;
+ final int row = tablet.getRowSize();
startTime += timeGap;
- timestamps[row] = startTime;
+ tablet.addTimestamp(row, startTime);
timeSet.add(startTime);
for (int i = 0; i < sensorNum; i++) {
generateDataPoint(values[i], row, schemas.get(i));
}
// write
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
if (!isAligned) {
- writer.write(tablet);
+ writer.writeTree(tablet);
} else {
writer.writeAligned(tablet);
}
@@ -168,9 +168,9 @@ public class TsFileGenerator implements AutoCloseable {
}
}
// write
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
if (!isAligned) {
- writer.write(tablet);
+ writer.writeTree(tablet);
} else {
writer.writeAligned(tablet);
}
@@ -252,7 +252,7 @@ public class TsFileGenerator implements AutoCloseable {
throws IOException, IllegalPathException {
try (final ModificationFile modificationFile =
new ModificationFile(ModificationFile.getExclusiveMods(tsFile))) {
- writer.flushAllChunkGroups();
+ writer.flush();
final TreeSet<Long> timeSet = device2TimeSet.get(device);
if (timeSet.isEmpty()) {
return;
@@ -265,7 +265,7 @@ public class TsFileGenerator implements AutoCloseable {
for (final IMeasurementSchema measurementSchema : device2MeasurementSchema.get(device)) {
final ModEntry deletion =
new TreeDeletionEntry(
- new MeasurementPath(device, measurementSchema.getMeasurementId()),
+ new MeasurementPath(device, measurementSchema.getMeasurementName()),
startTime,
endTime);
modificationFile.write(deletion);
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
index c47d84e0574..7483eca6c84 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
@@ -134,7 +134,7 @@ public class IoTDBLoadTsFileIT {
final String sql =
String.format(
"create timeseries %s %s",
- new Path(device, schema.getMeasurementId(), true).getFullPath(),
+ new Path(device, schema.getMeasurementName(), true).getFullPath(),
schema.getType().name());
LOGGER.info("schema execute: {}", sql);
return sql;
@@ -144,7 +144,7 @@ public class IoTDBLoadTsFileIT {
String sql = String.format("create aligned timeseries %s(", device);
for (int i = 0; i < schemas.size(); i++) {
final IMeasurementSchema schema = schemas.get(i);
- sql += (String.format("%s %s", schema.getMeasurementId(), schema.getType().name()));
+ sql += (String.format("%s %s", schema.getMeasurementName(), schema.getType().name()));
sql += (i == schemas.size() - 1 ? ")" : ",");
}
LOGGER.info("schema execute: {}.", sql);
@@ -245,7 +245,7 @@ public class IoTDBLoadTsFileIT {
statement.execute(
String.format(
"delete timeseries %s.%s",
- SchemaConfig.DEVICE_0, SchemaConfig.MEASUREMENT_00.getMeasurementId()));
+ SchemaConfig.DEVICE_0, SchemaConfig.MEASUREMENT_00.getMeasurementName()));
}
}
@@ -306,14 +306,14 @@ public class IoTDBLoadTsFileIT {
Arrays.asList(
"lat",
"lon",
- SchemaConfig.MEASUREMENT_00.getMeasurementId(),
- SchemaConfig.MEASUREMENT_01.getMeasurementId(),
- SchemaConfig.MEASUREMENT_02.getMeasurementId(),
- SchemaConfig.MEASUREMENT_03.getMeasurementId(),
- SchemaConfig.MEASUREMENT_04.getMeasurementId(),
- SchemaConfig.MEASUREMENT_05.getMeasurementId(),
- SchemaConfig.MEASUREMENT_06.getMeasurementId(),
- SchemaConfig.MEASUREMENT_07.getMeasurementId()));
+ SchemaConfig.MEASUREMENT_00.getMeasurementName(),
+ SchemaConfig.MEASUREMENT_01.getMeasurementName(),
+ SchemaConfig.MEASUREMENT_02.getMeasurementName(),
+ SchemaConfig.MEASUREMENT_03.getMeasurementName(),
+ SchemaConfig.MEASUREMENT_04.getMeasurementName(),
+ SchemaConfig.MEASUREMENT_05.getMeasurementName(),
+ SchemaConfig.MEASUREMENT_06.getMeasurementName(),
+ SchemaConfig.MEASUREMENT_07.getMeasurementName()));
try (final ResultSet resultSet = statement.executeQuery("show nodes in schema template t1")) {
while (resultSet.next()) {
String device = resultSet.getString(ColumnHeaderConstant.CHILD_NODES);
@@ -587,7 +587,7 @@ public class IoTDBLoadTsFileIT {
registerSchema();
final String device = SchemaConfig.DEVICE_0;
- final String measurement = SchemaConfig.MEASUREMENT_00.getMeasurementId();
+ final String measurement = SchemaConfig.MEASUREMENT_00.getMeasurementName();
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
index 2e62d837b07..18f805d1354 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
@@ -154,21 +154,21 @@ public class IoTDBPartialInsertionIT {
Tablet tablet = new Tablet("root.sg1.d1", schemaList, 300);
long timestamp = 0;
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
long value = timestamp;
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
timestamp++;
}
timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
long value = timestamp;
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
timestamp++;
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeNullValueIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeNullValueIT.java
index 4d86fd5ed55..d8a1cce4d75 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeNullValueIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeNullValueIT.java
@@ -116,13 +116,13 @@ public class IoTDBPipeNullValueIT extends AbstractPipeDualAutoIT {
partialNullTablet = new Tablet(deviceId, Arrays.asList(schemas), 1);
partialNullTablet.values = valuesForPartialNull;
partialNullTablet.timestamps = new long[] {3};
- partialNullTablet.rowSize = 1;
+ partialNullTablet.setRowSize(1);
partialNullTablet.bitMaps = bitMapsForPartialNull;
allNullTablet = new Tablet(deviceId, Arrays.asList(schemas), 1);
allNullTablet.values = valuesForAllNull;
allNullTablet.timestamps = new long[] {4};
- allNullTablet.rowSize = 1;
+ allNullTablet.setRowSize(1);
allNullTablet.bitMaps = bitMapsForAllNull;
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeReqAutoSliceIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeReqAutoSliceIT.java
index 7ff87375905..78a799601cd 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeReqAutoSliceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeReqAutoSliceIT.java
@@ -410,16 +410,16 @@ public class IoTDBPipeReqAutoSliceIT extends AbstractPipeDualManualIT {
private Pair<List<List<String>>, List<List<TSDataType>>> getMeasurementSchemasAndType(
Tablet tablet) {
- List<List<String>> schemaData = new ArrayList<>(tablet.rowSize);
- List<List<TSDataType>> typeData = new ArrayList<>(tablet.rowSize);
+ List<List<String>> schemaData = new ArrayList<>(tablet.getRowSize());
+ List<List<TSDataType>> typeData = new ArrayList<>(tablet.getRowSize());
List<String> measurementSchemas = new ArrayList<>(tablet.getSchemas().size());
- List<TSDataType> types = new ArrayList<>(tablet.rowSize);
+ List<TSDataType> types = new ArrayList<>(tablet.getRowSize());
for (IMeasurementSchema measurementSchema : tablet.getSchemas()) {
- measurementSchemas.add(measurementSchema.getMeasurementId());
+ measurementSchemas.add(measurementSchema.getMeasurementName());
types.add(measurementSchema.getType());
}
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
schemaData.add(measurementSchemas);
typeData.add(types);
}
@@ -428,18 +428,18 @@ public class IoTDBPipeReqAutoSliceIT extends AbstractPipeDualManualIT {
}
private List<String> getDeviceID(Tablet tablet) {
- List<String> data = new ArrayList<>(tablet.rowSize);
- for (int i = 0; i < tablet.rowSize; i++) {
+ List<String> data = new ArrayList<>(tablet.getRowSize());
+ for (int i = 0; i < tablet.getRowSize(); i++) {
data.add(tablet.getDeviceId());
}
return data;
}
private List<List<Object>> generateTabletInsertRecordForTable(final Tablet tablet) {
- List<List<Object>> insertRecords = new ArrayList<>(tablet.rowSize);
+ List<List<Object>> insertRecords = new ArrayList<>(tablet.getRowSize());
final List<IMeasurementSchema> schemas = tablet.getSchemas();
final Object[] values = tablet.values;
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
List<Object> insertRecord = new ArrayList<>();
for (int j = 0; j < schemas.size(); j++) {
switch (schemas.get(j).getType()) {
@@ -459,10 +459,10 @@ public class IoTDBPipeReqAutoSliceIT extends AbstractPipeDualManualIT {
}
private List<List<String>> generateTabletInsertStrRecordForTable(Tablet tablet) {
- List<List<String>> insertRecords = new ArrayList<>(tablet.rowSize);
+ List<List<String>> insertRecords = new ArrayList<>(tablet.getRowSize());
final List<IMeasurementSchema> schemas = tablet.getSchemas();
final Object[] values = tablet.values;
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
List<String> insertRecord = new ArrayList<>();
for (int j = 0; j < schemas.size(); j++) {
switch (schemas.get(j).getType()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeTypeConversionISessionIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeTypeConversionISessionIT.java
index 6093d048c5c..56082faa780 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeTypeConversionISessionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeTypeConversionISessionIT.java
@@ -300,7 +300,7 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeDualManualIT
String sql = "select ";
StringBuffer param = new StringBuffer();
for (IMeasurementSchema schema : measurementSchemas) {
- param.append(schema.getMeasurementId());
+ param.append(schema.getMeasurementName());
param.append(',');
}
sql = sql + param.substring(0, param.length() - 1);
@@ -317,9 +317,12 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeDualManualIT
String uuid = RandomStringUtils.random(8, true, false);
for (Pair<MeasurementSchema, MeasurementSchema> pair : measurementSchemas) {
createTimeSeries(
- uuid.toString(), pair.left.getMeasurementId(), pair.left.getType().name(), senderEnv);
+ uuid.toString(), pair.left.getMeasurementName(), pair.left.getType().name(), senderEnv);
createTimeSeries(
- uuid.toString(), pair.right.getMeasurementId(), pair.right.getType().name(), receiverEnv);
+ uuid.toString(),
+ pair.right.getMeasurementName(),
+ pair.right.getType().name(),
+ receiverEnv);
}
try (ISession senderSession = senderEnv.getSessionConnection();
@@ -548,16 +551,16 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeDualManualIT
private Pair<List<List<String>>, List<List<TSDataType>>> getMeasurementSchemasAndType(
Tablet tablet) {
- List<List<String>> schemaData = new ArrayList<>(tablet.rowSize);
- List<List<TSDataType>> typeData = new ArrayList<>(tablet.rowSize);
+ List<List<String>> schemaData = new ArrayList<>(tablet.getRowSize());
+ List<List<TSDataType>> typeData = new ArrayList<>(tablet.getRowSize());
List<String> measurementSchemas = new ArrayList<>(tablet.getSchemas().size());
- List<TSDataType> types = new ArrayList<>(tablet.rowSize);
+ List<TSDataType> types = new ArrayList<>(tablet.getRowSize());
for (IMeasurementSchema measurementSchema : tablet.getSchemas()) {
- measurementSchemas.add(measurementSchema.getMeasurementId());
+ measurementSchemas.add(measurementSchema.getMeasurementName());
types.add(measurementSchema.getType());
}
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
schemaData.add(measurementSchemas);
typeData.add(types);
}
@@ -566,8 +569,8 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeDualManualIT
}
private List<String> getDeviceID(Tablet tablet) {
- List<String> data = new ArrayList<>(tablet.rowSize);
- for (int i = 0; i < tablet.rowSize; i++) {
+ List<String> data = new ArrayList<>(tablet.getRowSize());
+ for (int i = 0; i < tablet.getRowSize(); i++) {
data.add(tablet.getDeviceId());
}
return data;
@@ -575,10 +578,10 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeDualManualIT
private List<List<Object>> generateTabletResultSetForTable(
final Tablet tablet, List<Pair<MeasurementSchema, MeasurementSchema>> pairs) {
- List<List<Object>> insertRecords = new ArrayList<>(tablet.rowSize);
+ List<List<Object>> insertRecords = new ArrayList<>(tablet.getRowSize());
final List<IMeasurementSchema> schemas = tablet.getSchemas();
final Object[] values = tablet.values;
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
List<Object> insertRecord = new ArrayList<>();
for (int j = 0; j < schemas.size(); j++) {
TSDataType sourceType = pairs.get(j).left.getType();
@@ -643,10 +646,10 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeDualManualIT
}
private List<List<Object>> generateTabletInsertRecordForTable(final Tablet tablet) {
- List<List<Object>> insertRecords = new ArrayList<>(tablet.rowSize);
+ List<List<Object>> insertRecords = new ArrayList<>(tablet.getRowSize());
final List<IMeasurementSchema> schemas = tablet.getSchemas();
final Object[] values = tablet.values;
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
List<Object> insertRecord = new ArrayList<>();
for (int j = 0; j < schemas.size(); j++) {
switch (schemas.get(j).getType()) {
@@ -686,10 +689,10 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeDualManualIT
}
private List<List<String>> generateTabletInsertStrRecordForTable(Tablet tablet) {
- List<List<String>> insertRecords = new ArrayList<>(tablet.rowSize);
+ List<List<String>> insertRecords = new ArrayList<>(tablet.getRowSize());
final List<IMeasurementSchema> schemas = tablet.getSchemas();
final Object[] values = tablet.values;
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
List<String> insertRecord = new ArrayList<>();
for (int j = 0; j < schemas.size(); j++) {
switch (schemas.get(j).getType()) {
@@ -743,11 +746,11 @@ public class IoTDBPipeTypeConversionISessionIT extends AbstractPipeDualManualIT
for (int i = 0; i < bitMaps.length; i++) {
bitMaps[i] = new BitMap(generateDataSize);
}
- List<Tablet.ColumnType> columnTypes = new ArrayList<>(pairs.size());
+ List<Tablet.ColumnCategory> columnTypes = new ArrayList<>(pairs.size());
for (int i = 0; i < objects.length; i++) {
MeasurementSchema schema = pairs.get(i).left;
measurementSchemas.add(schema);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
switch (schema.getType()) {
case INT64:
objects[i] = createTestDataForInt64();
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/tablemodel/TableModelUtils.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/tablemodel/TableModelUtils.java
index 8ee0241312f..4966d0abdc5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/tablemodel/TableModelUtils.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/tablemodel/TableModelUtils.java
@@ -221,7 +221,7 @@ public class TableModelUtils {
public static Set<String> generateExpectedResults(Tablet tablet) {
Set<String> expectedResSet = new HashSet<>();
List<IMeasurementSchema> schemas = tablet.getSchemas();
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
StringBuilder stringBuffer = new StringBuilder();
for (int j = 0; j < tablet.getSchemas().size(); j++) {
BitMap bitMap = tablet.bitMaps[j];
@@ -352,18 +352,24 @@ public class TableModelUtils {
schemaList.add(new MeasurementSchema("s7", TSDataType.DATE));
schemaList.add(new MeasurementSchema("s8", TSDataType.TEXT));
- final List<Tablet.ColumnType> columnTypes =
+ final List<Tablet.ColumnCategory> columnTypes =
Arrays.asList(
- Tablet.ColumnType.ID,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT);
- Tablet tablet = new Tablet(tableName, schemaList, columnTypes, end - start);
+ Tablet.ColumnCategory.ID,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT);
+ Tablet tablet =
+ new Tablet(
+ tableName,
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ end - start);
tablet.initBitMaps();
Random random = new Random();
@@ -371,7 +377,7 @@ public class TableModelUtils {
for (long row = 0; row < end - start; row++) {
int randomNumber = allowNullValue ? random.nextInt(9) : 9;
long value = start + row;
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, value);
tablet.addValue(
"s0", rowIndex, new Binary(String.valueOf(value).getBytes(StandardCharsets.UTF_8)));
diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBInsertTableIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBInsertTableIT.java
index 1f2d51b6633..816aba7c183 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBInsertTableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBInsertTableIT.java
@@ -34,7 +34,7 @@ import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.read.common.RowRecord;
import org.apache.tsfile.utils.Binary;
import org.apache.tsfile.write.record.Tablet;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.junit.AfterClass;
@@ -186,37 +186,43 @@ public class IoTDBInsertTableIT {
schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s2", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s3", TSDataType.INT64));
- final List<Tablet.ColumnType> columnTypes =
+ final List<ColumnCategory> columnTypes =
Arrays.asList(
- Tablet.ColumnType.ID,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT);
- Tablet tablet = new Tablet("sg6", schemaList, columnTypes, 300);
+ ColumnCategory.ID,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT);
+ Tablet tablet =
+ new Tablet(
+ "sg6",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 300);
long timestamp = 0;
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 4; s++) {
long value = timestamp;
if (s == 0) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, "d1");
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, "d1");
} else {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
}
timestamp++;
}
timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 4; s++) {
long value = timestamp;
if (s == 0) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, "d1");
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, "d1");
} else {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
}
timestamp++;
@@ -571,14 +577,20 @@ public class IoTDBInsertTableIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("TaBle19_2", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "TaBle19_2",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
@@ -613,20 +625,25 @@ public class IoTDBInsertTableIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
List<String> measurementIds =
schemaList.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList());
- List<TSDataType> dataTypes =
- schemaList.stream().map(IMeasurementSchema::getType).collect(Collectors.toList());
+ List<TSDataType> dataTypes = IMeasurementSchema.getDataTypeList(schemaList);
long timestamp = 0;
- Tablet tablet = new Tablet("TaBle19_3", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "TaBle19_3",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
@@ -657,25 +674,31 @@ public class IoTDBInsertTableIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("TaBle19_4", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "TaBle19_4",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -706,25 +729,31 @@ public class IoTDBInsertTableIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("TaBle19_5", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "TaBle19_5",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -776,26 +805,32 @@ public class IoTDBInsertTableIT {
schemas.add(new MeasurementSchema("blob", TSDataType.BLOB));
schemas.add(new MeasurementSchema("timestamp", TSDataType.TIMESTAMP));
schemas.add(new MeasurementSchema("date", TSDataType.DATE));
- final List<Tablet.ColumnType> columnTypes =
+ final List<ColumnCategory> columnTypes =
Arrays.asList(
- Tablet.ColumnType.ID,
- Tablet.ColumnType.ATTRIBUTE,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT);
+ ColumnCategory.ID,
+ ColumnCategory.ATTRIBUTE,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table20", schemas, columnTypes, 10);
+ Tablet tablet =
+ new Tablet(
+ "table20",
+ IMeasurementSchema.getMeasurementNameList(schemas),
+ IMeasurementSchema.getDataTypeList(schemas),
+ columnTypes,
+ 10);
for (long row = 0; row < 10; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("device_id", rowIndex, "1");
tablet.addValue("attribute", rowIndex, "1");
@@ -913,14 +948,21 @@ public class IoTDBInsertTableIT {
List<IMeasurementSchema> schemaList = new ArrayList<>();
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
- final List<ColumnType> columnTypes = Arrays.asList(ColumnType.ID, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.MEASUREMENT);
// all expired
long timestamp = 0;
- Tablet tablet = new Tablet("sg23", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "sg23",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 3; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("s1", rowIndex, row);
@@ -936,7 +978,7 @@ public class IoTDBInsertTableIT {
tablet.reset();
timestamp = System.currentTimeMillis() - 10000;
for (long row = 0; row < 4; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("s1", rowIndex, row);
@@ -980,24 +1022,30 @@ public class IoTDBInsertTableIT {
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
schemaList.add(new MeasurementSchema("m2", TSDataType.DOUBLE));
- final List<Tablet.ColumnType> columnTypes =
+ final List<ColumnCategory> columnTypes =
Arrays.asList(
- Tablet.ColumnType.ID,
- Tablet.ColumnType.ATTRIBUTE,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT);
+ ColumnCategory.ID,
+ ColumnCategory.ATTRIBUTE,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table4", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "table4",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
tablet.addValue("m2", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insert(tablet);
} catch (StatementExecutionException e) {
@@ -1015,13 +1063,13 @@ public class IoTDBInsertTableIT {
session.executeNonQueryStatement("FLush");
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, 14 - row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
tablet.addValue("m2", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insert(tablet);
} catch (StatementExecutionException e) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/orderBy/IoTDBOrderByTableIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/orderBy/IoTDBOrderByTableIT.java
index 6dff2e11d3e..84da55ea3c7 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/orderBy/IoTDBOrderByTableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/orderBy/IoTDBOrderByTableIT.java
@@ -1475,15 +1475,17 @@ public class IoTDBOrderByTableIT {
schemaList.add(new MeasurementSchema("floatNum", TSDataType.DOUBLE));
schemaList.add(new MeasurementSchema("str", TSDataType.TEXT));
schemaList.add(new MeasurementSchema("bool", TSDataType.BOOLEAN));
- final List<Tablet.ColumnType> columnTypes =
+ final List<Tablet.ColumnCategory> columnTypes =
Arrays.asList(
- Tablet.ColumnType.ID,
- Tablet.ColumnType.ATTRIBUTE,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT);
+ Tablet.ColumnCategory.ID,
+ Tablet.ColumnCategory.ATTRIBUTE,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT);
+ List<String> measurementIds = IMeasurementSchema.getMeasurementNameList(schemaList);
+ List<TSDataType> dataTypes = IMeasurementSchema.getDataTypeList(schemaList);
List<Object[]> values =
Arrays.asList(
@@ -1502,12 +1504,12 @@ public class IoTDBOrderByTableIT {
new Object[] {"d1", "a1", 14, 2907483648L, 231.34, "cherry", false},
new Object[] {"d1", "a1", 13, 2107483648L, 54.12, "lychee", true},
new Object[] {"d1", "a1", 15, 3147483648L, 235.213, "watermelon", true});
- Tablet tablet = new Tablet("table0", schemaList, columnTypes, TIMES.size());
+ Tablet tablet = new Tablet("table0", measurementIds, dataTypes, columnTypes, TIMES.size());
for (int i = 0; i < TIMES.size(); i++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, TIMES.get(i));
for (int j = 0; j < schemaList.size(); j++) {
- tablet.addValue(schemaList.get(j).getMeasurementId(), rowIndex, values.get(i)[j]);
+ tablet.addValue(schemaList.get(j).getMeasurementName(), rowIndex, values.get(i)[j]);
}
}
session.insert(tablet);
@@ -1528,15 +1530,17 @@ public class IoTDBOrderByTableIT {
schemaList.add(new MeasurementSchema("floatNum", TSDataType.DOUBLE));
schemaList.add(new MeasurementSchema("str", TSDataType.TEXT));
schemaList.add(new MeasurementSchema("bool", TSDataType.BOOLEAN));
- final List<Tablet.ColumnType> columnTypes =
+ final List<Tablet.ColumnCategory> columnTypes =
Arrays.asList(
- Tablet.ColumnType.ID,
- Tablet.ColumnType.ATTRIBUTE,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT,
- Tablet.ColumnType.MEASUREMENT);
+ Tablet.ColumnCategory.ID,
+ Tablet.ColumnCategory.ATTRIBUTE,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT,
+ Tablet.ColumnCategory.MEASUREMENT);
+ List<String> measurementIds = IMeasurementSchema.getMeasurementNameList(schemaList);
+ List<TSDataType> dataTypes = IMeasurementSchema.getDataTypeList(schemaList);
List<Object[]> values =
Arrays.asList(
new Object[] {"d2", "a2", 3, 2947483648L, 231.2121, "coconut", false},
@@ -1554,12 +1558,12 @@ public class IoTDBOrderByTableIT {
new Object[] {"d2", "a2", 14, 2907483648L, 231.34, "cherry", false},
new Object[] {"d2", "a2", 13, 2107483648L, 54.12, "lychee", true},
new Object[] {"d2", "a2", 15, 3147483648L, 235.213, "watermelon", true});
- Tablet tablet = new Tablet("table0", schemaList, columnTypes, TIMES.size());
+ Tablet tablet = new Tablet("table0", measurementIds, dataTypes, columnTypes, TIMES.size());
for (int i = 0; i < TIMES.size(); i++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, TIMES.get(i));
for (int j = 0; j < schemaList.size(); j++) {
- tablet.addValue(schemaList.get(j).getMeasurementId(), rowIndex, values.get(i)[j]);
+ tablet.addValue(schemaList.get(j).getMeasurementName(), rowIndex, values.get(i)[j]);
}
}
session.insert(tablet);
diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/session/pool/IoTDBInsertTableSessionPoolIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/session/pool/IoTDBInsertTableSessionPoolIT.java
index 3c71417404e..9441bca94b5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/session/pool/IoTDBInsertTableSessionPoolIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/session/pool/IoTDBInsertTableSessionPoolIT.java
@@ -33,7 +33,7 @@ import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.read.common.RowRecord;
import org.apache.tsfile.utils.Binary;
import org.apache.tsfile.write.record.Tablet;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.junit.AfterClass;
@@ -48,6 +48,7 @@ import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.stream.Collectors;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -85,37 +86,43 @@ public class IoTDBInsertTableSessionPoolIT {
schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s2", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s3", TSDataType.INT64));
- final List<ColumnType> columnTypes =
+ final List<ColumnCategory> columnTypes =
Arrays.asList(
- ColumnType.ID,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT);
- Tablet tablet = new Tablet("sg6", schemaList, columnTypes, 300);
+ ColumnCategory.ID,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT);
+ Tablet tablet =
+ new Tablet(
+ "sg6",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 300);
long timestamp = 0;
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 4; s++) {
long value = timestamp;
if (s == 0) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, "d1");
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, "d1");
} else {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
}
timestamp++;
}
timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 4; s++) {
long value = timestamp;
if (s == 0) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, "d1");
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, "d1");
} else {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
}
timestamp++;
@@ -184,26 +191,32 @@ public class IoTDBInsertTableSessionPoolIT {
schemas.add(new MeasurementSchema("blob", TSDataType.BLOB));
schemas.add(new MeasurementSchema("timestamp", TSDataType.TIMESTAMP));
schemas.add(new MeasurementSchema("date", TSDataType.DATE));
- final List<ColumnType> columnTypes =
+ final List<ColumnCategory> columnTypes =
Arrays.asList(
- ColumnType.ID,
- ColumnType.ATTRIBUTE,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT,
- ColumnType.MEASUREMENT);
+ ColumnCategory.ID,
+ ColumnCategory.ATTRIBUTE,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table20", schemas, columnTypes, 10);
+ Tablet tablet =
+ new Tablet(
+ "table20",
+ IMeasurementSchema.getMeasurementNameList(schemas),
+ schemas.stream().map(IMeasurementSchema::getType).collect(Collectors.toList()),
+ columnTypes,
+ 10);
for (long row = 0; row < 10; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("device_id", rowIndex, "1");
tablet.addValue("attribute", rowIndex, "1");
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionAlignedInsertIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionAlignedInsertIT.java
index e34dae76ef5..2340cf3f326 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionAlignedInsertIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionAlignedInsertIT.java
@@ -300,19 +300,19 @@ public class IoTDBSessionAlignedInsertIT {
long timestamp = 0;
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, row * 10 + 1L);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (int) (row * 10 + 2));
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, row * 10 + 1L);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (int) (row * 10 + 2));
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertAlignedTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertAlignedTablet(tablet);
tablet.reset();
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionComplexIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionComplexIT.java
index ca73d0c13f5..6e8a231c310 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionComplexIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionComplexIT.java
@@ -283,43 +283,45 @@ public class IoTDBSessionComplexIT {
Tablet tablet = new Tablet(deviceId, schemaList, 100);
for (long time = 0; time < 100; time++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
long value = 0;
tablet.addTimestamp(rowIndex, time);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
value++;
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
+ tablet.bitMaps = null;
}
long[] timestamps = tablet.timestamps;
Object[] values = tablet.values;
for (long time = 0; time < 100; time++) {
- int row = tablet.rowSize++;
- timestamps[row] = time;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, time);
for (int i = 0; i < 3; i++) {
long[] sensor = (long[]) values[i];
sensor[row] = i;
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
+ tablet.bitMaps = null;
}
}
@@ -388,12 +390,12 @@ public class IoTDBSessionComplexIT {
for (long time = 0; time < 10 * timePartition; time += timePartition / 10) {
for (Tablet tablet : tabletMap.values()) {
long value = 0;
- tablet.addTimestamp(tablet.rowSize, time);
+ int rowSize = tablet.getRowSize();
+ tablet.addTimestamp(rowSize, time);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), tablet.rowSize, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowSize, value);
value++;
}
- tablet.rowSize++;
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionDisableMemControlIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionDisableMemControlIT.java
index b3864c5f021..a24e2c20c26 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionDisableMemControlIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionDisableMemControlIT.java
@@ -96,12 +96,12 @@ public class IoTDBSessionDisableMemControlIT {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s1", rowIndex, 1L);
tablet.addValue("s2", rowIndex, 1D);
tablet.addValue("s3", rowIndex, new Binary("1", TSFileConfig.STRING_CHARSET));
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insertTablet(tablet, true);
} catch (StatementExecutionException e) {
@@ -114,7 +114,7 @@ public class IoTDBSessionDisableMemControlIT {
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
try {
session.insertTablet(tablet);
} catch (StatementExecutionException e) {
@@ -175,12 +175,12 @@ public class IoTDBSessionDisableMemControlIT {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s1", rowIndex, 1L);
tablet.addValue("s2", rowIndex, 1D);
tablet.addValue("s3", rowIndex, new Binary("1", TSFileConfig.STRING_CHARSET));
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insertAlignedTablet(tablet, true);
} catch (StatementExecutionException e) {
@@ -193,7 +193,7 @@ public class IoTDBSessionDisableMemControlIT {
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
try {
session.insertAlignedTablet(tablet);
} catch (StatementExecutionException e) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionInsertWithTriggerExecutionIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionInsertWithTriggerExecutionIT.java
index 00bd729d4db..ef217d4f57a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionInsertWithTriggerExecutionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionInsertWithTriggerExecutionIT.java
@@ -306,17 +306,17 @@ public class IoTDBSessionInsertWithTriggerExecutionIT {
long timestamp = 1;
for (int i = 0; i < rows; i++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
measurementList.forEach(measurement -> tablet.addValue(measurement, rowIndex, 1));
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionRelationalIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionRelationalIT.java
index 47ba178dd63..d3e4cc4a23e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionRelationalIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionRelationalIT.java
@@ -31,7 +31,7 @@ import org.apache.iotdb.rpc.StatementExecutionException;
import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.read.common.RowRecord;
import org.apache.tsfile.write.record.Tablet;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.junit.After;
@@ -149,25 +149,31 @@ public class IoTDBSessionRelationalIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table1", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "table1",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -175,18 +181,18 @@ public class IoTDBSessionRelationalIT {
session.executeNonQueryStatement("FLush");
for (long row = 15; row < 30; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -307,21 +313,30 @@ public class IoTDBSessionRelationalIT {
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
schemaList.add(new MeasurementSchema("m2", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
+ final List<ColumnCategory> columnTypes =
Arrays.asList(
- ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT, ColumnType.MEASUREMENT);
+ ColumnCategory.ID,
+ ColumnCategory.ATTRIBUTE,
+ ColumnCategory.MEASUREMENT,
+ ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table4", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "table4",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
tablet.addValue("m2", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insert(tablet);
} catch (StatementExecutionException e) {
@@ -336,7 +351,7 @@ public class IoTDBSessionRelationalIT {
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
try {
session.insert(tablet);
} catch (StatementExecutionException e) {
@@ -352,13 +367,13 @@ public class IoTDBSessionRelationalIT {
session.executeNonQueryStatement("FLush");
for (long row = 15; row < 30; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
tablet.addValue("m2", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insert(tablet);
} catch (StatementExecutionException e) {
@@ -372,7 +387,7 @@ public class IoTDBSessionRelationalIT {
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
try {
session.insert(tablet);
} catch (StatementExecutionException e) {
@@ -421,25 +436,31 @@ public class IoTDBSessionRelationalIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table5", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "table5",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -447,18 +468,18 @@ public class IoTDBSessionRelationalIT {
session.executeNonQueryStatement("FLush");
for (long row = 15; row < 30; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -492,25 +513,31 @@ public class IoTDBSessionRelationalIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table5", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "table5",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -518,19 +545,19 @@ public class IoTDBSessionRelationalIT {
session.executeNonQueryStatement("FLush");
for (long row = 15; row < 30; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
// cache leader should work for devices that have inserted before
tablet.addValue("id1", rowIndex, "id:" + (row - 15));
tablet.addValue("attr1", rowIndex, "attr:" + (row - 15));
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -566,25 +593,31 @@ public class IoTDBSessionRelationalIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table7", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "table7",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -592,18 +625,18 @@ public class IoTDBSessionRelationalIT {
session.executeNonQueryStatement("FLush");
for (long row = 15; row < 30; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -633,14 +666,20 @@ public class IoTDBSessionRelationalIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table6", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "table6",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (int row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
@@ -652,7 +691,7 @@ public class IoTDBSessionRelationalIT {
session.executeNonQueryStatement("FLush");
for (int row = 15; row < 30; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id1", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
@@ -688,25 +727,31 @@ public class IoTDBSessionRelationalIT {
schemaList.add(new MeasurementSchema("id2", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(ColumnCategory.ID, ColumnCategory.ATTRIBUTE, ColumnCategory.MEASUREMENT);
long timestamp = 0;
- Tablet tablet = new Tablet("table8", schemaList, columnTypes, 15);
+ Tablet tablet =
+ new Tablet(
+ "table8",
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id2", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -714,18 +759,18 @@ public class IoTDBSessionRelationalIT {
session.executeNonQueryStatement("FLush");
for (long row = 15; row < 30; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id2", rowIndex, "id:" + row);
tablet.addValue("attr1", rowIndex, "attr:" + row);
tablet.addValue("m1", rowIndex, row * 1.0);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insert(tablet);
tablet.reset();
}
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insert(tablet);
tablet.reset();
}
@@ -763,14 +808,20 @@ public class IoTDBSessionRelationalIT {
schemaList.add(new MeasurementSchema("id1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("attr1", TSDataType.STRING));
schemaList.add(new MeasurementSchema("m1", TSDataType.DOUBLE));
- final List<ColumnType> columnTypes =
- Arrays.asList(ColumnType.ID, ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT);
+ final List<ColumnCategory> columnTypes =
+ Arrays.asList(
+ ColumnCategory.ID,
+ ColumnCategory.ID,
+ ColumnCategory.ATTRIBUTE,
+ ColumnCategory.MEASUREMENT);
+ List<String> measurementIds = IMeasurementSchema.getMeasurementNameList(schemaList);
+ List<TSDataType> dataTypes = IMeasurementSchema.getDataTypeList(schemaList);
long timestamp = 0;
- Tablet tablet = new Tablet("table9", schemaList, columnTypes, 15);
+ Tablet tablet = new Tablet("table9", measurementIds, dataTypes, columnTypes, 15);
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id2", rowIndex, "id2:" + row);
tablet.addValue("id1", rowIndex, "id1:" + row);
@@ -783,7 +834,7 @@ public class IoTDBSessionRelationalIT {
session.executeNonQueryStatement("FLush");
for (long row = 15; row < 30; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + row);
tablet.addValue("id2", rowIndex, "id2:" + row);
tablet.addValue("id1", rowIndex, "id1:" + row);
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
index afc6646ef6f..7cfbed9fabe 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
@@ -114,19 +114,19 @@ public class IoTDBSessionSimpleIT {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s1", rowIndex, 1L);
tablet.addValue("s2", rowIndex, 1D);
tablet.addValue("s3", rowIndex, new Binary("1", TSFileConfig.STRING_CHARSET));
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -167,25 +167,25 @@ public class IoTDBSessionSimpleIT {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 15; row++) {
- int rowIndex1 = tablet1.rowSize++;
+ int rowIndex1 = tablet1.getRowSize();
tablet1.addTimestamp(rowIndex1, timestamp);
tablet1.addValue("s1", rowIndex1, 1L);
tablet1.addValue("s2", rowIndex1, 1D);
tablet1.addValue("s3", rowIndex1, new Binary("1", TSFileConfig.STRING_CHARSET));
- int rowIndex2 = tablet2.rowSize++;
+ int rowIndex2 = tablet2.getRowSize();
tablet2.addTimestamp(rowIndex2, timestamp);
tablet2.addValue("s1", rowIndex2, 1L);
tablet2.addValue("s2", rowIndex2, 1D);
tablet2.addValue("s3", rowIndex2, new Binary("1", TSFileConfig.STRING_CHARSET));
- int rowIndex3 = tablet3.rowSize++;
+ int rowIndex3 = tablet3.getRowSize();
tablet3.addTimestamp(rowIndex3, timestamp);
tablet3.addValue("s1", rowIndex3, 1L);
tablet3.addValue("s2", rowIndex3, 1D);
tablet3.addValue("s3", rowIndex3, new Binary("1", TSFileConfig.STRING_CHARSET));
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
session.insertTablets(tabletMap);
tablet1.reset();
tablet2.reset();
@@ -194,7 +194,7 @@ public class IoTDBSessionSimpleIT {
timestamp++;
}
- if (tablet1.rowSize != 0) {
+ if (tablet1.getRowSize() != 0) {
session.insertTablets(tabletMap);
tablet1.reset();
tablet2.reset();
@@ -446,20 +446,20 @@ public class IoTDBSessionSimpleIT {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 10; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue(
- schemaList.get(0).getMeasurementId(), rowIndex, new SecureRandom().nextLong());
+ schemaList.get(0).getMeasurementName(), rowIndex, new SecureRandom().nextLong());
tablet.addValue(
- schemaList.get(1).getMeasurementId(), rowIndex, new SecureRandom().nextInt());
+ schemaList.get(1).getMeasurementName(), rowIndex, new SecureRandom().nextInt());
tablet.addValue(
- schemaList.get(2).getMeasurementId(),
+ schemaList.get(2).getMeasurementName(),
rowIndex,
new Binary("test", TSFileConfig.STRING_CHARSET));
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertAlignedTablet(tablet);
tablet.reset();
}
@@ -491,16 +491,16 @@ public class IoTDBSessionSimpleIT {
Tablet tablet = new Tablet("root.sg1.d1", schemaList);
for (long time = 0; time < 10; time++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, time);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, (double) time);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (float) time);
- tablet.addValue(schemaList.get(2).getMeasurementId(), rowIndex, time);
- tablet.addValue(schemaList.get(3).getMeasurementId(), rowIndex, (int) time);
- tablet.addValue(schemaList.get(4).getMeasurementId(), rowIndex, time % 2 == 0);
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, (double) time);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (float) time);
+ tablet.addValue(schemaList.get(2).getMeasurementName(), rowIndex, time);
+ tablet.addValue(schemaList.get(3).getMeasurementName(), rowIndex, (int) time);
+ tablet.addValue(schemaList.get(4).getMeasurementName(), rowIndex, time % 2 == 0);
tablet.addValue(
- schemaList.get(5).getMeasurementId(),
+ schemaList.get(5).getMeasurementName(),
rowIndex,
new Binary(String.valueOf(time), TSFileConfig.STRING_CHARSET));
}
@@ -514,7 +514,7 @@ public class IoTDBSessionSimpleIT {
}
tablet.bitMaps = bitMaps;
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -548,22 +548,22 @@ public class IoTDBSessionSimpleIT {
Tablet tablet = new Tablet("root.sg1.d1", schemaList);
for (long time = 0; time < 10; time++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, time);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, (double) time);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (float) time);
- tablet.addValue(schemaList.get(2).getMeasurementId(), rowIndex, time);
- tablet.addValue(schemaList.get(3).getMeasurementId(), rowIndex, (int) time);
- tablet.addValue(schemaList.get(4).getMeasurementId(), rowIndex, time % 2 == 0);
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, (double) time);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (float) time);
+ tablet.addValue(schemaList.get(2).getMeasurementName(), rowIndex, time);
+ tablet.addValue(schemaList.get(3).getMeasurementName(), rowIndex, (int) time);
+ tablet.addValue(schemaList.get(4).getMeasurementName(), rowIndex, time % 2 == 0);
tablet.addValue(
- schemaList.get(5).getMeasurementId(),
+ schemaList.get(5).getMeasurementName(),
rowIndex,
new Binary("Text" + time, TSFileConfig.STRING_CHARSET));
- tablet.addValue(schemaList.get(6).getMeasurementId(), rowIndex, "Text" + time);
+ tablet.addValue(schemaList.get(6).getMeasurementName(), rowIndex, "Text" + time);
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -595,22 +595,22 @@ public class IoTDBSessionSimpleIT {
Tablet tablet = new Tablet("root.sg1.d1", schemaList);
for (long time = 0; time < 10; time++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, -time);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, (double) time);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (float) time);
- tablet.addValue(schemaList.get(2).getMeasurementId(), rowIndex, time);
- tablet.addValue(schemaList.get(3).getMeasurementId(), rowIndex, (int) time);
- tablet.addValue(schemaList.get(4).getMeasurementId(), rowIndex, time % 2 == 0);
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, (double) time);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (float) time);
+ tablet.addValue(schemaList.get(2).getMeasurementName(), rowIndex, time);
+ tablet.addValue(schemaList.get(3).getMeasurementName(), rowIndex, (int) time);
+ tablet.addValue(schemaList.get(4).getMeasurementName(), rowIndex, time % 2 == 0);
tablet.addValue(
- schemaList.get(5).getMeasurementId(),
+ schemaList.get(5).getMeasurementName(),
rowIndex,
new Binary("Text" + time, TSFileConfig.STRING_CHARSET));
- tablet.addValue(schemaList.get(6).getMeasurementId(), rowIndex, "Text" + time);
+ tablet.addValue(schemaList.get(6).getMeasurementName(), rowIndex, "Text" + time);
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -643,22 +643,22 @@ public class IoTDBSessionSimpleIT {
Tablet tablet = new Tablet("root.sg1.d1", schemaList);
for (long time = 1694689856546000000L; time < 1694689856546000010L; time++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, time);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, (double) time);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (float) time);
- tablet.addValue(schemaList.get(2).getMeasurementId(), rowIndex, time);
- tablet.addValue(schemaList.get(3).getMeasurementId(), rowIndex, (int) time);
- tablet.addValue(schemaList.get(4).getMeasurementId(), rowIndex, time % 2 == 0);
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, (double) time);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (float) time);
+ tablet.addValue(schemaList.get(2).getMeasurementName(), rowIndex, time);
+ tablet.addValue(schemaList.get(3).getMeasurementName(), rowIndex, (int) time);
+ tablet.addValue(schemaList.get(4).getMeasurementName(), rowIndex, time % 2 == 0);
tablet.addValue(
- schemaList.get(5).getMeasurementId(),
+ schemaList.get(5).getMeasurementName(),
rowIndex,
new Binary("Text" + time, TSFileConfig.STRING_CHARSET));
- tablet.addValue(schemaList.get(6).getMeasurementId(), rowIndex, "Text" + time);
+ tablet.addValue(schemaList.get(6).getMeasurementName(), rowIndex, "Text" + time);
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -678,15 +678,15 @@ public class IoTDBSessionSimpleIT {
Tablet tablet = new Tablet("root.sg1.d1", schemaList);
for (long time = 0L; time < 10L; time++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, time);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, (double) time);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (double) time);
- tablet.addValue(schemaList.get(2).getMeasurementId(), rowIndex, (double) time);
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, (double) time);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (double) time);
+ tablet.addValue(schemaList.get(2).getMeasurementName(), rowIndex, (double) time);
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -1437,11 +1437,11 @@ public class IoTDBSessionSimpleIT {
5);
long ts = 7L;
for (long row = 0; row < 8; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, ts);
tablet.addValue("s1", rowIndex, 1);
tablet.addValue("s2", rowIndex, 1.0F);
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
@@ -1476,15 +1476,15 @@ public class IoTDBSessionSimpleIT {
tablets.put("root.sg.d2", tablet2);
long ts = 16L;
for (long row = 0; row < 8; row++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
tablet1.addTimestamp(row1, ts);
tablet2.addTimestamp(row2, ts);
tablet1.addValue("s1", row1, 1);
tablet1.addValue("s2", row1, 1.0F);
tablet2.addValue("s1", row2, 1);
tablet2.addValue("s2", row2, 1.0F);
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
session.insertTablets(tablets, true);
tablet1.reset();
tablet2.reset();
@@ -1695,12 +1695,12 @@ public class IoTDBSessionSimpleIT {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 15; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s1", rowIndex, 1L);
tablet.addValue("s2", rowIndex, 1D);
tablet.addValue("s3", rowIndex, new Binary("1", TSFileConfig.STRING_CHARSET));
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insertTablet(tablet, true);
} catch (StatementExecutionException e) {
@@ -1712,7 +1712,7 @@ public class IoTDBSessionSimpleIT {
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
try {
session.insertTablet(tablet);
} catch (StatementExecutionException e) {
@@ -1766,10 +1766,10 @@ public class IoTDBSessionSimpleIT {
Tablet tablet = new Tablet("root.sg1.d1", schemaList, 100);
for (int i = 0; i < bytesData.size(); i++) {
byte[] data = (byte[]) bytesData.get(i);
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, i);
Binary dataBinary = new Binary(data);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, dataBinary);
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, dataBinary);
}
session.insertTablet(tablet);
// check result
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSyntaxConventionIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSyntaxConventionIT.java
index 05d045ebc38..3c6acbae52c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSyntaxConventionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSyntaxConventionIT.java
@@ -271,8 +271,8 @@ public class IoTDBSessionSyntaxConventionIT {
Object[] values = tablet.values;
for (long time = 0; time < 10; time++) {
- int row = tablet.rowSize++;
- timestamps[row] = time;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, time);
long[] sensor = (long[]) values[0];
sensor[row] = time;
double[] sensor2 = (double[]) values[1];
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/SessionIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/SessionIT.java
index 05ee72f6076..92c9d1d0456 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/SessionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/SessionIT.java
@@ -92,8 +92,8 @@ public class SessionIT {
Object[] values = tablet.values;
for (long time = 0; time < 10; time++) {
- int row = tablet.rowSize++;
- timestamps[row] = time;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, time);
long[] sensor = (long[]) values[0];
sensor[row] = time;
double[] sensor2 = (double[]) values[1];
@@ -281,22 +281,23 @@ public class SessionIT {
bytes[1] = (byte) Integer.parseInt("BE", 16);
// Method 1 to add tablet data
for (long time = 10; time < 15; time++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, time);
tablet.addValue(
- schemaList.get(0).getMeasurementId(), rowIndex, LocalDate.of(2024, 1, (int) time));
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, time);
- tablet.addValue(schemaList.get(2).getMeasurementId(), rowIndex, new Binary(bytes));
- tablet.addValue(schemaList.get(3).getMeasurementId(), rowIndex, "" + time);
+ schemaList.get(0).getMeasurementName(), rowIndex, LocalDate.of(2024, 1, (int) time));
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, time);
+ tablet.addValue(schemaList.get(2).getMeasurementName(), rowIndex, new Binary(bytes));
+ tablet.addValue(schemaList.get(3).getMeasurementName(), rowIndex, "" + time);
}
session.insertTablet(tablet);
tablet.reset();
+ tablet.bitMaps = null;
// Method 2 to add tablet data
long[] timestamps = tablet.timestamps;
Object[] values = tablet.values;
for (long time = 15; time < 20; time++) {
- int rowIndex = tablet.rowSize++;
- timestamps[rowIndex] = time;
+ int rowIndex = tablet.getRowSize();
+ tablet.addTimestamp(rowIndex, time);
((LocalDate[]) values[0])[rowIndex] = LocalDate.of(2024, 1, (int) time);
((long[]) values[1])[rowIndex] = time;
((Binary[]) values[2])[rowIndex] = new Binary(bytes);
@@ -309,7 +310,7 @@ public class SessionIT {
Assert.assertEquals(5, columnNames.size());
for (int i = 0; i < 4; i++) {
Assert.assertTrue(
- columnNames.contains(deviceId + "." + schemaList.get(i).getMeasurementId()));
+ columnNames.contains(deviceId + "." + schemaList.get(i).getMeasurementName()));
}
dataSet.setFetchSize(1024); // default is 10000
int row = 10;
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/local/IoTDBSubscriptionBasicIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/local/IoTDBSubscriptionBasicIT.java
index 72ee5c5ca70..4fed09711c2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/local/IoTDBSubscriptionBasicIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/local/IoTDBSubscriptionBasicIT.java
@@ -263,7 +263,7 @@ public class IoTDBSubscriptionBasicIT extends AbstractSubscriptionLocalIT {
message
.getSessionDataSetsHandler()
.tabletIterator()
- .forEachRemaining(tablet -> rowCount.addAndGet(tablet.rowSize));
+ .forEachRemaining(tablet -> rowCount.addAndGet(tablet.getRowSize()));
return ConsumeResult.SUCCESS;
})
.buildPushConsumer()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/IoTDBSubscriptionSharingIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/IoTDBSubscriptionSharingIT.java
index 26bdc0df2f6..a62dc8215fa 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/IoTDBSubscriptionSharingIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/IoTDBSubscriptionSharingIT.java
@@ -127,10 +127,10 @@ public class IoTDBSubscriptionSharingIT extends AbstractSubscriptionTripleIT {
final Tablet tablet = new Tablet(device, schemaList, rows);
int rowIndex;
for (int row = 0; row < rows; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, (row + 1) * 1400 + row);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (row + 1) * 100 + 0.5);
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, (row + 1) * 1400 + row);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (row + 1) * 100 + 0.5);
timestamp += 2000;
}
session.insertTablet(tablet);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBDefaultPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBDefaultPullConsumerDataSetIT.java
index 38f500d8249..960c606c80a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBDefaultPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBDefaultPullConsumerDataSetIT.java
@@ -83,7 +83,7 @@ public class IoTDBDefaultPullConsumerDataSetIT extends AbstractSubscriptionRegre
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20 + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBDefaultTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBDefaultTsfilePushConsumerIT.java
index 781670cd32c..129998b9057 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBDefaultTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBDefaultTsfilePushConsumerIT.java
@@ -100,7 +100,7 @@ public class IoTDBDefaultTsfilePushConsumerIT extends AbstractSubscriptionRegres
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20 + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBRootDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBRootDatasetPushConsumerIT.java
index c81f1d07b64..fc8acbc5c9b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBRootDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBRootDatasetPushConsumerIT.java
@@ -91,7 +91,7 @@ public class IoTDBRootDatasetPushConsumerIT extends AbstractSubscriptionRegressi
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20 + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBRootPullConsumeTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBRootPullConsumeTsfileIT.java
index 47f80575cd3..d2710bac4f5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBRootPullConsumeTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/auto_create_db/IoTDBRootPullConsumeTsfileIT.java
@@ -87,7 +87,7 @@ public class IoTDBRootPullConsumeTsfileIT extends AbstractSubscriptionRegression
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20 + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/mix/IoTDBPushConsumerPullConsumerWith1TopicShareProcessMixIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/mix/IoTDBPushConsumerPullConsumerWith1TopicShareProcessMixIT.java
index a7803485380..22e3c3469b2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/mix/IoTDBPushConsumerPullConsumerWith1TopicShareProcessMixIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/mix/IoTDBPushConsumerPullConsumerWith1TopicShareProcessMixIT.java
@@ -105,7 +105,7 @@ public class IoTDBPushConsumerPullConsumerWith1TopicShareProcessMixIT
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/param/IoTDBTestParamPullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/param/IoTDBTestParamPullConsumerIT.java
index 8aa334727e7..c1b853cec07 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/param/IoTDBTestParamPullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/param/IoTDBTestParamPullConsumerIT.java
@@ -120,7 +120,7 @@ public class IoTDBTestParamPullConsumerIT extends AbstractSubscriptionRegression
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/param/IoTDBTestParamPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/param/IoTDBTestParamPushConsumerIT.java
index 900751d2ee3..e9279a22ca4 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/param/IoTDBTestParamPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/param/IoTDBTestParamPushConsumerIT.java
@@ -120,7 +120,7 @@ public class IoTDBTestParamPushConsumerIT extends AbstractSubscriptionRegression
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/autocommit/IoTDBTestAutoCommitFalseDataSetPullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/autocommit/IoTDBTestAutoCommitFalseDataSetPullConsumerIT.java
index 4a0b889dd85..dad0e7adaf4 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/autocommit/IoTDBTestAutoCommitFalseDataSetPullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/autocommit/IoTDBTestAutoCommitFalseDataSetPullConsumerIT.java
@@ -110,7 +110,7 @@ public class IoTDBTestAutoCommitFalseDataSetPullConsumerIT
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
@@ -137,7 +137,7 @@ public class IoTDBTestAutoCommitFalseDataSetPullConsumerIT
final Tablet tablet = it.next();
session.insertTablet(tablet);
System.out.println(
- FORMAT.format(new Date()) + " consume data no commit:" + tablet.rowSize);
+ FORMAT.format(new Date()) + " consume data no commit:" + tablet.getRowSize());
}
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/autocommit/IoTDBTestAutoCommitTrueDataSetPullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/autocommit/IoTDBTestAutoCommitTrueDataSetPullConsumerIT.java
index 83b7112d795..c3b47aaa029 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/autocommit/IoTDBTestAutoCommitTrueDataSetPullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/autocommit/IoTDBTestAutoCommitTrueDataSetPullConsumerIT.java
@@ -104,7 +104,7 @@ public class IoTDBTestAutoCommitTrueDataSetPullConsumerIT extends AbstractSubscr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
@@ -131,7 +131,7 @@ public class IoTDBTestAutoCommitTrueDataSetPullConsumerIT extends AbstractSubscr
final Tablet tablet = it.next();
session.insertTablet(tablet);
System.out.println(
- FORMAT.format(new Date()) + " consume data no commit:" + tablet.rowSize);
+ FORMAT.format(new Date()) + " consume data no commit:" + tablet.getRowSize());
}
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/format/IoTDBDBDataSetPullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/format/IoTDBDBDataSetPullConsumerIT.java
index d08507e6cbd..41564ca31a0 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/format/IoTDBDBDataSetPullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/format/IoTDBDBDataSetPullConsumerIT.java
@@ -94,7 +94,7 @@ public class IoTDBDBDataSetPullConsumerIT extends AbstractSubscriptionRegression
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/format/IoTDBDBTsfilePullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/format/IoTDBDBTsfilePullConsumerIT.java
index 72de354d8ec..d0164cdba00 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/format/IoTDBDBTsfilePullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/format/IoTDBDBTsfilePullConsumerIT.java
@@ -94,7 +94,7 @@ public class IoTDBDBTsfilePullConsumerIT extends AbstractSubscriptionRegressionI
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsDatasetPullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsDatasetPullConsumerIT.java
index 28ee1a7fb56..cdee9dde7b1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsDatasetPullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsDatasetPullConsumerIT.java
@@ -115,7 +115,7 @@ public class IoTDBAllTsDatasetPullConsumerIT extends AbstractSubscriptionRegress
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsTsfilePullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsTsfilePullConsumerIT.java
index 3e5f8c5ec62..b96df7439be 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsTsfilePullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsTsfilePullConsumerIT.java
@@ -122,7 +122,7 @@ public class IoTDBAllTsTsfilePullConsumerIT extends AbstractSubscriptionRegressi
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsfilePullConsumerSnapshotIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsfilePullConsumerSnapshotIT.java
index d4f27665156..235fa31164c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsfilePullConsumerSnapshotIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBAllTsfilePullConsumerSnapshotIT.java
@@ -123,7 +123,7 @@ public class IoTDBAllTsfilePullConsumerSnapshotIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBPathDeviceDataSetPullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBPathDeviceDataSetPullConsumerIT.java
index a2df2151518..b8cda78aede 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBPathDeviceDataSetPullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBPathDeviceDataSetPullConsumerIT.java
@@ -116,7 +116,7 @@ public class IoTDBPathDeviceDataSetPullConsumerIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBPathDeviceTsfilePullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBPathDeviceTsfilePullConsumerIT.java
index 53f35f7c0d3..260f9141499 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBPathDeviceTsfilePullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBPathDeviceTsfilePullConsumerIT.java
@@ -120,7 +120,7 @@ public class IoTDBPathDeviceTsfilePullConsumerIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBTimeTsDatasetPullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBTimeTsDatasetPullConsumerIT.java
index 8fc03677430..7460e9cf47f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBTimeTsDatasetPullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBTimeTsDatasetPullConsumerIT.java
@@ -116,7 +116,7 @@ public class IoTDBTimeTsDatasetPullConsumerIT extends AbstractSubscriptionRegres
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBTimeTsTsfilePullConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBTimeTsTsfilePullConsumerIT.java
index dd9d03c3ac5..c953593f953 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBTimeTsTsfilePullConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/loose_range/IoTDBTimeTsTsfilePullConsumerIT.java
@@ -123,7 +123,7 @@ public class IoTDBTimeTsTsfilePullConsumerIT extends AbstractSubscriptionRegress
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/mode/IoTDBSnapshotDevicePullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/mode/IoTDBSnapshotDevicePullConsumerDataSetIT.java
index 90f7667556e..2aa7e5d54da 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/mode/IoTDBSnapshotDevicePullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/mode/IoTDBSnapshotDevicePullConsumerDataSetIT.java
@@ -104,7 +104,7 @@ public class IoTDBSnapshotDevicePullConsumerDataSetIT extends AbstractSubscripti
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/mode/IoTDBSnapshotDevicePullConsumerTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/mode/IoTDBSnapshotDevicePullConsumerTsfileIT.java
index a7c73c770b3..f040c5550ce 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/mode/IoTDBSnapshotDevicePullConsumerTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/mode/IoTDBSnapshotDevicePullConsumerTsfileIT.java
@@ -111,7 +111,7 @@ public class IoTDBSnapshotDevicePullConsumerTsfileIT extends AbstractSubscriptio
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBConsumer2With1TopicShareProcessDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBConsumer2With1TopicShareProcessDataSetIT.java
index 2eb292cd5ee..798101c8009 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBConsumer2With1TopicShareProcessDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBConsumer2With1TopicShareProcessDataSetIT.java
@@ -97,7 +97,7 @@ public class IoTDBConsumer2With1TopicShareProcessDataSetIT
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBConsumer2With1TopicShareProcessTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBConsumer2With1TopicShareProcessTsfileIT.java
index 11f36939f8f..f072f05f1fc 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBConsumer2With1TopicShareProcessTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBConsumer2With1TopicShareProcessTsfileIT.java
@@ -105,7 +105,7 @@ public class IoTDBConsumer2With1TopicShareProcessTsfileIT extends AbstractSubscr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBMultiGroupVsMultiConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBMultiGroupVsMultiConsumerIT.java
index d5c8c629171..7a4e82bcb1c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBMultiGroupVsMultiConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBMultiGroupVsMultiConsumerIT.java
@@ -93,11 +93,11 @@ public class IoTDBMultiGroupVsMultiConsumerIT extends AbstractSubscriptionRegres
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int i = 0; i < tsCount; i++) {
tablet.addValue(
- schemaList.get(i).getMeasurementId(), rowIndex, (row + 1) * 20 + i * 1000 + row);
+ schemaList.get(i).getMeasurementName(), rowIndex, (row + 1) * 20 + i * 1000 + row);
}
timestamp += 2000;
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsDatasetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsDatasetIT.java
index 3f5d9ee0d73..958250e7b11 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsDatasetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsDatasetIT.java
@@ -99,7 +99,7 @@ public class IoTDBOneConsumerMultiTopicsDatasetIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsMixIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsMixIT.java
index 1c47e5bc172..1a1a9fb808d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsMixIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsMixIT.java
@@ -107,7 +107,7 @@ public class IoTDBOneConsumerMultiTopicsMixIT extends AbstractSubscriptionRegres
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row + 2.45f);
tablet.addValue("s_1", rowIndex, "rowIndex" + rowIndex);
@@ -231,7 +231,8 @@ public class IoTDBOneConsumerMultiTopicsMixIT extends AbstractSubscriptionRegres
final Tablet tablet = it.next();
try {
session_dest.insertTablet(tablet);
- System.out.println(FORMAT.format(new Date()) + " " + tablet.rowSize);
+ System.out.println(
+ FORMAT.format(new Date()) + " " + tablet.getRowSize());
} catch (StatementExecutionException e) {
throw new RuntimeException(e);
} catch (IoTDBConnectionException e) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsTsfileIT.java
index 8bda5795c97..6b1ba52c3f7 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/multi/IoTDBOneConsumerMultiTopicsTsfileIT.java
@@ -102,7 +102,7 @@ public class IoTDBOneConsumerMultiTopicsTsfileIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row + 2.45f);
tablet.addValue("s_1", rowIndex, "rowIndex" + rowIndex);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDBPatternPullConsumeTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDBPatternPullConsumeTsfileIT.java
index afc7880fdf4..72a05d27618 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDBPatternPullConsumeTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDBPatternPullConsumeTsfileIT.java
@@ -115,7 +115,7 @@ public class IoTDBDBPatternPullConsumeTsfileIT extends AbstractSubscriptionRegre
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDBPatternPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDBPatternPullConsumerDataSetIT.java
index e4dc6ecfd99..6d6f9feada3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDBPatternPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDBPatternPullConsumerDataSetIT.java
@@ -106,7 +106,7 @@ public class IoTDBDBPatternPullConsumerDataSetIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDefaultPatternPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDefaultPatternPullConsumerDataSetIT.java
index 8ca5ca9f451..4a00143b8bb 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDefaultPatternPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDefaultPatternPullConsumerDataSetIT.java
@@ -101,7 +101,7 @@ public class IoTDBDefaultPatternPullConsumerDataSetIT extends AbstractSubscripti
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDevicePatternPullConsumeTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDevicePatternPullConsumeTsfileIT.java
index e1ff8606f04..7e67c0bcbd9 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDevicePatternPullConsumeTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDevicePatternPullConsumeTsfileIT.java
@@ -113,7 +113,7 @@ public class IoTDBDevicePatternPullConsumeTsfileIT extends AbstractSubscriptionR
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDevicePatternPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDevicePatternPullConsumerDataSetIT.java
index 855be595bfa..affd3438a60 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDevicePatternPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBDevicePatternPullConsumerDataSetIT.java
@@ -108,7 +108,7 @@ public class IoTDBDevicePatternPullConsumerDataSetIT extends AbstractSubscriptio
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatch2PatternPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatch2PatternPullConsumerDataSetIT.java
index 4c00ccd19f0..7a6c83340b8 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatch2PatternPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatch2PatternPullConsumerDataSetIT.java
@@ -111,7 +111,7 @@ public class IoTDBMiddleMatch2PatternPullConsumerDataSetIT
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatchPatternPullConsumeTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatchPatternPullConsumeTsfileIT.java
index 6351641276f..db265b6506a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatchPatternPullConsumeTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatchPatternPullConsumeTsfileIT.java
@@ -111,7 +111,7 @@ public class IoTDBMiddleMatchPatternPullConsumeTsfileIT extends AbstractSubscrip
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatchPatternPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatchPatternPullConsumerDataSetIT.java
index f4f1c5dd84f..54717295e86 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatchPatternPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBMiddleMatchPatternPullConsumerDataSetIT.java
@@ -104,7 +104,7 @@ public class IoTDBMiddleMatchPatternPullConsumerDataSetIT extends AbstractSubscr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBRootPatternPullConsumeTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBRootPatternPullConsumeTsfileIT.java
index 8bb4ce28f35..398a6b61490 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBRootPatternPullConsumeTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBRootPatternPullConsumeTsfileIT.java
@@ -96,7 +96,7 @@ public class IoTDBRootPatternPullConsumeTsfileIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBTSPatternPullConsumeTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBTSPatternPullConsumeTsfileIT.java
index 99e05feed33..5a64a2c42d3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBTSPatternPullConsumeTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBTSPatternPullConsumeTsfileIT.java
@@ -114,7 +114,7 @@ public class IoTDBTSPatternPullConsumeTsfileIT extends AbstractSubscriptionRegre
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBTSPatternPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBTSPatternPullConsumerDataSetIT.java
index 4cd80a64fb4..9234daae6c2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBTSPatternPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/pattern/IoTDBTSPatternPullConsumerDataSetIT.java
@@ -88,7 +88,7 @@ public class IoTDBTSPatternPullConsumerDataSetIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBAllPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBAllPullConsumerDataSetIT.java
index 66c08d5ad3f..50785e524ae 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBAllPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBAllPullConsumerDataSetIT.java
@@ -88,7 +88,7 @@ public class IoTDBAllPullConsumerDataSetIT extends AbstractSubscriptionRegressio
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBHistoryPullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBHistoryPullConsumerDataSetIT.java
index 6b4df321611..a2bd30a027f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBHistoryPullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBHistoryPullConsumerDataSetIT.java
@@ -92,7 +92,7 @@ public class IoTDBHistoryPullConsumerDataSetIT extends AbstractSubscriptionRegre
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBRealTimePullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBRealTimePullConsumerDataSetIT.java
index 3a419f68402..eefb1c08aad 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBRealTimePullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBRealTimePullConsumerDataSetIT.java
@@ -92,7 +92,7 @@ public class IoTDBRealTimePullConsumerDataSetIT extends AbstractSubscriptionRegr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBTimeRangeAccuratePullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBTimeRangeAccuratePullConsumerDataSetIT.java
index 4ced5edb360..d2ce0ca4968 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBTimeRangeAccuratePullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBTimeRangeAccuratePullConsumerDataSetIT.java
@@ -88,7 +88,7 @@ public class IoTDBTimeRangeAccuratePullConsumerDataSetIT extends AbstractSubscri
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBTimeRangePullConsumerDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBTimeRangePullConsumerDataSetIT.java
index 91bc8bc1c39..bf9abb28775 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBTimeRangePullConsumerDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pullconsumer/time/IoTDBTimeRangePullConsumerDataSetIT.java
@@ -91,7 +91,7 @@ public class IoTDBTimeRangePullConsumerDataSetIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeDataSetIT.java
index d894f233478..d56cb5c369d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeDataSetIT.java
@@ -98,7 +98,7 @@ public class IoTDBTestPushConsumeDataSetIT extends AbstractSubscriptionRegressio
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeNoTargetDirTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeNoTargetDirTsfileIT.java
index 02d81eec70a..d2b3624afdb 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeNoTargetDirTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeNoTargetDirTsfileIT.java
@@ -104,7 +104,7 @@ public class IoTDBTestPushConsumeNoTargetDirTsfileIT extends AbstractSubscriptio
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeTsfileIT.java
index 03078a0b915..e7d1cfb301e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/format/IoTDBTestPushConsumeTsfileIT.java
@@ -101,7 +101,7 @@ public class IoTDBTestPushConsumeTsfileIT extends AbstractSubscriptionRegression
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsDatasetPushConsumerIT.java
index 234d4eb7b39..c10be83817b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsDatasetPushConsumerIT.java
@@ -126,7 +126,7 @@ public class IoTDBLooseAllTsDatasetPushConsumerIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsDatasetPushConsumerSnapshotIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsDatasetPushConsumerSnapshotIT.java
index e04721d4252..ecc63dca493 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsDatasetPushConsumerSnapshotIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsDatasetPushConsumerSnapshotIT.java
@@ -126,7 +126,7 @@ public class IoTDBLooseAllTsDatasetPushConsumerSnapshotIT extends AbstractSubscr
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsfilePushConsumerIT.java
index 33d7d7e69d2..87a15621f0c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBLooseAllTsfilePushConsumerIT.java
@@ -124,7 +124,7 @@ public class IoTDBLooseAllTsfilePushConsumerIT extends AbstractSubscriptionRegre
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseDeviceTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseDeviceTsfilePushConsumerIT.java
index cf0adf9529a..0b54e3eda1b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseDeviceTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseDeviceTsfilePushConsumerIT.java
@@ -124,7 +124,7 @@ public class IoTDBPathLooseDeviceTsfilePushConsumerIT extends AbstractSubscripti
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseTsDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseTsDatasetPushConsumerIT.java
index e45f6c6739a..9139574b459 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseTsDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseTsDatasetPushConsumerIT.java
@@ -127,7 +127,7 @@ public class IoTDBPathLooseTsDatasetPushConsumerIT extends AbstractSubscriptionR
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseTsfilePushConsumerIT.java
index 01a2eb54f3f..170bc94cb02 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathLooseTsfilePushConsumerIT.java
@@ -121,7 +121,7 @@ public class IoTDBPathLooseTsfilePushConsumerIT extends AbstractSubscriptionRegr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathTsLooseDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathTsLooseDatasetPushConsumerIT.java
index 2fc68d341c1..ef378d21b0e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathTsLooseDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBPathTsLooseDatasetPushConsumerIT.java
@@ -125,7 +125,7 @@ public class IoTDBPathTsLooseDatasetPushConsumerIT extends AbstractSubscriptionR
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsDatasetPushConsumerIT.java
index d166a44d7bb..48de39df2cc 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsDatasetPushConsumerIT.java
@@ -128,7 +128,7 @@ public class IoTDBTimeLooseTsDatasetPushConsumerIT extends AbstractSubscriptionR
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsTsfilePushConsumerIT.java
index a4636be1e5b..d4e5183379b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsTsfilePushConsumerIT.java
@@ -124,7 +124,7 @@ public class IoTDBTimeLooseTsTsfilePushConsumerIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsfilePushConsumerIT.java
index 079e9c4c4b4..2216280c2c8 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeLooseTsfilePushConsumerIT.java
@@ -117,7 +117,7 @@ public class IoTDBTimeLooseTsfilePushConsumerIT extends AbstractSubscriptionRegr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeTsLooseDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeTsLooseDatasetPushConsumerIT.java
index 9e7d4a4ef50..c2a211bceb5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeTsLooseDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/loose_range/IoTDBTimeTsLooseDatasetPushConsumerIT.java
@@ -128,7 +128,7 @@ public class IoTDBTimeTsLooseDatasetPushConsumerIT extends AbstractSubscriptionR
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (row + 1) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/mode/IoTDBSnapshotTSPatternDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/mode/IoTDBSnapshotTSPatternDatasetPushConsumerIT.java
index aff66f98ec8..2eb48720759 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/mode/IoTDBSnapshotTSPatternDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/mode/IoTDBSnapshotTSPatternDatasetPushConsumerIT.java
@@ -117,7 +117,7 @@ public class IoTDBSnapshotTSPatternDatasetPushConsumerIT extends AbstractSubscri
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/mode/IoTDBSnapshotTSPatternTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/mode/IoTDBSnapshotTSPatternTsfilePushConsumerIT.java
index 376786ede91..7ba7f043f9a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/mode/IoTDBSnapshotTSPatternTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/mode/IoTDBSnapshotTSPatternTsfilePushConsumerIT.java
@@ -131,7 +131,7 @@ public class IoTDBSnapshotTSPatternTsfilePushConsumerIT extends AbstractSubscrip
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBConsumer2With1TopicShareProcessDataSetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBConsumer2With1TopicShareProcessDataSetIT.java
index 0e9ccaab0ad..958da8d6df9 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBConsumer2With1TopicShareProcessDataSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBConsumer2With1TopicShareProcessDataSetIT.java
@@ -109,7 +109,7 @@ public class IoTDBConsumer2With1TopicShareProcessDataSetIT
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBConsumer2With1TopicShareProcessTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBConsumer2With1TopicShareProcessTsfileIT.java
index acdc78285dc..1b3273d7c80 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBConsumer2With1TopicShareProcessTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBConsumer2With1TopicShareProcessTsfileIT.java
@@ -104,7 +104,7 @@ public class IoTDBConsumer2With1TopicShareProcessTsfileIT extends AbstractSubscr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBMultiGroupVsMultiConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBMultiGroupVsMultiConsumerIT.java
index 6015e127774..35a5a71e08e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBMultiGroupVsMultiConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBMultiGroupVsMultiConsumerIT.java
@@ -160,10 +160,10 @@ public class IoTDBMultiGroupVsMultiConsumerIT extends AbstractSubscriptionRegres
Tablet tablet = new Tablet(device, schemaList, rows);
int rowIndex = 0;
for (int row = 0; row < rows; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, (row + 1) * 1400 + row);
- tablet.addValue(schemaList.get(1).getMeasurementId(), rowIndex, (row + 1) * 100 + 0.5);
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, (row + 1) * 1400 + row);
+ tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, (row + 1) * 100 + 0.5);
timestamp += 2000;
}
session_src.insertTablet(tablet);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsDatasetIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsDatasetIT.java
index 2936b7e4bd0..51a59693557 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsDatasetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsDatasetIT.java
@@ -118,7 +118,7 @@ public class IoTDBOneConsumerMultiTopicsDatasetIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsMixIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsMixIT.java
index af3b80ca111..634c38931e5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsMixIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsMixIT.java
@@ -118,7 +118,7 @@ public class IoTDBOneConsumerMultiTopicsMixIT extends AbstractSubscriptionRegres
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row + 2.45f);
tablet.addValue("s_1", rowIndex, "rowIndex" + rowIndex);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsTsfileIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsTsfileIT.java
index 9278626c663..43d81c603ae 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsTsfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/multi/IoTDBOneConsumerMultiTopicsTsfileIT.java
@@ -112,7 +112,7 @@ public class IoTDBOneConsumerMultiTopicsTsfileIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row + 2.45f);
tablet.addValue("s_1", rowIndex, "rowIndex" + rowIndex);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDBPatternDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDBPatternDatasetPushConsumerIT.java
index 817aaeb81cf..628d9f8adf3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDBPatternDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDBPatternDatasetPushConsumerIT.java
@@ -117,7 +117,7 @@ public class IoTDBDBPatternDatasetPushConsumerIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDBPatternTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDBPatternTsfilePushConsumerIT.java
index 1b30926df27..d51c4534c7e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDBPatternTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDBPatternTsfilePushConsumerIT.java
@@ -122,7 +122,7 @@ public class IoTDBDBPatternTsfilePushConsumerIT extends AbstractSubscriptionRegr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDefaultPatternTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDefaultPatternTsfilePushConsumerIT.java
index f16330c8591..a315e328927 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDefaultPatternTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDefaultPatternTsfilePushConsumerIT.java
@@ -121,7 +121,7 @@ public class IoTDBDefaultPatternTsfilePushConsumerIT extends AbstractSubscriptio
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDevicePatternDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDevicePatternDatasetPushConsumerIT.java
index 043095b29d5..42e5681b841 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDevicePatternDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDevicePatternDatasetPushConsumerIT.java
@@ -117,7 +117,7 @@ public class IoTDBDevicePatternDatasetPushConsumerIT extends AbstractSubscriptio
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDevicePatternTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDevicePatternTsfilePushConsumerIT.java
index 272afe151f3..e3c83673b74 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDevicePatternTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBDevicePatternTsfilePushConsumerIT.java
@@ -123,7 +123,7 @@ public class IoTDBDevicePatternTsfilePushConsumerIT extends AbstractSubscription
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, (1 + row) * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBRootPatternDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBRootPatternDatasetPushConsumerIT.java
index ff41d082106..056c775e7e9 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBRootPatternDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBRootPatternDatasetPushConsumerIT.java
@@ -117,7 +117,7 @@ public class IoTDBRootPatternDatasetPushConsumerIT extends AbstractSubscriptionR
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBTSPatternDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBTSPatternDatasetPushConsumerIT.java
index bd32b688fa3..50a074bed2c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBTSPatternDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBTSPatternDatasetPushConsumerIT.java
@@ -116,7 +116,7 @@ public class IoTDBTSPatternDatasetPushConsumerIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBTSPatternTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBTSPatternTsfilePushConsumerIT.java
index af783e787f1..3447b71dc2c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBTSPatternTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/pattern/IoTDBTSPatternTsfilePushConsumerIT.java
@@ -122,7 +122,7 @@ public class IoTDBTSPatternTsfilePushConsumerIT extends AbstractSubscriptionRegr
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBHistoryRootDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBHistoryRootDatasetPushConsumerIT.java
index 47ede5799e5..63c099b017c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBHistoryRootDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBHistoryRootDatasetPushConsumerIT.java
@@ -100,7 +100,7 @@ public class IoTDBHistoryRootDatasetPushConsumerIT extends AbstractSubscriptionR
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBHistoryRootTsFilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBHistoryRootTsFilePushConsumerIT.java
index d56c9cdded3..a8b9490d9fb 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBHistoryRootTsFilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBHistoryRootTsFilePushConsumerIT.java
@@ -105,7 +105,7 @@ public class IoTDBHistoryRootTsFilePushConsumerIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBRealTimeDBDatasetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBRealTimeDBDatasetPushConsumerIT.java
index ec4ad033733..5d0defa38a6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBRealTimeDBDatasetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBRealTimeDBDatasetPushConsumerIT.java
@@ -95,7 +95,7 @@ public class IoTDBRealTimeDBDatasetPushConsumerIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBRealTimeDBTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBRealTimeDBTsfilePushConsumerIT.java
index 5f9d1aa88e1..2ccdb524117 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBRealTimeDBTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBRealTimeDBTsfilePushConsumerIT.java
@@ -100,7 +100,7 @@ public class IoTDBRealTimeDBTsfilePushConsumerIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeAccurateDBDataSetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeAccurateDBDataSetPushConsumerIT.java
index d7aea65ae18..49ce55b2dd3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeAccurateDBDataSetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeAccurateDBDataSetPushConsumerIT.java
@@ -97,7 +97,7 @@ public class IoTDBTimeRangeAccurateDBDataSetPushConsumerIT
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeDBDataSetPushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeDBDataSetPushConsumerIT.java
index 4c9f26c3892..c7102784859 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeDBDataSetPushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeDBDataSetPushConsumerIT.java
@@ -99,7 +99,7 @@ public class IoTDBTimeRangeDBDataSetPushConsumerIT extends AbstractSubscriptionR
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeDBTsfilePushConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeDBTsfilePushConsumerIT.java
index 5056ca8d2b2..8b2497b254b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeDBTsfilePushConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/pushconsumer/time/IoTDBTimeRangeDBTsfilePushConsumerIT.java
@@ -104,7 +104,7 @@ public class IoTDBTimeRangeDBTsfilePushConsumerIT extends AbstractSubscriptionRe
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/topic/IoTDBDataSet1TopicConsumerSpecialIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/topic/IoTDBDataSet1TopicConsumerSpecialIT.java
index 5526b40835f..86ea1916540 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/topic/IoTDBDataSet1TopicConsumerSpecialIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/topic/IoTDBDataSet1TopicConsumerSpecialIT.java
@@ -90,7 +90,7 @@ public class IoTDBDataSet1TopicConsumerSpecialIT extends AbstractSubscriptionReg
Tablet tablet = new Tablet(device, schemaList, 10);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("`ABH#01`", rowIndex, row * 20 + row);
tablet.addValue("`BJ-ABH#01`", rowIndex, true);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/topic/IoTDBTestTopicNameIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/topic/IoTDBTestTopicNameIT.java
index bf57794a6c3..5911bddd618 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/topic/IoTDBTestTopicNameIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/topic/IoTDBTestTopicNameIT.java
@@ -93,7 +93,7 @@ public class IoTDBTestTopicNameIT extends AbstractSubscriptionRegressionIT {
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/user/IoTDBOtherUserConsumerIT.java b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/user/IoTDBOtherUserConsumerIT.java
index 220bff22e22..fb388bb0cd7 100644
--- a/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/user/IoTDBOtherUserConsumerIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/regression/user/IoTDBOtherUserConsumerIT.java
@@ -95,7 +95,7 @@ public class IoTDBOtherUserConsumerIT extends AbstractSubscriptionRegressionIT {
Tablet tablet = new Tablet(device, schemaList, 5);
int rowIndex = 0;
for (int row = 0; row < 5; row++) {
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue("s_0", rowIndex, row * 20L + row);
tablet.addValue("s_1", rowIndex, row + 2.45);
diff --git a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/tsfile/ExportTsFile.java b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/tsfile/ExportTsFile.java
index 0a6586863b1..6ca2c51f318 100644
--- a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/tsfile/ExportTsFile.java
+++ b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/tsfile/ExportTsFile.java
@@ -341,10 +341,9 @@ public class ExportTsFile extends AbstractTsFileTool {
new MeasurementSchema(path.getMeasurement(), tsDataType);
List<Field> seriesList =
session.executeQueryStatement("show timeseries " + column, timeout).next().getFields();
- measurementSchema.setEncoding(
- TSEncoding.valueOf(seriesList.get(4).getStringValue()).serialize());
- measurementSchema.setCompressor(
- CompressionType.valueOf(seriesList.get(5).getStringValue()).serialize());
+ measurementSchema.setEncoding(TSEncoding.valueOf(seriesList.get(4).getStringValue()));
+ measurementSchema.setCompressionType(
+ CompressionType.valueOf(seriesList.get(5).getStringValue()));
deviceSchemaMap.computeIfAbsent(deviceId, key -> new ArrayList<>()).add(measurementSchema);
deviceColumnIndices.computeIfAbsent(deviceId, key -> new ArrayList<>()).add(i);
@@ -390,7 +389,7 @@ public class ExportTsFile extends AbstractTsFileTool {
for (Tablet tablet : tabletList) {
String deviceId = tablet.getDeviceId();
List<Integer> columnIndices = deviceColumnIndices.get(deviceId);
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, rowRecord.getTimestamp());
List<IMeasurementSchema> schemas = tablet.getSchemas();
@@ -402,10 +401,10 @@ public class ExportTsFile extends AbstractTsFileTool {
if (value == null) {
tablet.bitMaps[i].mark(rowIndex);
}
- tablet.addValue(measurementSchema.getMeasurementId(), rowIndex, value);
+ tablet.addValue(measurementSchema.getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
writeToTsFile(alignedDevices, tsFileWriter, tablet);
tablet.initBitMaps();
tablet.reset();
@@ -414,7 +413,7 @@ public class ExportTsFile extends AbstractTsFileTool {
}
for (Tablet tablet : tabletList) {
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
writeToTsFile(alignedDevices, tsFileWriter, tablet);
}
}
@@ -455,7 +454,7 @@ public class ExportTsFile extends AbstractTsFileTool {
writeWithTablets(
sessionDataSet, tabletList, alignedDevices, tsFileWriter, deviceColumnIndices);
- tsFileWriter.flushAllChunkGroups();
+ tsFileWriter.flush();
}
}
@@ -465,7 +464,7 @@ public class ExportTsFile extends AbstractTsFileTool {
if (deviceFilterSet.contains(tablet.getDeviceId())) {
tsFileWriter.writeAligned(tablet);
} else {
- tsFileWriter.write(tablet);
+ tsFileWriter.writeTree(tablet);
}
}
diff --git a/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java b/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java
index c891fb10259..63eb0b77701 100644
--- a/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java
+++ b/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java
@@ -2751,7 +2751,7 @@ public class Session implements ISession {
if (tableModelDeviceIdToEndpoint.isEmpty()) {
relationalTabletGroup.put(defaultSessionConnection, tablet);
} else {
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
IDeviceID iDeviceID = tablet.getDeviceID(i);
final SessionConnection connection = getSessionConnection(iDeviceID);
int finalI = i;
@@ -2759,21 +2759,30 @@ public class Session implements ISession {
connection,
(k, v) -> {
if (v == null) {
+ List<String> measurements = new ArrayList<>(tablet.getSchemas().size());
+ List<TSDataType> dataTypes = new ArrayList<>();
+ tablet
+ .getSchemas()
+ .forEach(
+ schema -> {
+ measurements.add(schema.getMeasurementName());
+ dataTypes.add(schema.getType());
+ });
v =
new Tablet(
tablet.getTableName(),
- tablet.getSchemas(),
+ measurements,
+ dataTypes,
tablet.getColumnTypes(),
- tablet.rowSize);
+ tablet.getRowSize());
}
for (int j = 0; j < v.getSchemas().size(); j++) {
v.addValue(
- v.getSchemas().get(j).getMeasurementId(),
- v.rowSize,
+ v.getSchemas().get(j).getMeasurementName(),
+ v.getRowSize(),
tablet.getValue(finalI, j));
}
- v.addTimestamp(v.rowSize, tablet.timestamps[finalI]);
- v.rowSize++;
+ v.addTimestamp(v.getRowSize(), tablet.timestamps[finalI]);
return v;
});
}
@@ -2946,7 +2955,7 @@ public class Session implements ISession {
TSInsertTabletReq request = new TSInsertTabletReq();
for (IMeasurementSchema measurementSchema : tablet.getSchemas()) {
- request.addToMeasurements(measurementSchema.getMeasurementId());
+ request.addToMeasurements(measurementSchema.getMeasurementName());
request.addToTypes(measurementSchema.getType().ordinal());
}
@@ -2954,7 +2963,7 @@ public class Session implements ISession {
request.setIsAligned(isAligned);
request.setTimestamps(SessionUtils.getTimeBuffer(tablet));
request.setValues(SessionUtils.getValueBuffer(tablet));
- request.setSize(tablet.rowSize);
+ request.setSize(tablet.getRowSize());
return request;
}
@@ -3070,14 +3079,14 @@ public class Session implements ISession {
List<Integer> dataTypes = new ArrayList<>();
request.setIsAligned(isAligned);
for (IMeasurementSchema measurementSchema : tablet.getSchemas()) {
- measurements.add(measurementSchema.getMeasurementId());
+ measurements.add(measurementSchema.getMeasurementName());
dataTypes.add(measurementSchema.getType().ordinal());
}
request.addToMeasurementsList(measurements);
request.addToTypesList(dataTypes);
request.addToTimestampsList(SessionUtils.getTimeBuffer(tablet));
request.addToValuesList(SessionUtils.getValueBuffer(tablet));
- request.addToSizeList(tablet.rowSize);
+ request.addToSizeList(tablet.getRowSize());
}
// sample some records and judge weather need to add too many null values to convert to tablet.
@@ -3253,7 +3262,7 @@ public class Session implements ISession {
List<String> measurements,
List<Object> values,
Map<String, Pair<TSDataType, Boolean>> allMeasurementMap) {
- int row = tablet.rowSize++;
+ int row = tablet.getRowSize();
tablet.addTimestamp(row, timestamp);
// tablet without null value
if (measurements.size() == allMeasurementMap.size()) {
@@ -3483,7 +3492,7 @@ public class Session implements ISession {
* @return whether the batch has been sorted
*/
private boolean checkSorted(Tablet tablet) {
- for (int i = 1; i < tablet.rowSize; i++) {
+ for (int i = 1; i < tablet.getRowSize(); i++) {
if (tablet.timestamps[i] < tablet.timestamps[i - 1]) {
return false;
}
@@ -3509,12 +3518,12 @@ public class Session implements ISession {
* so we can insert continuous data in value list to get a better performance
*/
// sort to get index, and use index to sort value list
- Integer[] index = new Integer[tablet.rowSize];
- for (int i = 0; i < tablet.rowSize; i++) {
+ Integer[] index = new Integer[tablet.getRowSize()];
+ for (int i = 0; i < tablet.getRowSize(); i++) {
index[i] = i;
}
Arrays.sort(index, Comparator.comparingLong(o -> tablet.timestamps[o]));
- Arrays.sort(tablet.timestamps, 0, tablet.rowSize);
+ Arrays.sort(tablet.timestamps, 0, tablet.getRowSize());
int columnIndex = 0;
for (int i = 0; i < tablet.getSchemas().size(); i++) {
IMeasurementSchema schema = tablet.getSchemas().get(i);
diff --git a/iotdb-client/session/src/main/java/org/apache/iotdb/session/subscription/payload/SubscriptionSessionDataSet.java b/iotdb-client/session/src/main/java/org/apache/iotdb/session/subscription/payload/SubscriptionSessionDataSet.java
index ee2beafdd96..3e2c4e01f42 100644
--- a/iotdb-client/session/src/main/java/org/apache/iotdb/session/subscription/payload/SubscriptionSessionDataSet.java
+++ b/iotdb-client/session/src/main/java/org/apache/iotdb/session/subscription/payload/SubscriptionSessionDataSet.java
@@ -70,7 +70,7 @@ public class SubscriptionSessionDataSet implements ISessionDataSet {
List<IMeasurementSchema> schemas = tablet.getSchemas();
columnNameList.addAll(
schemas.stream()
- .map((schema) -> deviceId + "." + schema.getMeasurementId())
+ .map((schema) -> deviceId + "." + schema.getMeasurementName())
.collect(Collectors.toList()));
return columnNameList;
}
@@ -105,7 +105,9 @@ public class SubscriptionSessionDataSet implements ISessionDataSet {
for (int columnIndex = 0; columnIndex < columnSize; ++columnIndex) {
final Field field;
- if (tablet.bitMaps[columnIndex].isMarked(rowIndex)) {
+ if (tablet.bitMaps != null
+ && tablet.bitMaps[columnIndex] != null
+ && tablet.bitMaps[columnIndex].isMarked(rowIndex)) {
field = new Field(null);
} else {
final TSDataType dataType = tablet.getSchemas().get(columnIndex).getType();
diff --git a/iotdb-client/session/src/main/java/org/apache/iotdb/session/util/SessionUtils.java b/iotdb-client/session/src/main/java/org/apache/iotdb/session/util/SessionUtils.java
index c4256e50d63..5febc232f07 100644
--- a/iotdb-client/session/src/main/java/org/apache/iotdb/session/util/SessionUtils.java
+++ b/iotdb-client/session/src/main/java/org/apache/iotdb/session/util/SessionUtils.java
@@ -48,7 +48,7 @@ public class SessionUtils {
public static ByteBuffer getTimeBuffer(Tablet tablet) {
ByteBuffer timeBuffer = ByteBuffer.allocate(getTimeBytesSize(tablet));
- for (int i = 0; i < tablet.rowSize; i++) {
+ for (int i = 0; i < tablet.getRowSize(); i++) {
timeBuffer.putLong(tablet.timestamps[i]);
}
timeBuffer.flip();
@@ -64,13 +64,10 @@ public class SessionUtils {
}
if (tablet.bitMaps != null) {
for (BitMap bitMap : tablet.bitMaps) {
- boolean columnHasNull = bitMap != null && !bitMap.isAllUnmarked();
+ boolean columnHasNull = bitMap != null && !bitMap.isAllUnmarked(tablet.getRowSize());
valueBuffer.put(BytesUtils.boolToByte(columnHasNull));
if (columnHasNull) {
- byte[] bytes = bitMap.getByteArray();
- for (int j = 0; j < tablet.rowSize / Byte.SIZE + 1; j++) {
- valueBuffer.put(bytes[j]);
- }
+ valueBuffer.put(bitMap.getTruncatedByteArray(tablet.getRowSize()));
}
}
}
@@ -79,7 +76,7 @@ public class SessionUtils {
}
private static int getTimeBytesSize(Tablet tablet) {
- return tablet.rowSize * 8;
+ return tablet.getRowSize() * 8;
}
/**
@@ -89,7 +86,7 @@ public class SessionUtils {
int valueOccupation = 0;
int columnIndex = 0;
List<IMeasurementSchema> schemas = tablet.getSchemas();
- int rowSize = tablet.rowSize;
+ int rowSize = tablet.getRowSize();
for (IMeasurementSchema schema : schemas) {
valueOccupation +=
calOccupationOfOneColumn(schema.getType(), tablet.values, columnIndex, rowSize);
@@ -268,7 +265,7 @@ public class SessionUtils {
switch (dataType) {
case INT32:
int[] intValues = (int[]) tablet.values[i];
- for (int index = 0; index < tablet.rowSize; index++) {
+ for (int index = 0; index < tablet.getRowSize(); index++) {
if (!tablet.isNull(index, i)) {
valueBuffer.putInt(intValues[index]);
} else {
@@ -279,7 +276,7 @@ public class SessionUtils {
case INT64:
case TIMESTAMP:
long[] longValues = (long[]) tablet.values[i];
- for (int index = 0; index < tablet.rowSize; index++) {
+ for (int index = 0; index < tablet.getRowSize(); index++) {
if (!tablet.isNull(index, i)) {
valueBuffer.putLong(longValues[index]);
} else {
@@ -289,7 +286,7 @@ public class SessionUtils {
break;
case FLOAT:
float[] floatValues = (float[]) tablet.values[i];
- for (int index = 0; index < tablet.rowSize; index++) {
+ for (int index = 0; index < tablet.getRowSize(); index++) {
if (!tablet.isNull(index, i)) {
valueBuffer.putFloat(floatValues[index]);
} else {
@@ -299,7 +296,7 @@ public class SessionUtils {
break;
case DOUBLE:
double[] doubleValues = (double[]) tablet.values[i];
- for (int index = 0; index < tablet.rowSize; index++) {
+ for (int index = 0; index < tablet.getRowSize(); index++) {
if (!tablet.isNull(index, i)) {
valueBuffer.putDouble(doubleValues[index]);
} else {
@@ -309,7 +306,7 @@ public class SessionUtils {
break;
case BOOLEAN:
boolean[] boolValues = (boolean[]) tablet.values[i];
- for (int index = 0; index < tablet.rowSize; index++) {
+ for (int index = 0; index < tablet.getRowSize(); index++) {
if (!tablet.isNull(index, i)) {
valueBuffer.put(BytesUtils.boolToByte(boolValues[index]));
} else {
@@ -321,7 +318,7 @@ public class SessionUtils {
case STRING:
case BLOB:
Binary[] binaryValues = (Binary[]) tablet.values[i];
- for (int index = 0; index < tablet.rowSize; index++) {
+ for (int index = 0; index < tablet.getRowSize(); index++) {
if (!tablet.isNull(index, i) && binaryValues[index] != null) {
valueBuffer.putInt(binaryValues[index].getLength());
valueBuffer.put(binaryValues[index].getValues());
@@ -333,7 +330,7 @@ public class SessionUtils {
break;
case DATE:
LocalDate[] dateValues = (LocalDate[]) tablet.values[i];
- for (int index = 0; index < tablet.rowSize; index++) {
+ for (int index = 0; index < tablet.getRowSize(); index++) {
if (!tablet.isNull(index, i) && dateValues[index] != null) {
valueBuffer.putInt(DateUtils.parseDateExpressionToInt(dateValues[index]));
} else {
diff --git a/iotdb-client/session/src/test/java/org/apache/iotdb/session/SessionCacheLeaderTest.java b/iotdb-client/session/src/test/java/org/apache/iotdb/session/SessionCacheLeaderTest.java
index c56397a6323..e1af26845fe 100644
--- a/iotdb-client/session/src/test/java/org/apache/iotdb/session/SessionCacheLeaderTest.java
+++ b/iotdb-client/session/src/test/java/org/apache/iotdb/session/SessionCacheLeaderTest.java
@@ -36,7 +36,7 @@ import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.file.metadata.IDeviceID;
import org.apache.tsfile.file.metadata.StringArrayDeviceID;
import org.apache.tsfile.write.record.Tablet;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.junit.Assert;
@@ -462,21 +462,21 @@ public class SessionCacheLeaderTest {
Tablet tablet = new Tablet(deviceId, schemaList, 100);
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
long value = new Random().nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -492,21 +492,21 @@ public class SessionCacheLeaderTest {
assertEquals(1, session.endPointToSessionConnection.size());
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
long value = new Random().nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertTablet(tablet, true);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertTablet(tablet);
tablet.reset();
}
@@ -549,19 +549,19 @@ public class SessionCacheLeaderTest {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
tablet1.addTimestamp(row1, timestamp);
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 3; i++) {
long value = new Random().nextLong();
- tablet1.addValue(schemaList.get(i).getMeasurementId(), row1, value);
- tablet2.addValue(schemaList.get(i).getMeasurementId(), row2, value);
- tablet3.addValue(schemaList.get(i).getMeasurementId(), row3, value);
+ tablet1.addValue(schemaList.get(i).getMeasurementName(), row1, value);
+ tablet2.addValue(schemaList.get(i).getMeasurementName(), row2, value);
+ tablet3.addValue(schemaList.get(i).getMeasurementName(), row3, value);
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
session.insertTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -570,7 +570,7 @@ public class SessionCacheLeaderTest {
timestamp++;
}
- if (tablet1.rowSize != 0) {
+ if (tablet1.getRowSize() != 0) {
session.insertTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -588,19 +588,19 @@ public class SessionCacheLeaderTest {
assertEquals(1, session.endPointToSessionConnection.size());
for (long row = 0; row < 100; row++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
tablet1.addTimestamp(row1, timestamp);
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 3; i++) {
long value = new Random().nextLong();
- tablet1.addValue(schemaList.get(i).getMeasurementId(), row1, value);
- tablet2.addValue(schemaList.get(i).getMeasurementId(), row2, value);
- tablet3.addValue(schemaList.get(i).getMeasurementId(), row3, value);
+ tablet1.addValue(schemaList.get(i).getMeasurementName(), row1, value);
+ tablet2.addValue(schemaList.get(i).getMeasurementName(), row2, value);
+ tablet3.addValue(schemaList.get(i).getMeasurementName(), row3, value);
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
session.insertTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -609,7 +609,7 @@ public class SessionCacheLeaderTest {
timestamp++;
}
- if (tablet1.rowSize != 0) {
+ if (tablet1.getRowSize() != 0) {
session.insertTablets(tabletMap, true);
tablet1.reset();
tablet2.reset();
@@ -634,33 +634,37 @@ public class SessionCacheLeaderTest {
assertNull(session.endPointToSessionConnection);
String tableName = "table1";
- List<IMeasurementSchema> schemaList = new ArrayList<>();
- List<ColumnType> columnTypeList = new ArrayList<>();
- schemaList.add(new MeasurementSchema("id", TSDataType.STRING));
- schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
- schemaList.add(new MeasurementSchema("s2", TSDataType.INT64));
- columnTypeList.add(ColumnType.ID);
- columnTypeList.add(ColumnType.MEASUREMENT);
- columnTypeList.add(ColumnType.MEASUREMENT);
- Tablet tablet = new Tablet(tableName, schemaList, columnTypeList, 50);
+ List<String> measurements = new ArrayList<>();
+ measurements.add("id");
+ measurements.add("s1");
+ measurements.add("s2");
+ List<TSDataType> dataTypes = new ArrayList<>();
+ dataTypes.add(TSDataType.STRING);
+ dataTypes.add(TSDataType.INT64);
+ dataTypes.add(TSDataType.INT64);
+ List<ColumnCategory> columnTypeList = new ArrayList<>();
+ columnTypeList.add(ColumnCategory.ID);
+ columnTypeList.add(ColumnCategory.MEASUREMENT);
+ columnTypeList.add(ColumnCategory.MEASUREMENT);
+ Tablet tablet = new Tablet(tableName, measurements, dataTypes, columnTypeList, 50);
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, "id" + (rowIndex % 4));
+ tablet.addValue(measurements.get(0), rowIndex, "id" + (rowIndex % 4));
for (int s = 1; s < 3; s++) {
long value = new Random().nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(measurements.get(s), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertRelationalTablet(tablet);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertRelationalTablet(tablet);
tablet.reset();
}
@@ -676,22 +680,22 @@ public class SessionCacheLeaderTest {
assertEquals(1, session.endPointToSessionConnection.size());
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, "id" + (rowIndex % 4));
+ tablet.addValue(measurements.get(0), rowIndex, "id" + (rowIndex % 4));
for (int s = 1; s < 3; s++) {
long value = new Random().nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(measurements.get(s), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertRelationalTablet(tablet);
tablet.reset();
}
timestamp++;
}
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
session.insertRelationalTablet(tablet);
tablet.reset();
}
@@ -853,7 +857,7 @@ public class SessionCacheLeaderTest {
try {
session.open();
} catch (IoTDBConnectionException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
assertNull(session.deviceIdToEndpoint);
assertNull(session.endPointToSessionConnection);
@@ -885,19 +889,19 @@ public class SessionCacheLeaderTest {
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
tablet1.addTimestamp(row1, timestamp);
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 3; i++) {
long value = new Random().nextLong();
- tablet1.addValue(schemaList.get(i).getMeasurementId(), row1, value);
- tablet2.addValue(schemaList.get(i).getMeasurementId(), row2, value);
- tablet3.addValue(schemaList.get(i).getMeasurementId(), row3, value);
+ tablet1.addValue(schemaList.get(i).getMeasurementName(), row1, value);
+ tablet2.addValue(schemaList.get(i).getMeasurementName(), row2, value);
+ tablet3.addValue(schemaList.get(i).getMeasurementName(), row3, value);
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
try {
session.insertTablets(tabletMap, true);
fail();
@@ -918,7 +922,7 @@ public class SessionCacheLeaderTest {
try {
session.close();
} catch (IoTDBConnectionException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
// with leader cache
@@ -927,29 +931,29 @@ public class SessionCacheLeaderTest {
try {
session.open();
} catch (IoTDBConnectionException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
assertEquals(0, session.deviceIdToEndpoint.size());
assertEquals(1, session.endPointToSessionConnection.size());
for (long row = 0; row < 100; row++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
tablet1.addTimestamp(row1, timestamp);
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 3; i++) {
long value = new Random().nextLong();
- tablet1.addValue(schemaList.get(i).getMeasurementId(), row1, value);
- tablet2.addValue(schemaList.get(i).getMeasurementId(), row2, value);
- tablet3.addValue(schemaList.get(i).getMeasurementId(), row3, value);
+ tablet1.addValue(schemaList.get(i).getMeasurementName(), row1, value);
+ tablet2.addValue(schemaList.get(i).getMeasurementName(), row2, value);
+ tablet3.addValue(schemaList.get(i).getMeasurementName(), row3, value);
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
try {
session.insertTablets(tabletMap, true);
} catch (IoTDBConnectionException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
tablet1.reset();
tablet2.reset();
@@ -963,28 +967,28 @@ public class SessionCacheLeaderTest {
// set connection as broken, due to we enable the cache leader, when we called
// ((MockSession) session).getLastConstructedSessionConnection(), the session's endpoint has
// been changed to EndPoint(ip:127.0.0.1, port:55562)
- Assert.assertEquals(
+ assertEquals(
"MockSessionConnection{ endPoint=TEndPoint(ip:127.0.0.1, port:55562)}",
((MockSession) session).getLastConstructedSessionConnection().toString());
for (long row = 0; row < 10; row++) {
- int row1 = tablet1.rowSize++;
- int row2 = tablet2.rowSize++;
- int row3 = tablet3.rowSize++;
+ int row1 = tablet1.getRowSize();
+ int row2 = tablet2.getRowSize();
+ int row3 = tablet3.getRowSize();
tablet1.addTimestamp(row1, timestamp);
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 3; i++) {
long value = new Random().nextLong();
- tablet1.addValue(schemaList.get(i).getMeasurementId(), row1, value);
- tablet2.addValue(schemaList.get(i).getMeasurementId(), row2, value);
- tablet3.addValue(schemaList.get(i).getMeasurementId(), row3, value);
+ tablet1.addValue(schemaList.get(i).getMeasurementName(), row1, value);
+ tablet2.addValue(schemaList.get(i).getMeasurementName(), row2, value);
+ tablet3.addValue(schemaList.get(i).getMeasurementName(), row3, value);
}
- if (tablet1.rowSize == tablet1.getMaxRowNumber()) {
+ if (tablet1.getRowSize() == tablet1.getMaxRowNumber()) {
try {
session.insertTablets(tabletMap, true);
} catch (IoTDBConnectionException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
tablet1.reset();
tablet2.reset();
@@ -995,7 +999,7 @@ public class SessionCacheLeaderTest {
try {
session.insertTablets(tabletMap, true);
} catch (IoTDBConnectionException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
tablet1.reset();
tablet2.reset();
@@ -1009,7 +1013,7 @@ public class SessionCacheLeaderTest {
try {
session.close();
} catch (IoTDBConnectionException e) {
- Assert.fail(e.getMessage());
+ fail(e.getMessage());
}
}
@@ -1030,25 +1034,31 @@ public class SessionCacheLeaderTest {
String tableName = "table1";
List<IMeasurementSchema> schemaList = new ArrayList<>();
- List<ColumnType> columnTypeList = new ArrayList<>();
+ List<ColumnCategory> columnTypeList = new ArrayList<>();
schemaList.add(new MeasurementSchema("id", TSDataType.STRING));
schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s2", TSDataType.INT64));
- columnTypeList.add(ColumnType.ID);
- columnTypeList.add(ColumnType.MEASUREMENT);
- columnTypeList.add(ColumnType.MEASUREMENT);
- Tablet tablet = new Tablet(tableName, schemaList, columnTypeList, 50);
+ columnTypeList.add(ColumnCategory.ID);
+ columnTypeList.add(ColumnCategory.MEASUREMENT);
+ columnTypeList.add(ColumnCategory.MEASUREMENT);
+ Tablet tablet =
+ new Tablet(
+ tableName,
+ IMeasurementSchema.getMeasurementNameList(schemaList),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypeList,
+ 50);
long timestamp = System.currentTimeMillis();
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, "id" + (rowIndex % 4));
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, "id" + (rowIndex % 4));
for (int s = 1; s < 3; s++) {
long value = new Random().nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insertRelationalTablet(tablet);
fail();
@@ -1082,15 +1092,15 @@ public class SessionCacheLeaderTest {
assertEquals(1, session.endPointToSessionConnection.size());
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, "id" + (rowIndex % 4));
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, "id" + (rowIndex % 4));
for (int s = 1; s < 3; s++) {
long value = new Random().nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insertRelationalTablet(tablet);
} catch (IoTDBConnectionException e) {
@@ -1111,15 +1121,15 @@ public class SessionCacheLeaderTest {
((MockSession) session).getLastConstructedSessionConnection().toString());
for (long row = 0; row < 100; row++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
- tablet.addValue(schemaList.get(0).getMeasurementId(), rowIndex, "id" + (rowIndex % 4));
+ tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, "id" + (rowIndex % 4));
for (int s = 1; s < 3; s++) {
long value = new Random().nextLong();
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, value);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, value);
}
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
try {
session.insertRelationalTablet(tablet);
} catch (IoTDBConnectionException e) {
diff --git a/iotdb-client/session/src/test/java/org/apache/iotdb/session/SessionTest.java b/iotdb-client/session/src/test/java/org/apache/iotdb/session/SessionTest.java
index 106129d0ec2..1ea2fcf6f86 100644
--- a/iotdb-client/session/src/test/java/org/apache/iotdb/session/SessionTest.java
+++ b/iotdb-client/session/src/test/java/org/apache/iotdb/session/SessionTest.java
@@ -802,10 +802,10 @@ public class SessionTest {
public void testInsertTablet() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -821,10 +821,10 @@ public class SessionTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {5l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -840,10 +840,10 @@ public class SessionTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.INT32);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.INT32);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
int[][] values = new int[][] {{12, 22}, {14, 34}};
@@ -859,10 +859,10 @@ public class SessionTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.INT32);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.INT32);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
int[][] values = new int[][] {{12, 22}, {14, 34}};
@@ -878,10 +878,10 @@ public class SessionTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.INT32);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.INT32);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {2l, 1l};
int[][] values = new int[][] {{34, 42}, {40, 42}};
@@ -904,10 +904,10 @@ public class SessionTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.FLOAT);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.FLOAT);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {2l, 1l};
float[][] values = new float[][] {{1.1f, 1.0f}, {1.2f, 1.0f}};
@@ -923,10 +923,10 @@ public class SessionTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.DOUBLE);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.DOUBLE);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {2l, 1l};
double[][] values = new double[][] {{22.2, 22.0}, {21.5, 23.0}};
@@ -943,10 +943,10 @@ public class SessionTest {
Whitebox.setInternalState(session, "enableRedirection", false);
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.TEXT);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.TEXT);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {2l, 3l};
Binary[][] values =
@@ -975,10 +975,10 @@ public class SessionTest {
public void testTestInsertTablet() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -994,10 +994,10 @@ public class SessionTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -1012,10 +1012,10 @@ public class SessionTest {
public void testTestInsertTablets() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -1031,10 +1031,10 @@ public class SessionTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
diff --git a/iotdb-client/session/src/test/java/org/apache/iotdb/session/TabletTest.java b/iotdb-client/session/src/test/java/org/apache/iotdb/session/TabletTest.java
index 9f8c178e3d0..a936393e9aa 100644
--- a/iotdb-client/session/src/test/java/org/apache/iotdb/session/TabletTest.java
+++ b/iotdb-client/session/src/test/java/org/apache/iotdb/session/TabletTest.java
@@ -91,7 +91,7 @@ public class TabletTest {
new Binary("2".getBytes(StandardCharsets.UTF_8))
};
- tablet.rowSize = 3;
+ tablet.setRowSize(3);
session.sortTablet(tablet);
diff --git a/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolExceptionTest.java b/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolExceptionTest.java
index 9eb096a6ef5..285fd8270dd 100644
--- a/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolExceptionTest.java
+++ b/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolExceptionTest.java
@@ -120,10 +120,10 @@ public class SessionPoolExceptionTest {
.insertTablet(any(Tablet.class), anyBoolean());
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -139,10 +139,10 @@ public class SessionPoolExceptionTest {
.insertTablets(anyMap(), anyBoolean());
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
Object[] values = new Object[] {true, false};
@@ -181,10 +181,10 @@ public class SessionPoolExceptionTest {
.insertAlignedTablets(anyMap(), anyBoolean());
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
Object[] values = new Object[] {true, false};
diff --git a/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java b/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
index 6abce3bdf47..650d0087eb6 100644
--- a/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
+++ b/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
@@ -215,10 +215,10 @@ public class SessionPoolTest {
public void testInsertTablet() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -259,10 +259,10 @@ public class SessionPoolTest {
public void testTestInsertTablet1() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -278,10 +278,10 @@ public class SessionPoolTest {
public void testTestInsertTablet2() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -297,10 +297,10 @@ public class SessionPoolTest {
public void testTestInsertTablets() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -319,10 +319,10 @@ public class SessionPoolTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
boolean[][] values = new boolean[][] {{true, false}, {true, false}};
@@ -398,10 +398,10 @@ public class SessionPoolTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
Object[] values = new Object[] {true, false};
@@ -417,10 +417,10 @@ public class SessionPoolTest {
public void testInsertTablets() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
Object[] values = new Object[] {true, false};
@@ -439,10 +439,10 @@ public class SessionPoolTest {
throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
Object[] values = new Object[] {true, false};
@@ -1191,10 +1191,10 @@ public class SessionPoolTest {
public void testSortTablet() throws IoTDBConnectionException, StatementExecutionException {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1l, 2l};
Object[] values = new Object[] {true, false};
diff --git a/iotdb-client/session/src/test/java/org/apache/iotdb/session/util/SessionUtilsTest.java b/iotdb-client/session/src/test/java/org/apache/iotdb/session/util/SessionUtilsTest.java
index c8692154e1d..25b59b07474 100644
--- a/iotdb-client/session/src/test/java/org/apache/iotdb/session/util/SessionUtilsTest.java
+++ b/iotdb-client/session/src/test/java/org/apache/iotdb/session/util/SessionUtilsTest.java
@@ -46,10 +46,10 @@ public class SessionUtilsTest {
public void testGetTimeBuffer() {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1L, 2L};
Object[] values = new Object[] {true, false};
@@ -63,40 +63,40 @@ public class SessionUtilsTest {
public void testGetValueBuffer() {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.INT32);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.INT32);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.INT64);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.INT64);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.FLOAT);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.FLOAT);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.DOUBLE);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.DOUBLE);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.TEXT);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.TEXT);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
long[] timestamp = new long[] {1L};
@@ -147,46 +147,46 @@ public class SessionUtilsTest {
public void testGetValueBuffer3() {
List<IMeasurementSchema> schemas = new ArrayList<>();
MeasurementSchema schema = new MeasurementSchema();
- schema.setMeasurementId("pressure0");
- schema.setType(TSDataType.INT32);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure0");
+ schema.setDataType(TSDataType.INT32);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure1");
- schema.setType(TSDataType.INT64);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure1");
+ schema.setDataType(TSDataType.INT64);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure2");
- schema.setType(TSDataType.FLOAT);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure2");
+ schema.setDataType(TSDataType.FLOAT);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure3");
- schema.setType(TSDataType.DOUBLE);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure3");
+ schema.setDataType(TSDataType.DOUBLE);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure4");
- schema.setType(TSDataType.TEXT);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure4");
+ schema.setDataType(TSDataType.TEXT);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure5");
- schema.setType(TSDataType.BOOLEAN);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure5");
+ schema.setDataType(TSDataType.BOOLEAN);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
schema = new MeasurementSchema();
- schema.setMeasurementId("pressure6");
- schema.setType(TSDataType.DATE);
- schema.setCompressor(CompressionType.SNAPPY.serialize());
- schema.setEncoding(TSEncoding.PLAIN.serialize());
+ schema.setMeasurementName("pressure6");
+ schema.setDataType(TSDataType.DATE);
+ schema.setCompressionType(CompressionType.SNAPPY);
+ schema.setEncoding(TSEncoding.PLAIN);
schemas.add(schema);
Tablet tablet = new Tablet("device1", schemas, 2);
@@ -198,7 +198,7 @@ public class SessionUtilsTest {
tablet.values[4] = new Binary[] {null, new Binary(new byte[] {(byte) 16})};
tablet.values[5] = new boolean[] {true, false};
tablet.values[6] = new LocalDate[] {null, LocalDate.of(2024, 4, 1)};
- tablet.rowSize += 2;
+ tablet.setRowSize(tablet.getRowSize() + 2);
ByteBuffer timeBuffer = SessionUtils.getValueBuffer(tablet);
Assert.assertNotNull(timeBuffer);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/batch/PipeTabletEventTsFileBatch.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/batch/PipeTabletEventTsFileBatch.java
index bf8bd522369..02a82e598c9 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/batch/PipeTabletEventTsFileBatch.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/batch/PipeTabletEventTsFileBatch.java
@@ -138,7 +138,7 @@ public class PipeTabletEventTsFileBatch extends PipeTabletEventBatch {
final List<Tablet> tablets = insertNodeTabletInsertionEvent.convertToTablets();
for (int i = 0; i < tablets.size(); ++i) {
final Tablet tablet = tablets.get(i);
- if (tablet.rowSize == 0) {
+ if (tablet.getRowSize() == 0) {
continue;
}
bufferTablet(
@@ -151,7 +151,7 @@ public class PipeTabletEventTsFileBatch extends PipeTabletEventBatch {
final PipeRawTabletInsertionEvent rawTabletInsertionEvent =
(PipeRawTabletInsertionEvent) event;
final Tablet tablet = rawTabletInsertionEvent.convertToTablet();
- if (tablet.rowSize == 0) {
+ if (tablet.getRowSize() == 0) {
return true;
}
bufferTablet(
@@ -332,7 +332,7 @@ public class PipeTabletEventTsFileBatch extends PipeTabletEventBatch {
final Tablet tablet = tablets.peekFirst();
if (Objects.isNull(lastTablet)
// lastTablet.rowSize is not 0
- || lastTablet.timestamps[lastTablet.rowSize - 1] < tablet.timestamps[0]) {
+ || lastTablet.timestamps[lastTablet.getRowSize() - 1] < tablet.timestamps[0]) {
tabletsToWrite.add(tablet);
lastTablet = tablet;
tablets.pollFirst();
@@ -378,7 +378,7 @@ public class PipeTabletEventTsFileBatch extends PipeTabletEventBatch {
}
}
- fileWriter.write(tablet);
+ fileWriter.writeTree(tablet);
}
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/request/PipeTransferTabletRawReq.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/request/PipeTransferTabletRawReq.java
index 15bd70cf470..7c5ef90299d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/request/PipeTransferTabletRawReq.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/request/PipeTransferTabletRawReq.java
@@ -71,7 +71,7 @@ public class PipeTransferTabletRawReq extends TPipeTransferReq {
final TSInsertTabletReq request = new TSInsertTabletReq();
for (final IMeasurementSchema measurementSchema : tablet.getSchemas()) {
- request.addToMeasurements(measurementSchema.getMeasurementId());
+ request.addToMeasurements(measurementSchema.getMeasurementName());
request.addToTypes(measurementSchema.getType().ordinal());
}
@@ -79,7 +79,7 @@ public class PipeTransferTabletRawReq extends TPipeTransferReq {
request.setIsAligned(isAligned);
request.setTimestamps(SessionUtils.getTimeBuffer(tablet));
request.setValues(SessionUtils.getValueBuffer(tablet));
- request.setSize(tablet.rowSize);
+ request.setSize(tablet.getRowSize());
request.setMeasurements(
PathUtils.checkIsLegalSingleMeasurementsAndUpdate(request.getMeasurements()));
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/request/PipeTransferTabletRawReqV2.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/request/PipeTransferTabletRawReqV2.java
index 0700acab199..c0ae65e0628 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/request/PipeTransferTabletRawReqV2.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/payload/evolvable/request/PipeTransferTabletRawReqV2.java
@@ -68,7 +68,7 @@ public class PipeTransferTabletRawReqV2 extends PipeTransferTabletRawReq {
final TSInsertTabletReq request = new TSInsertTabletReq();
for (final IMeasurementSchema measurementSchema : tablet.getSchemas()) {
- request.addToMeasurements(measurementSchema.getMeasurementId());
+ request.addToMeasurements(measurementSchema.getMeasurementName());
request.addToTypes(measurementSchema.getType().ordinal());
}
@@ -76,7 +76,7 @@ public class PipeTransferTabletRawReqV2 extends PipeTransferTabletRawReq {
request.setIsAligned(isAligned);
request.setTimestamps(SessionUtils.getTimeBuffer(tablet));
request.setValues(SessionUtils.getValueBuffer(tablet));
- request.setSize(tablet.rowSize);
+ request.setSize(tablet.getRowSize());
// Tree model
if (Objects.isNull(dataBaseName)) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/legacy/IoTDBLegacyPipeConnector.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/legacy/IoTDBLegacyPipeConnector.java
index 05d90c30a72..443663b7aa1 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/legacy/IoTDBLegacyPipeConnector.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/legacy/IoTDBLegacyPipeConnector.java
@@ -345,7 +345,7 @@ public class IoTDBLegacyPipeConnector implements PipeConnector {
final List<Tablet> tablets = pipeInsertNodeInsertionEvent.convertToTablets();
for (int i = 0; i < tablets.size(); ++i) {
final Tablet tablet = tablets.get(i);
- if (Objects.isNull(tablet) || tablet.rowSize == 0) {
+ if (Objects.isNull(tablet) || tablet.getRowSize() == 0) {
continue;
}
if (pipeInsertNodeInsertionEvent.isAligned(i)) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcua/OpcUaNameSpace.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcua/OpcUaNameSpace.java
index cc2f7d57aa1..c1a01ab0db0 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcua/OpcUaNameSpace.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcua/OpcUaNameSpace.java
@@ -153,7 +153,7 @@ public class OpcUaNameSpace extends ManagedNamespaceWithLifecycle {
final String currentFolder = currentStr.toString();
for (int i = 0; i < tablet.getSchemas().size(); ++i) {
final IMeasurementSchema measurementSchema = tablet.getSchemas().get(i);
- final String name = measurementSchema.getMeasurementId();
+ final String name = measurementSchema.getMeasurementName();
final TSDataType type = measurementSchema.getType();
final NodeId nodeId = newNodeId(currentFolder + name);
final UaVariableNode measurementNode;
@@ -183,7 +183,7 @@ public class OpcUaNameSpace extends ManagedNamespaceWithLifecycle {
}
int lastNonnullIndex = -1;
- for (int j = 0; j < tablet.rowSize; ++j) {
+ for (int j = 0; j < tablet.getRowSize(); ++j) {
if (!tablet.bitMaps[i].isMarked(j)) {
lastNonnullIndex = j;
break;
@@ -258,12 +258,12 @@ public class OpcUaNameSpace extends ManagedNamespaceWithLifecycle {
eventNode.setSourceName(
tablet.getDeviceId()
+ TsFileConstant.PATH_SEPARATOR
- + tablet.getSchemas().get(columnIndex).getMeasurementId());
+ + tablet.getSchemas().get(columnIndex).getMeasurementName());
// Source node --> Sensor type, like double
eventNode.setSourceNode(convertToOpcDataType(dataType));
- for (int rowIndex = 0; rowIndex < tablet.rowSize; ++rowIndex) {
+ for (int rowIndex = 0; rowIndex < tablet.getRowSize(); ++rowIndex) {
// Filter null value
if (tablet.bitMaps[columnIndex].isMarked(rowIndex)) {
continue;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/util/PipeTabletEventSorter.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/util/PipeTabletEventSorter.java
index 2a5e8769b59..ee34099eb21 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/util/PipeTabletEventSorter.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/util/PipeTabletEventSorter.java
@@ -42,15 +42,15 @@ public class PipeTabletEventSorter {
public PipeTabletEventSorter(final Tablet tablet) {
this.tablet = tablet;
- deduplicatedSize = tablet == null ? 0 : tablet.rowSize;
+ deduplicatedSize = tablet == null ? 0 : tablet.getRowSize();
}
public void deduplicateAndSortTimestampsIfNecessary() {
- if (tablet == null || tablet.rowSize == 0) {
+ if (tablet == null || tablet.getRowSize() == 0) {
return;
}
- for (int i = 1, size = tablet.rowSize; i < size; ++i) {
+ for (int i = 1, size = tablet.getRowSize(); i < size; ++i) {
final long currentTimestamp = tablet.timestamps[i];
final long previousTimestamp = tablet.timestamps[i - 1];
@@ -70,8 +70,8 @@ public class PipeTabletEventSorter {
return;
}
- index = new Integer[tablet.rowSize];
- for (int i = 0, size = tablet.rowSize; i < size; i++) {
+ index = new Integer[tablet.getRowSize()];
+ for (int i = 0, size = tablet.getRowSize(); i < size; i++) {
index[i] = i;
}
@@ -93,12 +93,12 @@ public class PipeTabletEventSorter {
private void sortTimestamps() {
Arrays.sort(index, Comparator.comparingLong(i -> tablet.timestamps[i]));
- Arrays.sort(tablet.timestamps, 0, tablet.rowSize);
+ Arrays.sort(tablet.timestamps, 0, tablet.getRowSize());
}
private void deduplicateTimestamps() {
deduplicatedSize = 1;
- for (int i = 1, size = tablet.rowSize; i < size; i++) {
+ for (int i = 1, size = tablet.getRowSize(); i < size; i++) {
if (tablet.timestamps[i] != tablet.timestamps[i - 1]) {
index[deduplicatedSize] = index[i];
tablet.timestamps[deduplicatedSize] = tablet.timestamps[i];
@@ -106,7 +106,7 @@ public class PipeTabletEventSorter {
++deduplicatedSize;
}
}
- tablet.rowSize = deduplicatedSize;
+ tablet.setRowSize(deduplicatedSize);
}
private void sortAndDeduplicateValuesAndBitMaps() {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeRowCollector.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeRowCollector.java
index bda7422ee4a..8a1fca02fc7 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeRowCollector.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/row/PipeRowCollector.java
@@ -28,6 +28,7 @@ import org.apache.iotdb.pipe.api.access.Row;
import org.apache.iotdb.pipe.api.collector.RowCollector;
import org.apache.iotdb.pipe.api.event.dml.insertion.TabletInsertionEvent;
import org.apache.iotdb.pipe.api.exception.PipeException;
+import org.apache.iotdb.pipe.api.type.Binary;
import org.apache.tsfile.utils.Pair;
import org.apache.tsfile.write.record.Tablet;
@@ -76,25 +77,24 @@ public class PipeRowCollector implements RowCollector {
isAligned = pipeRow.isAligned();
}
- final int rowIndex = tablet.rowSize;
+ final int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, row.getTime());
for (int i = 0; i < row.size(); i++) {
final Object value = row.getObject(i);
- if (value instanceof org.apache.iotdb.pipe.api.type.Binary) {
+ if (value instanceof Binary) {
tablet.addValue(
- measurementSchemaArray[i].getMeasurementId(),
+ measurementSchemaArray[i].getMeasurementName(),
rowIndex,
- PipeBinaryTransformer.transformToBinary((org.apache.iotdb.pipe.api.type.Binary) value));
+ PipeBinaryTransformer.transformToBinary((Binary) value));
} else {
- tablet.addValue(measurementSchemaArray[i].getMeasurementId(), rowIndex, value);
+ tablet.addValue(measurementSchemaArray[i].getMeasurementName(), rowIndex, value);
}
if (row.isNull(i)) {
tablet.bitMaps[i].mark(rowIndex);
}
}
- tablet.rowSize++;
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
collectTabletInsertionEvent();
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java
index 3cd8cc72c25..3cda6c2749b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java
@@ -427,7 +427,7 @@ public class PipeInsertNodeTabletInsertionEvent extends PipeInsertionEvent
public long count() {
long count = 0;
for (final Tablet covertedTablet : convertToTablets()) {
- count += (long) covertedTablet.rowSize * covertedTablet.getSchemas().size();
+ count += (long) covertedTablet.getRowSize() * covertedTablet.getSchemas().size();
}
return count;
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
index 2782e04c9aa..b2eae812987 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
@@ -330,7 +330,7 @@ public class PipeRawTabletInsertionEvent extends PipeInsertionEvent
public long count() {
final Tablet covertedTablet = shouldParseTimeOrPattern() ? convertToTablet() : tablet;
- return (long) covertedTablet.rowSize * covertedTablet.getSchemas().size();
+ return (long) covertedTablet.getRowSize() * covertedTablet.getSchemas().size();
}
/////////////////////////// parsePatternOrTime ///////////////////////////
@@ -354,7 +354,7 @@ public class PipeRawTabletInsertionEvent extends PipeInsertionEvent
public static boolean isTabletEmpty(final Tablet tablet) {
return Objects.isNull(tablet)
- || tablet.rowSize == 0
+ || tablet.getRowSize() == 0
|| Objects.isNull(tablet.getSchemas())
|| tablet.getSchemas().isEmpty();
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventParser.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventParser.java
index ca35571726c..3eddd7ee6ac 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventParser.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventParser.java
@@ -70,7 +70,7 @@ public abstract class TabletInsertionEventParser {
protected String[] columnNameStringList;
protected long[] timestampColumn;
- protected Tablet.ColumnType[] valueColumnTypes;
+ protected Tablet.ColumnCategory[] valueColumnTypes;
protected TSDataType[] valueColumnDataTypes;
// Each column of Object[] is a column of primitive type array
protected Object[] valueColumns;
@@ -135,7 +135,7 @@ public abstract class TabletInsertionEventParser {
this.measurementSchemaList = new MeasurementSchema[filteredColumnSize];
this.columnNameStringList = new String[filteredColumnSize];
this.valueColumnDataTypes = new TSDataType[filteredColumnSize];
- this.valueColumnTypes = new Tablet.ColumnType[filteredColumnSize];
+ this.valueColumnTypes = new Tablet.ColumnCategory[filteredColumnSize];
this.valueColumns = new Object[filteredColumnSize];
this.nullValueColumnBitmaps = new BitMap[filteredColumnSize];
@@ -153,7 +153,7 @@ public abstract class TabletInsertionEventParser {
this.valueColumnTypes[filteredColumnIndex] =
originColumnCategories != null && originColumnCategories[i] != null
? originColumnCategories[i].toTsFileColumnType()
- : Tablet.ColumnType.MEASUREMENT;
+ : Tablet.ColumnCategory.MEASUREMENT;
this.valueColumnDataTypes[filteredColumnIndex] = originValueColumnDataTypes[i];
final BitMap bitMap = new BitMap(this.timestampColumn.length);
if (Objects.isNull(originValueColumns[i])
@@ -215,7 +215,7 @@ public abstract class TabletInsertionEventParser {
this.measurementSchemaList = new MeasurementSchema[filteredColumnSize];
this.columnNameStringList = new String[filteredColumnSize];
- this.valueColumnTypes = new Tablet.ColumnType[filteredColumnSize];
+ this.valueColumnTypes = new Tablet.ColumnCategory[filteredColumnSize];
this.valueColumnDataTypes = new TSDataType[filteredColumnSize];
this.valueColumns = new Object[filteredColumnSize];
this.nullValueColumnBitmaps = new BitMap[filteredColumnSize];
@@ -247,7 +247,7 @@ public abstract class TabletInsertionEventParser {
this.valueColumnTypes[filteredColumnIndex] =
originColumnCategories != null && originColumnCategories[i] != null
? originColumnCategories[i].toTsFileColumnType()
- : Tablet.ColumnType.MEASUREMENT;
+ : Tablet.ColumnCategory.MEASUREMENT;
this.valueColumnDataTypes[filteredColumnIndex] = originValueColumnDataTypes[i];
final BitMap bitMap = new BitMap(this.timestampColumn.length);
if (Objects.isNull(originValueColumns[i])
@@ -295,14 +295,15 @@ public abstract class TabletInsertionEventParser {
final long[] originTimestampColumn =
Arrays.copyOf(
- tablet.timestamps, tablet.rowSize); // tablet.timestamps.length == tablet.maxRowNumber
+ tablet.timestamps,
+ tablet.getRowSize()); // tablet.timestamps.length == tablet.maxRowNumber
final List<Integer> rowIndexList = generateRowIndexList(originTimestampColumn);
this.timestampColumn = rowIndexList.stream().mapToLong(i -> originTimestampColumn[i]).toArray();
final List<IMeasurementSchema> originMeasurementSchemaList = tablet.getSchemas();
final String[] originMeasurementList = new String[originMeasurementSchemaList.size()];
for (int i = 0; i < originMeasurementSchemaList.size(); i++) {
- originMeasurementList[i] = originMeasurementSchemaList.get(i).getMeasurementId();
+ originMeasurementList[i] = originMeasurementSchemaList.get(i).getMeasurementName();
}
generateColumnIndexMapper(
@@ -316,20 +317,20 @@ public abstract class TabletInsertionEventParser {
this.measurementSchemaList = new MeasurementSchema[filteredColumnSize];
this.columnNameStringList = new String[filteredColumnSize];
- this.valueColumnTypes = new Tablet.ColumnType[filteredColumnSize];
+ this.valueColumnTypes = new Tablet.ColumnCategory[filteredColumnSize];
this.valueColumnDataTypes = new TSDataType[filteredColumnSize];
this.valueColumns = new Object[filteredColumnSize];
this.nullValueColumnBitmaps = new BitMap[filteredColumnSize];
final String[] originColumnNameStringList = new String[originColumnSize];
- final Tablet.ColumnType[] originColumnTypes = new Tablet.ColumnType[originColumnSize];
+ final Tablet.ColumnCategory[] originColumnTypes = new Tablet.ColumnCategory[originColumnSize];
final TSDataType[] originValueColumnDataTypes = new TSDataType[originColumnSize];
for (int i = 0; i < originColumnSize; i++) {
- originColumnNameStringList[i] = originMeasurementSchemaList.get(i).getMeasurementId();
+ originColumnNameStringList[i] = originMeasurementSchemaList.get(i).getMeasurementName();
originColumnTypes[i] =
tablet.getColumnTypes() != null && tablet.getColumnTypes().get(i) != null
? tablet.getColumnTypes().get(i)
- : Tablet.ColumnType.MEASUREMENT;
+ : Tablet.ColumnCategory.MEASUREMENT;
originValueColumnDataTypes[i] = originMeasurementSchemaList.get(i).getType();
}
final Object[] originValueColumns =
@@ -353,7 +354,7 @@ public abstract class TabletInsertionEventParser {
this.measurementSchemaList[filteredColumnIndex] = originMeasurementSchemaList.get(i);
this.columnNameStringList[filteredColumnIndex] = originColumnNameStringList[i];
this.valueColumnTypes[filteredColumnIndex] =
- originColumnTypes[i] != null ? originColumnTypes[i] : Tablet.ColumnType.MEASUREMENT;
+ originColumnTypes[i] != null ? originColumnTypes[i] : Tablet.ColumnCategory.MEASUREMENT;
this.valueColumnDataTypes[filteredColumnIndex] = originValueColumnDataTypes[i];
final BitMap bitMap = new BitMap(this.timestampColumn.length);
if (Objects.isNull(originValueColumns[i])
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventTablePatternParser.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventTablePatternParser.java
index 091a7c7486e..de68404fb2a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventTablePatternParser.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventTablePatternParser.java
@@ -126,12 +126,10 @@ public class TabletInsertionEventTablePatternParser extends TabletInsertionEvent
Objects.nonNull(deviceIdString) ? deviceIdString : deviceId.getTableName(),
Arrays.asList(measurementSchemaList),
Arrays.asList(valueColumnTypes),
+ timestampColumn,
+ valueColumns,
+ nullValueColumnBitmaps,
rowCount);
- newTablet.timestamps = timestampColumn;
- newTablet.bitMaps = nullValueColumnBitmaps;
- newTablet.values = valueColumns;
- newTablet.rowSize = rowCount;
- newTablet.setColumnTypes(Arrays.asList(valueColumnTypes));
tablet = newTablet;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventTreePatternParser.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventTreePatternParser.java
index 98edbee9487..3c314a39e5d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventTreePatternParser.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventTreePatternParser.java
@@ -170,7 +170,7 @@ public class TabletInsertionEventTreePatternParser extends TabletInsertionEventP
newTablet.timestamps = timestampColumn;
newTablet.bitMaps = nullValueColumnBitmaps;
newTablet.values = valueColumns;
- newTablet.rowSize = rowCount;
+ newTablet.setRowSize(rowCount);
tablet = newTablet;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/query/TsFileInsertionEventQueryParserTabletIterator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/query/TsFileInsertionEventQueryParserTabletIterator.java
index 643ce6b2183..b63fc682a1f 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/query/TsFileInsertionEventQueryParserTabletIterator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/query/TsFileInsertionEventQueryParserTabletIterator.java
@@ -157,7 +157,7 @@ public class TsFileInsertionEventQueryParserTabletIterator implements Iterator<T
isFirstRow = false;
}
- final int rowIndex = tablet.rowSize;
+ final int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, rowRecord.getTimestamp());
@@ -171,9 +171,7 @@ public class TsFileInsertionEventQueryParserTabletIterator implements Iterator<T
field == null ? null : field.getObjectValue(schemas.get(i).getType()));
}
- tablet.rowSize++;
-
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
break;
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/TsFileInsertionEventScanParser.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/TsFileInsertionEventScanParser.java
index 39ec771167c..9534825dd93 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/TsFileInsertionEventScanParser.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/TsFileInsertionEventScanParser.java
@@ -219,12 +219,10 @@ public class TsFileInsertionEventScanParser extends TsFileInsertionEventParser {
isFirstRow = false;
}
- final int rowIndex = tablet.rowSize;
+ final int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, data.currentTime());
putValueToColumns(data, tablet, rowIndex);
-
- tablet.rowSize++;
}
data.next();
@@ -232,7 +230,7 @@ public class TsFileInsertionEventScanParser extends TsFileInsertionEventParser {
data = chunkReader.nextPageData();
}
- if (tablet != null && tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet != null && tablet.getRowSize() == tablet.getMaxRowNumber()) {
break;
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/table/TsFileInsertionEventTableParserTabletIterator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/table/TsFileInsertionEventTableParserTabletIterator.java
index fb11bbc8e27..39c109496c5 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/table/TsFileInsertionEventTableParserTabletIterator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/table/TsFileInsertionEventTableParserTabletIterator.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.pipe.event.common.tsfile.parser.table;
import org.apache.iotdb.pipe.api.exception.PipeException;
+import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.exception.read.ReadProcessException;
import org.apache.tsfile.file.metadata.TableSchema;
import org.apache.tsfile.read.common.block.TsBlock;
@@ -46,7 +47,7 @@ public class TsFileInsertionEventTableParserTabletIterator implements Iterator<T
private final long endTime;
private final List<IMeasurementSchema> columnSchemas;
- private final List<Tablet.ColumnType> columnTypes;
+ private final List<Tablet.ColumnCategory> columnTypes;
private final List<String> columnNames;
private final TsBlockReader tsBlockReader;
@@ -66,10 +67,10 @@ public class TsFileInsertionEventTableParserTabletIterator implements Iterator<T
try {
for (int i = 0, size = tableSchema.getColumnSchemas().size(); i < size; i++) {
final IMeasurementSchema schema = tableSchema.getColumnSchemas().get(i);
- if (schema.getMeasurementId() != null && !schema.getMeasurementId().isEmpty()) {
+ if (schema.getMeasurementName() != null && !schema.getMeasurementName().isEmpty()) {
columnSchemas.add(schema);
columnTypes.add(tableSchema.getColumnTypes().get(i));
- columnNames.add(schema.getMeasurementId());
+ columnNames.add(schema.getMeasurementName());
}
}
@@ -101,8 +102,16 @@ public class TsFileInsertionEventTableParserTabletIterator implements Iterator<T
private Tablet buildNextTablet() throws IOException {
final TsBlock tsBlock = tsBlockReader.next();
+ List<String> measurementList = new ArrayList<>(columnSchemas.size());
+ List<TSDataType> dataTypeList = new ArrayList<>(columnSchemas.size());
+ columnSchemas.forEach(
+ columnSchema -> {
+ measurementList.add(columnSchema.getMeasurementName());
+ dataTypeList.add(columnSchema.getType());
+ });
final Tablet tablet =
- new Tablet(tableName, columnSchemas, columnTypes, tsBlock.getPositionCount());
+ new Tablet(
+ tableName, measurementList, dataTypeList, columnTypes, tsBlock.getPositionCount());
tablet.initBitMaps();
boolean isAllNull = true;
@@ -116,7 +125,7 @@ public class TsFileInsertionEventTableParserTabletIterator implements Iterator<T
continue;
}
- final int rowIndex = tablet.rowSize;
+ final int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int i = 0, fieldSize = row.length - 1; i < fieldSize; i++) {
final Object value =
@@ -124,15 +133,14 @@ public class TsFileInsertionEventTableParserTabletIterator implements Iterator<T
? row[i]
: DateUtils.parseIntToLocalDate((Integer) row[i]);
tablet.addValue(columnNames.get(i), rowIndex, value);
- if (value != null && columnTypes.get(i) == Tablet.ColumnType.MEASUREMENT) {
+ if (value != null && columnTypes.get(i) == Tablet.ColumnCategory.MEASUREMENT) {
isAllNull = false;
}
}
- tablet.rowSize++;
}
if (isAllNull) {
- tablet.rowSize = 0;
+ tablet.setRowSize(0);
}
return tablet;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/processor/twostage/plugin/TwoStageCountProcessor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/processor/twostage/plugin/TwoStageCountProcessor.java
index f5a2a84c473..5595fbffd39 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/processor/twostage/plugin/TwoStageCountProcessor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/processor/twostage/plugin/TwoStageCountProcessor.java
@@ -262,7 +262,6 @@ public class TwoStageCountProcessor implements PipeProcessor {
Collections.singletonList(
new MeasurementSchema(outputSeries.getMeasurement(), TSDataType.INT64)),
1);
- tablet.rowSize = 1;
tablet.addTimestamp(0, timestampCountPair.left);
tablet.addValue(outputSeries.getMeasurement(), 0, timestampCountPair.right);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java
index f68ccda84e6..d8a7b7fde2a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java
@@ -483,7 +483,7 @@ public class InsertNodeMemoryEstimator {
// Header + primitive + reference
long size = MEASUREMENT_SCHEMA_SIZE;
// measurementId
- size += sizeOfString(measurementSchema.getMeasurementId());
+ size += sizeOfString(measurementSchema.getMeasurementName());
// props
final Map<String, String> props = measurementSchema.getProps();
if (props != null) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTree.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTree.java
index 974703b2933..91781dcca0c 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTree.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTree.java
@@ -242,7 +242,7 @@ public class ClusterSchemaTree implements ISchemaTree {
fullPath.getFullPath(),
schemaComputation
.getDevicePath()
- .concatAsMeasurementPath(logicalViewSchema.getMeasurementId())
+ .concatAsMeasurementPath(logicalViewSchema.getMeasurementName())
.getFullPath()));
} else if (measurementPathList.size() > 1) {
throw new SemanticException(
@@ -251,7 +251,7 @@ public class ClusterSchemaTree implements ISchemaTree {
fullPath.getFullPath(),
schemaComputation
.getDevicePath()
- .concatAsMeasurementPath(logicalViewSchema.getMeasurementId())));
+ .concatAsMeasurementPath(logicalViewSchema.getMeasurementName())));
} else {
Integer realIndex = schemaComputation.getIndexListOfLogicalViewPaths().get(index);
MeasurementPath measurementPath = measurementPathList.get(0);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/visitor/SchemaTreeVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/visitor/SchemaTreeVisitor.java
index 7c84ed76581..f1649223117 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/visitor/SchemaTreeVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/visitor/SchemaTreeVisitor.java
@@ -141,7 +141,7 @@ public abstract class SchemaTreeVisitor<R> extends AbstractTreeVisitor<SchemaNod
IMeasurementSchema measurementSchema = templateChildrenIterator.next();
next =
new SchemaMeasurementNode(
- measurementSchema.getMeasurementId(), measurementSchema);
+ measurementSchema.getMeasurementName(), measurementSchema);
} else {
return false;
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/MemoryEstimationHelper.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/MemoryEstimationHelper.java
index d77cab2bf78..2d33717db0a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/MemoryEstimationHelper.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/MemoryEstimationHelper.java
@@ -70,7 +70,7 @@ public class MemoryEstimationHelper {
alignedPath.getMeasurementList().stream().mapToLong(RamUsageEstimator::sizeOf).sum();
totalSize +=
alignedPath.getSchemaList().stream()
- .mapToLong(schema -> RamUsageEstimator.sizeOf(schema.getMeasurementId()))
+ .mapToLong(schema -> RamUsageEstimator.sizeOf(schema.getMeasurementName()))
.sum();
} else if (partialPath instanceof MeasurementPath) {
totalSize += partialPath.getIDeviceID().ramBytesUsed();
@@ -81,7 +81,7 @@ public class MemoryEstimationHelper {
totalSize += RamUsageEstimator.sizeOf(measurementPath.getMeasurementAlias());
if (measurementPath.getMeasurementSchema() != null) {
totalSize +=
- RamUsageEstimator.sizeOf(measurementPath.getMeasurementSchema().getMeasurementId());
+ RamUsageEstimator.sizeOf(measurementPath.getMeasurementSchema().getMeasurementName());
}
} else {
// the whole path is a device
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/TemplatedInfo.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/TemplatedInfo.java
index 5a4beb851ee..4e407cc5700 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/TemplatedInfo.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/TemplatedInfo.java
@@ -437,7 +437,7 @@ public class TemplatedInfo {
new HashMap<>(measurementSchemaList.size());
measurementSchemaList.forEach(
measurementSchema ->
- measurementSchemaMap.put(measurementSchema.getMeasurementId(), measurementSchema));
+ measurementSchemaMap.put(measurementSchema.getMeasurementName(), measurementSchema));
Expression pushDownPredicate = null;
byte hasPushDownFilter = ReadWriteIOUtils.readByte(byteBuffer);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java
index 9a4b4f2127a..92c847b850c 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java
@@ -244,7 +244,7 @@ public class TreeSchemaAutoCreatorAndVerifier {
final IDeviceID device = entry.getKey();
final Map<String, MeasurementSchema> measurement2Schema = new HashMap<>();
for (final MeasurementSchema timeseriesSchema : entry.getValue()) {
- final String measurement = timeseriesSchema.getMeasurementId();
+ final String measurement = timeseriesSchema.getMeasurementName();
if (measurement2Schema.containsKey(measurement)) {
throw new VerifyMetadataException(
String.format("Duplicated measurements %s in device %s.", measurement, device));
@@ -366,7 +366,7 @@ public class TreeSchemaAutoCreatorAndVerifier {
int index = 0;
for (final MeasurementSchema measurementSchema : entry.getValue()) {
- measurements[index] = measurementSchema.getMeasurementId();
+ measurements[index] = measurementSchema.getMeasurementName();
tsDataTypes[index] = measurementSchema.getType();
encodings[index] = measurementSchema.getEncodingType();
compressionTypes[index++] = measurementSchema.getCompressor();
@@ -401,7 +401,7 @@ public class TreeSchemaAutoCreatorAndVerifier {
schemaTree.searchDeviceSchemaInfo(
new PartialPath(device),
tsfileTimeseriesSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()));
if (iotdbDeviceSchemaInfo == null) {
@@ -445,7 +445,7 @@ public class TreeSchemaAutoCreatorAndVerifier {
"Measurement %s%s%s datatype not match, TsFile: %s, IoTDB: %s",
device,
TsFileConstant.PATH_SEPARATOR,
- iotdbSchema.getMeasurementId(),
+ iotdbSchema.getMeasurementName(),
tsFileSchema.getType(),
iotdbSchema.getType()));
}
@@ -459,7 +459,7 @@ public class TreeSchemaAutoCreatorAndVerifier {
+ "TsFile encoding: {}, IoTDB encoding: {}",
device,
TsFileConstant.PATH_SEPARATOR,
- iotdbSchema.getMeasurementId(),
+ iotdbSchema.getMeasurementName(),
tsFileSchema.getEncodingType().name(),
iotdbSchema.getEncodingType().name());
}
@@ -473,7 +473,7 @@ public class TreeSchemaAutoCreatorAndVerifier {
+ "TsFile compressor: {}, IoTDB compressor: {}",
device,
TsFileConstant.PATH_SEPARATOR,
- iotdbSchema.getMeasurementId(),
+ iotdbSchema.getMeasurementName(),
tsFileSchema.getCompressor().name(),
iotdbSchema.getCompressor().name());
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGenerator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGenerator.java
index 20461c5011c..3a4a02eab86 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGenerator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGenerator.java
@@ -103,7 +103,7 @@ import org.apache.tsfile.file.metadata.enums.CompressionType;
import org.apache.tsfile.file.metadata.enums.TSEncoding;
import org.apache.tsfile.utils.ReadWriteIOUtils;
import org.apache.tsfile.utils.TimeDuration;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import java.nio.ByteBuffer;
import java.time.ZoneId;
@@ -298,7 +298,7 @@ public class StatementGenerator {
for (int i = 0; i < columnCategories.length; i++) {
columnCategories[i] =
TsTableColumnCategory.fromTsFileColumnType(
- ColumnType.values()[insertRecordReq.getColumnCategoryies().get(i).intValue()]);
+ ColumnCategory.values()[insertRecordReq.getColumnCategoryies().get(i).intValue()]);
}
insertStatement.setColumnCategories(columnCategories);
}
@@ -367,7 +367,7 @@ public class StatementGenerator {
for (int i = 0; i < columnCategories.length; i++) {
columnCategories[i] =
TsTableColumnCategory.fromTsFileColumnType(
- ColumnType.values()[insertTabletReq.columnCategories.get(i).intValue()]);
+ ColumnCategory.values()[insertTabletReq.columnCategories.get(i).intValue()]);
}
insertStatement.setColumnCategories(columnCategories);
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertNode.java
index aad396228e1..b13250a3784 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertNode.java
@@ -272,7 +272,7 @@ public abstract class InsertNode extends SearchNode {
protected void deserializeMeasurementSchemas(DataInputStream stream) throws IOException {
for (int i = 0; i < measurements.length; i++) {
measurementSchemas[i] = MeasurementSchema.deserializeFrom(stream);
- measurements[i] = measurementSchemas[i].getMeasurementId();
+ measurements[i] = measurementSchemas[i].getMeasurementName();
dataTypes[i] = measurementSchemas[i].getType();
}
}
@@ -280,7 +280,7 @@ public abstract class InsertNode extends SearchNode {
protected void deserializeMeasurementSchemas(ByteBuffer buffer) {
for (int i = 0; i < measurements.length; i++) {
measurementSchemas[i] = MeasurementSchema.deserializeFrom(buffer);
- measurements[i] = measurementSchemas[i].getMeasurementId();
+ measurements[i] = measurementSchemas[i].getMeasurementName();
}
}
@@ -400,7 +400,7 @@ public abstract class InsertNode extends SearchNode {
for (int i = 0; i < measurements.length; i++) {
if (measurementSchemas[i] != null) {
// get raw measurement rather than alias
- rawMeasurements[i] = measurementSchemas[i].getMeasurementId();
+ rawMeasurements[i] = measurementSchemas[i].getMeasurementName();
} else {
rawMeasurements[i] = measurements[i];
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowNode.java
index 0bdd41d11d4..ffd51f22384 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowNode.java
@@ -443,7 +443,7 @@ public class InsertRowNode extends InsertNode implements WALEntryValue {
measurementSchemas = new MeasurementSchema[measurementSize];
for (int i = 0; i < measurementSize; i++) {
measurementSchemas[i] = MeasurementSchema.deserializeFrom(buffer);
- measurements[i] = measurementSchemas[i].getMeasurementId();
+ measurements[i] = measurementSchemas[i].getMeasurementName();
}
} else {
for (int i = 0; i < measurementSize; i++) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertTabletNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertTabletNode.java
index 2773206a9db..71664aa9b55 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertTabletNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertTabletNode.java
@@ -718,7 +718,7 @@ public class InsertTabletNode extends InsertNode implements WALEntryValue {
this.measurementSchemas = new MeasurementSchema[measurementSize];
for (int i = 0; i < measurementSize; i++) {
measurementSchemas[i] = MeasurementSchema.deserializeFrom(buffer);
- measurements[i] = measurementSchemas[i].getMeasurementId();
+ measurements[i] = measurementSchemas[i].getMeasurementName();
}
} else {
for (int i = 0; i < measurementSize; i++) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableSchema.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableSchema.java
index af4307dc15d..b5c2997206e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableSchema.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableSchema.java
@@ -25,7 +25,7 @@ import org.apache.iotdb.commons.schema.table.column.TsTableColumnSchema;
import org.apache.iotdb.db.queryengine.plan.relational.type.InternalTypeManager;
import org.apache.tsfile.enums.TSDataType;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.slf4j.Logger;
@@ -92,7 +92,7 @@ public class TableSchema {
// TODO-Table: unify redundant definitions
String tableName = this.getTableName();
List<IMeasurementSchema> measurementSchemas = new ArrayList<>();
- List<ColumnType> columnTypes = new ArrayList<>();
+ List<ColumnCategory> columnTypes = new ArrayList<>();
for (ColumnSchema column : columns) {
if (column.getColumnCategory() == TsTableColumnCategory.TIME) {
continue;
@@ -110,7 +110,7 @@ public class TableSchema {
// TODO-Table: unify redundant definitions
String tableName = this.getTableName();
List<IMeasurementSchema> measurementSchemas = new ArrayList<>();
- List<ColumnType> columnTypes = new ArrayList<>();
+ List<ColumnCategory> columnTypes = new ArrayList<>();
for (ColumnSchema column : columns) {
if (column.getColumnCategory() == TsTableColumnCategory.TIME
|| column.getColumnCategory() == TsTableColumnCategory.ATTRIBUTE) {
@@ -132,14 +132,14 @@ public class TableSchema {
try {
List<ColumnSchema> columns = new ArrayList<>();
for (int i = 0; i < tsFileTableSchema.getColumnSchemas().size(); i++) {
- final String columnName = tsFileTableSchema.getColumnSchemas().get(i).getMeasurementId();
+ final String columnName = tsFileTableSchema.getColumnSchemas().get(i).getMeasurementName();
if (columnName == null || columnName.isEmpty()) {
continue;
}
// TsFile should not contain attribute columns by design.
- final ColumnType columnType = tsFileTableSchema.getColumnTypes().get(i);
- if (columnType == ColumnType.ATTRIBUTE) {
+ final ColumnCategory columnType = tsFileTableSchema.getColumnTypes().get(i);
+ if (columnType == ColumnCategory.ATTRIBUTE) {
continue;
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/SchemaCacheEntry.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/SchemaCacheEntry.java
index 52a71207f9d..d26ddd88fc1 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/SchemaCacheEntry.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/SchemaCacheEntry.java
@@ -78,13 +78,13 @@ public class SchemaCacheEntry implements IMeasurementSchemaInfo {
public static int estimateSize(final SchemaCacheEntry schemaCacheEntry) {
return INSTANCE_SIZE
- + 2 * schemaCacheEntry.getSchema().getMeasurementId().length()
+ + 2 * schemaCacheEntry.getSchema().getMeasurementName().length()
+ (int) RamUsageEstimator.sizeOfMap(schemaCacheEntry.getTagMap());
}
@Override
public String getName() {
- return iMeasurementSchema.getMeasurementId();
+ return iMeasurementSchema.getMeasurementName();
}
@Override
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceSchemaCacheManager.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceSchemaCacheManager.java
index 4e77466d81f..d17202b48cb 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceSchemaCacheManager.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceSchemaCacheManager.java
@@ -288,14 +288,14 @@ public class TreeDeviceSchemaCacheManager {
new IMeasurementSchemaInfo() {
@Override
public String getName() {
- return schema.getMeasurementId();
+ return schema.getMeasurementName();
}
@Override
public IMeasurementSchema getSchema() {
if (isLogicalView()) {
return new LogicalViewSchema(
- schema.getMeasurementId(), ((LogicalViewSchema) schema).getExpression());
+ schema.getMeasurementName(), ((LogicalViewSchema) schema).getExpression());
} else {
return this.getSchemaAsMeasurementSchema();
}
@@ -304,7 +304,7 @@ public class TreeDeviceSchemaCacheManager {
@Override
public MeasurementSchema getSchemaAsMeasurementSchema() {
return new MeasurementSchema(
- schema.getMeasurementId(),
+ schema.getMeasurementName(),
schema.getType(),
schema.getEncodingType(),
schema.getCompressor());
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertBaseStatement.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertBaseStatement.java
index 8c5681c914a..c0b917f9100 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertBaseStatement.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertBaseStatement.java
@@ -585,7 +585,7 @@ public abstract class InsertBaseStatement extends Statement {
}
if (measurementSchemas != null) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
- measurementSchema.setMeasurementId(measurementSchema.getMeasurementId().toLowerCase());
+ measurementSchema.setMeasurementName(measurementSchema.getMeasurementName().toLowerCase());
}
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/read/resp/reader/impl/TimeseriesReaderWithViewFetch.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/read/resp/reader/impl/TimeseriesReaderWithViewFetch.java
index 0c661532654..40da4c24af8 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/read/resp/reader/impl/TimeseriesReaderWithViewFetch.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/read/resp/reader/impl/TimeseriesReaderWithViewFetch.java
@@ -262,7 +262,8 @@ public class TimeseriesReaderWithViewFetch implements ISchemaReader<ITimeSeriesS
delayedLogicalViewList
.get(i)
.getSchema()
- .setType(viewIsBroken ? TSDataType.UNKNOWN : expressionTypes.get(NodeRef.of(expression)));
+ .setDataType(
+ viewIsBroken ? TSDataType.UNKNOWN : expressionTypes.get(NodeRef.of(expression)));
if (FILTER_VISITOR.process(schemaFilter, delayedLogicalViewList.get(i))) {
cachedViewList.add(delayedLogicalViewList.get(i));
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MNodeUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MNodeUtils.java
index b896e6e0d9d..96fd00c848a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MNodeUtils.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MNodeUtils.java
@@ -90,7 +90,7 @@ public class MNodeUtils {
public N next() {
IMeasurementSchema schema = schemas.next();
return nodeFactor
- .createMeasurementMNode(null, schema.getMeasurementId(), schema, null)
+ .createMeasurementMNode(null, schema.getMeasurementName(), schema, null)
.getAsMNode();
}
};
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/ResourceByPathUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/ResourceByPathUtils.java
index 637996677f5..e7306ef2eb2 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/ResourceByPathUtils.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/ResourceByPathUtils.java
@@ -122,7 +122,7 @@ class AlignedResourceByPathUtils extends ResourceByPathUtils {
for (IMeasurementSchema valueChunkMetadata : (alignedFullPath.getSchemaList())) {
TimeseriesMetadata valueMetadata = new TimeseriesMetadata();
valueMetadata.setDataSizeOfChunkMetaDataList(-1);
- valueMetadata.setMeasurementId(valueChunkMetadata.getMeasurementId());
+ valueMetadata.setMeasurementId(valueChunkMetadata.getMeasurementName());
valueMetadata.setTsDataType(valueChunkMetadata.getType());
valueMetadata.setStatistics(Statistics.getStatsByType(valueChunkMetadata.getType()));
valueTimeSeriesMetadataList.add(valueMetadata);
@@ -336,7 +336,7 @@ class MeasurementResourceByPathUtils extends ResourceByPathUtils {
public ITimeSeriesMetadata generateTimeSeriesMetadata(
List<ReadOnlyMemChunk> readOnlyMemChunk, List<IChunkMetadata> chunkMetadataList) {
TimeseriesMetadata timeSeriesMetadata = new TimeseriesMetadata();
- timeSeriesMetadata.setMeasurementId(fullPath.getMeasurementSchema().getMeasurementId());
+ timeSeriesMetadata.setMeasurementId(fullPath.getMeasurementSchema().getMeasurementName());
timeSeriesMetadata.setTsDataType(fullPath.getMeasurementSchema().getType());
timeSeriesMetadata.setDataSizeOfChunkMetaDataList(-1);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/template/Template.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/template/Template.java
index 8fe86a9abfe..a23fcb78541 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/template/Template.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/template/Template.java
@@ -78,7 +78,7 @@ public class Template implements Serializable {
IMeasurementSchema schema =
new MeasurementSchema(
measurements.get(i), dataTypes.get(i), encodings.get(i), compressors.get(i));
- schemaMap.put(schema.getMeasurementId(), schema);
+ schemaMap.put(schema.getMeasurementName(), schema);
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/performer/impl/ReadPointCompactionPerformer.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/performer/impl/ReadPointCompactionPerformer.java
index c5f07933605..98a6d0439cd 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/performer/impl/ReadPointCompactionPerformer.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/performer/impl/ReadPointCompactionPerformer.java
@@ -167,7 +167,7 @@ public class ReadPointCompactionPerformer
}
List<String> existedMeasurements =
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList());
fragmentInstanceContext.setIgnoreAllNullRows(device.getTableName().startsWith("root."));
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/CompactionTableSchema.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/CompactionTableSchema.java
index fd411e7a8b8..5751c4beb82 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/CompactionTableSchema.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/CompactionTableSchema.java
@@ -22,7 +22,7 @@ package org.apache.iotdb.db.storageengine.dataregion.compaction.execute.utils;
import org.apache.iotdb.db.storageengine.dataregion.compaction.execute.exception.CompactionTableSchemaNotMatchException;
import org.apache.tsfile.file.metadata.TableSchema;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import java.util.ArrayList;
@@ -43,28 +43,28 @@ public class CompactionTableSchema extends TableSchema {
}
// filter id columns
List<IMeasurementSchema> otherSchemaColumnSchemas = tableSchema.getColumnSchemas();
- List<ColumnType> otherSchemaColumnTypes = tableSchema.getColumnTypes();
+ List<ColumnCategory> otherSchemaColumnCategories = tableSchema.getColumnTypes();
List<IMeasurementSchema> idColumnSchemasToMerge = new ArrayList<>();
- for (int i = 0; i < otherSchemaColumnTypes.size(); i++) {
- ColumnType columnType = otherSchemaColumnTypes.get(i);
- if (columnType != ColumnType.ID) {
+ for (int i = 0; i < otherSchemaColumnCategories.size(); i++) {
+ ColumnCategory columnCategory = otherSchemaColumnCategories.get(i);
+ if (columnCategory != ColumnCategory.ID) {
continue;
}
idColumnSchemasToMerge.add(otherSchemaColumnSchemas.get(i));
}
// check id column prefix
- int prefixLength = Math.min(this.columnTypes.size(), idColumnSchemasToMerge.size());
+ int prefixLength = Math.min(this.columnCategories.size(), idColumnSchemasToMerge.size());
for (int i = 0; i < prefixLength; i++) {
IMeasurementSchema idColumnToMerge = idColumnSchemasToMerge.get(i);
- IMeasurementSchema currentIdColumn = columnSchemas.get(i);
- if (!idColumnToMerge.getMeasurementId().equals(currentIdColumn.getMeasurementId())) {
+ IMeasurementSchema currentIdColumn = measurementSchemas.get(i);
+ if (!idColumnToMerge.getMeasurementName().equals(currentIdColumn.getMeasurementName())) {
throw new CompactionTableSchemaNotMatchException(
"current id column name is "
- + currentIdColumn.getMeasurementId()
+ + currentIdColumn.getMeasurementName()
+ ", other id column name in same position is "
- + idColumnToMerge.getMeasurementId());
+ + idColumnToMerge.getMeasurementName());
}
}
@@ -72,15 +72,15 @@ public class CompactionTableSchema extends TableSchema {
List<IMeasurementSchema> newIdColumns =
idColumnSchemasToMerge.subList(prefixLength, idColumnSchemasToMerge.size());
for (IMeasurementSchema newIdColumn : newIdColumns) {
- columnTypes.add(ColumnType.ID);
- columnSchemas.add(newIdColumn);
+ columnCategories.add(ColumnCategory.ID);
+ measurementSchemas.add(newIdColumn);
}
}
public CompactionTableSchema copy() {
CompactionTableSchema tableSchema = new CompactionTableSchema(this.tableName);
- tableSchema.columnSchemas = new ArrayList<>(this.columnSchemas);
- tableSchema.columnTypes = new ArrayList<>(this.columnTypes);
+ tableSchema.measurementSchemas = new ArrayList<>(this.measurementSchemas);
+ tableSchema.columnCategories = new ArrayList<>(this.columnCategories);
return tableSchema;
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/BatchedFastAlignedSeriesCompactionExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/BatchedFastAlignedSeriesCompactionExecutor.java
index a4fe7c37694..c2044da7f63 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/BatchedFastAlignedSeriesCompactionExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/BatchedFastAlignedSeriesCompactionExecutor.java
@@ -207,9 +207,9 @@ public class BatchedFastAlignedSeriesCompactionExecutor
List<IMeasurementSchema> measurementSchemas) {
Map<String, Map<TsFileResource, Pair<Long, Long>>> result = new HashMap<>();
for (IMeasurementSchema measurementSchema : measurementSchemas) {
- String measurementId = measurementSchema.getMeasurementId();
+ String measurementId = measurementSchema.getMeasurementName();
Map<TsFileResource, Pair<Long, Long>> entryValue =
- timeseriesMetadataOffsetMap.get(measurementSchema.getMeasurementId());
+ timeseriesMetadataOffsetMap.get(measurementSchema.getMeasurementName());
result.put(measurementId, entryValue);
}
return result;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/BatchedReadChunkAlignedSeriesCompactionExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/BatchedReadChunkAlignedSeriesCompactionExecutor.java
index e0d544287e2..c0d16841ab1 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/BatchedReadChunkAlignedSeriesCompactionExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/BatchedReadChunkAlignedSeriesCompactionExecutor.java
@@ -377,7 +377,7 @@ public class BatchedReadChunkAlignedSeriesCompactionExecutor
if (valueChunk.isEmpty()) {
IMeasurementSchema schema = schemaList.get(i);
writer.writeEmptyValueChunk(
- schema.getMeasurementId(),
+ schema.getMeasurementName(),
schema.getCompressor(),
schema.getType(),
schema.getEncodingType(),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/AlignedSeriesBatchCompactionUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/AlignedSeriesBatchCompactionUtils.java
index af1e102af71..25613fc2a1a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/AlignedSeriesBatchCompactionUtils.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/AlignedSeriesBatchCompactionUtils.java
@@ -103,7 +103,7 @@ public class AlignedSeriesBatchCompactionUtils {
originValueChunkMetadataList.get(currentValueChunkMetadataIndex);
if (currentValueChunkMetadata != null
&& currentSchema
- .getMeasurementId()
+ .getMeasurementName()
.equals(currentValueChunkMetadata.getMeasurementUid())) {
newValueChunkMetadataArr[i] = currentValueChunkMetadata;
currentValueChunkMetadataIndex++;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/FirstBatchCompactionAlignedChunkWriter.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/FirstBatchCompactionAlignedChunkWriter.java
index c3b6ae31747..8413abaf74e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/FirstBatchCompactionAlignedChunkWriter.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/FirstBatchCompactionAlignedChunkWriter.java
@@ -48,7 +48,7 @@ public class FirstBatchCompactionAlignedChunkWriter extends AlignedChunkWriterIm
public FirstBatchCompactionAlignedChunkWriter(VectorMeasurementSchema schema) {
timeChunkWriter =
new FirstBatchCompactionTimeChunkWriter(
- schema.getMeasurementId(),
+ schema.getMeasurementName(),
schema.getCompressor(),
schema.getTimeTSEncoding(),
schema.getTimeEncoder());
@@ -77,7 +77,7 @@ public class FirstBatchCompactionAlignedChunkWriter extends AlignedChunkWriterIm
IMeasurementSchema timeSchema, List<IMeasurementSchema> valueSchemaList) {
timeChunkWriter =
new FirstBatchCompactionTimeChunkWriter(
- timeSchema.getMeasurementId(),
+ timeSchema.getMeasurementName(),
timeSchema.getCompressor(),
timeSchema.getEncodingType(),
timeSchema.getTimeEncoder());
@@ -86,7 +86,7 @@ public class FirstBatchCompactionAlignedChunkWriter extends AlignedChunkWriterIm
for (int i = 0; i < valueSchemaList.size(); i++) {
valueChunkWriterList.add(
new ValueChunkWriter(
- valueSchemaList.get(i).getMeasurementId(),
+ valueSchemaList.get(i).getMeasurementName(),
valueSchemaList.get(i).getCompressor(),
valueSchemaList.get(i).getType(),
valueSchemaList.get(i).getEncodingType(),
@@ -113,7 +113,7 @@ public class FirstBatchCompactionAlignedChunkWriter extends AlignedChunkWriterIm
for (int i = 0; i < schemaList.size(); i++) {
valueChunkWriterList.add(
new ValueChunkWriter(
- schemaList.get(i).getMeasurementId(),
+ schemaList.get(i).getMeasurementName(),
schemaList.get(i).getCompressor(),
schemaList.get(i).getType(),
schemaList.get(i).getEncodingType(),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/FollowingBatchCompactionAlignedChunkWriter.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/FollowingBatchCompactionAlignedChunkWriter.java
index 2b642a11625..a00a568d7b3 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/FollowingBatchCompactionAlignedChunkWriter.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/FollowingBatchCompactionAlignedChunkWriter.java
@@ -53,7 +53,7 @@ public class FollowingBatchCompactionAlignedChunkWriter extends AlignedChunkWrit
for (int i = 0; i < valueSchemaList.size(); i++) {
valueChunkWriterList.add(
new ValueChunkWriter(
- valueSchemaList.get(i).getMeasurementId(),
+ valueSchemaList.get(i).getMeasurementName(),
valueSchemaList.get(i).getCompressor(),
valueSchemaList.get(i).getType(),
valueSchemaList.get(i).getEncodingType(),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/FastAlignedSeriesCompactionExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/FastAlignedSeriesCompactionExecutor.java
index 1fd8cb412d2..64fb585542d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/FastAlignedSeriesCompactionExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/FastAlignedSeriesCompactionExecutor.java
@@ -93,7 +93,7 @@ public class FastAlignedSeriesCompactionExecutor extends SeriesCompactionExecuto
this.timeColumnMeasurementSchema = measurementSchemas.get(0);
this.measurementSchemaMap = new HashMap<>();
this.measurementSchemas.forEach(
- schema -> measurementSchemaMap.put(schema.getMeasurementId(), schema));
+ schema -> measurementSchemaMap.put(schema.getMeasurementName(), schema));
this.ignoreAllNullRows = ignoreAllNullRows;
// get source files which are sorted by the startTime of current device from old to new,
// files that do not contain the current device have been filtered out as well.
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/FastNonAlignedSeriesCompactionExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/FastNonAlignedSeriesCompactionExecutor.java
index 5f2b671685c..1c0b5fbf7ae 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/FastNonAlignedSeriesCompactionExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/FastNonAlignedSeriesCompactionExecutor.java
@@ -210,7 +210,7 @@ public class FastNonAlignedSeriesCompactionExecutor extends SeriesCompactionExec
header.getEncodingType(),
header.getCompressionType());
compactionWriter.startMeasurement(
- schema.getMeasurementId(), new ChunkWriterImpl(schema, true), subTaskId);
+ schema.getMeasurementName(), new ChunkWriterImpl(schema, true), subTaskId);
hasStartMeasurement = true;
seriesCompressionType = header.getCompressionType();
seriesTSEncoding = header.getEncodingType();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/AlignedSeriesCompactionExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/AlignedSeriesCompactionExecutor.java
index bd755516d10..02628027ea0 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/AlignedSeriesCompactionExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/AlignedSeriesCompactionExecutor.java
@@ -111,7 +111,7 @@ public class AlignedSeriesCompactionExecutor {
}
}
List<IMeasurementSchema> collectedSchemaList = new ArrayList<>(schemaSet);
- collectedSchemaList.sort(Comparator.comparing(IMeasurementSchema::getMeasurementId));
+ collectedSchemaList.sort(Comparator.comparing(IMeasurementSchema::getMeasurementName));
return collectedSchemaList;
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/ReadChunkAlignedSeriesCompactionExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/ReadChunkAlignedSeriesCompactionExecutor.java
index 9c652602fef..12c205c472e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/ReadChunkAlignedSeriesCompactionExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/ReadChunkAlignedSeriesCompactionExecutor.java
@@ -171,7 +171,7 @@ public class ReadChunkAlignedSeriesCompactionExecutor {
this.schemaList =
measurementSchemaMap.values().stream()
- .sorted(Comparator.comparing(IMeasurementSchema::getMeasurementId))
+ .sorted(Comparator.comparing(IMeasurementSchema::getMeasurementName))
.collect(Collectors.toList());
}
@@ -271,7 +271,7 @@ public class ReadChunkAlignedSeriesCompactionExecutor {
if (valueChunk.isEmpty()) {
IMeasurementSchema schema = schemaList.get(i);
writer.writeEmptyValueChunk(
- schema.getMeasurementId(),
+ schema.getMeasurementName(),
schema.getCompressor(),
schema.getType(),
schema.getEncodingType(),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/SingleSeriesCompactionExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/SingleSeriesCompactionExecutor.java
index 7e85af0a9fe..a8bdcf985b9 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/SingleSeriesCompactionExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/SingleSeriesCompactionExecutor.java
@@ -79,7 +79,7 @@ public class SingleSeriesCompactionExecutor {
CompactionTsFileWriter fileWriter,
TsFileResource targetResource) {
this.device = device;
- this.measurement = measurementSchema.getMeasurementId();
+ this.measurement = measurementSchema.getMeasurementName();
this.readerAndChunkMetadataList = readerAndChunkMetadataList;
this.fileWriter = fileWriter;
this.schema = measurementSchema;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/io/CompactionTsFileWriter.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/io/CompactionTsFileWriter.java
index 45354d04b61..fe7bd7ee8cb 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/io/CompactionTsFileWriter.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/io/CompactionTsFileWriter.java
@@ -34,7 +34,7 @@ import org.apache.tsfile.file.metadata.statistics.Statistics;
import org.apache.tsfile.read.common.Chunk;
import org.apache.tsfile.write.chunk.AlignedChunkWriterImpl;
import org.apache.tsfile.write.chunk.IChunkWriter;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.writer.TsFileIOWriter;
import java.io.File;
@@ -159,8 +159,8 @@ public class CompactionTsFileWriter extends TsFileIOWriter {
Iterator<Map.Entry<String, TableSchema>> iterator = tableSchemaMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, TableSchema> entry = iterator.next();
- List<ColumnType> columnTypes = entry.getValue().getColumnTypes();
- if (columnTypes.contains(ColumnType.MEASUREMENT)) {
+ List<ColumnCategory> columnTypes = entry.getValue().getColumnTypes();
+ if (columnTypes.contains(ColumnCategory.MEASUREMENT)) {
continue;
}
iterator.remove();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AbstractMemTable.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AbstractMemTable.java
index b35ab02501f..fff93680c9c 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AbstractMemTable.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AbstractMemTable.java
@@ -173,7 +173,7 @@ public abstract class AbstractMemTable implements IMemTable {
IWritableMemChunkGroup memChunkGroup =
memTableMap.computeIfAbsent(deviceId, k -> new WritableMemChunkGroup());
for (IMeasurementSchema schema : schemaList) {
- if (schema != null && !memChunkGroup.contains(schema.getMeasurementId())) {
+ if (schema != null && !memChunkGroup.contains(schema.getMeasurementName())) {
seriesNumber++;
totalPointsNumThreshold += avgSeriesPointNumThreshold;
}
@@ -194,7 +194,7 @@ public abstract class AbstractMemTable implements IMemTable {
k.isTableModel());
});
for (IMeasurementSchema schema : schemaList) {
- if (schema != null && !memChunkGroup.contains(schema.getMeasurementId())) {
+ if (schema != null && !memChunkGroup.contains(schema.getMeasurementName())) {
seriesNumber++;
totalPointsNumThreshold += avgSeriesPointNumThreshold;
}
@@ -589,7 +589,7 @@ public abstract class AbstractMemTable implements IMemTable {
boolean containsMeasurement = false;
for (IMeasurementSchema measurementSchema : schemaList) {
- if (alignedMemChunk.containsMeasurement(measurementSchema.getMeasurementId())) {
+ if (alignedMemChunk.containsMeasurement(measurementSchema.getMeasurementName())) {
containsMeasurement = true;
break;
}
@@ -629,7 +629,7 @@ public abstract class AbstractMemTable implements IMemTable {
for (IMeasurementSchema schema : schemaList) {
deletionList.add(
ModificationUtils.constructDeletionList(
- deviceID, schema.getMeasurementId(), this, modsToMemTabled, ttlLowerBound));
+ deviceID, schema.getMeasurementName(), this, modsToMemTabled, ttlLowerBound));
}
}
buildAlignedMemChunkHandle(
@@ -691,7 +691,7 @@ public abstract class AbstractMemTable implements IMemTable {
timestamps = Arrays.copyOfRange(timestamps, 0, alignedTVList.rowCount());
for (int i = 0; i < schemaList.size(); i++) {
- String measurement = schemaList.get(i).getMeasurementId();
+ String measurement = schemaList.get(i).getMeasurementName();
List<BitMap> curBitMap = bitMaps == null ? Collections.emptyList() : bitMaps.get(i);
List<TimeRange> deletion =
deletionList == null || deletionList.isEmpty()
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedReadOnlyMemChunk.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedReadOnlyMemChunk.java
index e6f189d45e0..569db7347ab 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedReadOnlyMemChunk.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedReadOnlyMemChunk.java
@@ -62,7 +62,7 @@ public class AlignedReadOnlyMemChunk extends ReadOnlyMemChunk {
List<List<TimeRange>> valueColumnsDeletionList)
throws QueryProcessException {
super(context);
- this.timeChunkName = schema.getMeasurementId();
+ this.timeChunkName = schema.getMeasurementName();
this.valueChunkNames = schema.getSubMeasurementsList();
this.dataTypes = schema.getSubMeasurementsTSDataTypeList();
int floatPrecision = TSFileDescriptor.getInstance().getConfig().getFloatPrecision();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java
index 8ff67c20096..74c4682de6a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java
@@ -64,7 +64,7 @@ public class AlignedWritableMemChunk implements IWritableMemChunk {
List<TSDataType> dataTypeList = new ArrayList<>();
this.schemaList = schemaList;
for (int i = 0; i < schemaList.size(); i++) {
- measurementIndexMap.put(schemaList.get(i).getMeasurementId(), i);
+ measurementIndexMap.put(schemaList.get(i).getMeasurementName(), i);
dataTypeList.add(schemaList.get(i).getType());
}
this.list = AlignedTVList.newAlignedList(dataTypeList);
@@ -76,7 +76,7 @@ public class AlignedWritableMemChunk implements IWritableMemChunk {
this.measurementIndexMap = new LinkedHashMap<>();
this.schemaList = schemaList;
for (int i = 0; i < schemaList.size(); i++) {
- measurementIndexMap.put(schemaList.get(i).getMeasurementId(), i);
+ measurementIndexMap.put(schemaList.get(i).getMeasurementName(), i);
}
this.list = list;
this.ignoreAllNullRows = !isTableModel;
@@ -216,13 +216,13 @@ public class AlignedWritableMemChunk implements IWritableMemChunk {
for (int i = 0; i < schemaListInInsertPlan.size(); i++) {
IMeasurementSchema measurementSchema = schemaListInInsertPlan.get(i);
if (measurementSchema != null) {
- Integer index = this.measurementIndexMap.get(measurementSchema.getMeasurementId());
+ Integer index = this.measurementIndexMap.get(measurementSchema.getMeasurementName());
// Index is null means this measurement was not in this AlignedTVList before.
// We need to extend a new column in AlignedMemChunk and AlignedTVList.
// And the reorderedColumnValues should extend one more column for the new measurement
if (index == null) {
index = measurementIndexMap.size();
- this.measurementIndexMap.put(schemaListInInsertPlan.get(i).getMeasurementId(), index);
+ this.measurementIndexMap.put(schemaListInInsertPlan.get(i).getMeasurementName(), index);
this.schemaList.add(schemaListInInsertPlan.get(i));
this.list.extendColumn(schemaListInInsertPlan.get(i).getType());
reorderedColumnValues =
@@ -285,7 +285,7 @@ public class AlignedWritableMemChunk implements IWritableMemChunk {
List<TSDataType> dataTypeList = new ArrayList<>();
for (IMeasurementSchema measurementSchema : schemaList) {
columnIndexList.add(
- measurementIndexMap.getOrDefault(measurementSchema.getMeasurementId(), -1));
+ measurementIndexMap.getOrDefault(measurementSchema.getMeasurementName(), -1));
dataTypeList.add(measurementSchema.getType());
}
return list.getTvListByColumnIndex(columnIndexList, dataTypeList, ignoreAllNullRows);
@@ -327,7 +327,7 @@ public class AlignedWritableMemChunk implements IWritableMemChunk {
schemaList.remove(schemaToBeRemoved);
measurementIndexMap.clear();
for (int i = 0; i < schemaList.size(); i++) {
- measurementIndexMap.put(schemaList.get(i).getMeasurementId(), i);
+ measurementIndexMap.put(schemaList.get(i).getMeasurementName(), i);
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/WritableMemChunkGroup.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/WritableMemChunkGroup.java
index 5a8077da387..b3fade015a3 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/WritableMemChunkGroup.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/WritableMemChunkGroup.java
@@ -73,7 +73,7 @@ public class WritableMemChunkGroup implements IWritableMemChunkGroup {
private IWritableMemChunk createMemChunkIfNotExistAndGet(IMeasurementSchema schema) {
return memChunkMap.computeIfAbsent(
- schema.getMeasurementId(), k -> new WritableMemChunk(schema));
+ schema.getMeasurementName(), k -> new WritableMemChunk(schema));
}
@Override
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALWriteUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALWriteUtils.java
index 82ccce79f0e..be55b1785cd 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALWriteUtils.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALWriteUtils.java
@@ -174,7 +174,7 @@ public class WALWriteUtils {
public static int write(MeasurementSchema measurementSchema, IWALByteBufferView buffer) {
int len = 0;
- len += write(measurementSchema.getMeasurementId(), buffer);
+ len += write(measurementSchema.getMeasurementName(), buffer);
len += write(measurementSchema.getType(), buffer);
@@ -197,7 +197,7 @@ public class WALWriteUtils {
public static int sizeToWrite(MeasurementSchema measurementSchema) {
int byteLen = 0;
- byteLen += ReadWriteIOUtils.sizeToWrite(measurementSchema.getMeasurementId());
+ byteLen += ReadWriteIOUtils.sizeToWrite(measurementSchema.getMeasurementName());
byteLen += 3 * Byte.BYTES;
Map<String, String> props = measurementSchema.getProps();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/splitter/BatchedAlignedValueChunkData.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/splitter/BatchedAlignedValueChunkData.java
index 3bf50a9a296..a7b5a840ba6 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/splitter/BatchedAlignedValueChunkData.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/splitter/BatchedAlignedValueChunkData.java
@@ -137,7 +137,7 @@ public class BatchedAlignedValueChunkData extends AlignedChunkData {
chunkHeader.getCompressionType());
ValueChunkWriter valueChunkWriter =
new ValueChunkWriter(
- measurementSchema.getMeasurementId(),
+ measurementSchema.getMeasurementName(),
measurementSchema.getCompressor(),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileSplitByPartitionTool.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileSplitByPartitionTool.java
index d45b810fd4e..f50e472c414 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileSplitByPartitionTool.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileSplitByPartitionTool.java
@@ -259,7 +259,7 @@ public class TsFileSplitByPartitionTool implements AutoCloseable {
while (modsIterator.hasNext()) {
currentDeletion = modsIterator.next();
if (currentDeletion.affects(deviceId)
- && currentDeletion.affects(schema.getMeasurementId())
+ && currentDeletion.affects(schema.getMeasurementName())
&& currentDeletion
.getTimeRange()
.contains(pageHeader.getStartTime(), pageHeader.getEndTime())) {
@@ -388,7 +388,7 @@ public class TsFileSplitByPartitionTool implements AutoCloseable {
currentDeletion = modsIterator.next();
// if deletion path match the chunkPath, then add the deletion to the list
if (currentDeletion.affects(deviceId)
- && currentDeletion.affects(schema.getMeasurementId())) {
+ && currentDeletion.affects(schema.getMeasurementName())) {
chunkMetadata.insertIntoSortedDeletions(currentDeletion.getTimeRange());
}
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/trigger/executor/TriggerFireVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/trigger/executor/TriggerFireVisitor.java
index 9e0458ebc07..d02ff1d1d54 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/trigger/executor/TriggerFireVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/trigger/executor/TriggerFireVisitor.java
@@ -117,7 +117,6 @@ public class TriggerFireVisitor extends PlanVisitor<TriggerFireResult, TriggerEv
// only one row
Tablet tablet = new Tablet(node.getTargetPath().getFullPath(), schemas, 1);
// add one row
- tablet.rowSize++;
tablet.addTimestamp(0, time);
for (String measurement : entry.getValue()) {
tablet.addValue(measurement, 0, values[measurementToSchemaIndexMap.get(measurement)]);
@@ -275,12 +274,12 @@ public class TriggerFireVisitor extends PlanVisitor<TriggerFireResult, TriggerEv
continue;
}
// It is the same now
- if (schemas[i] != null && schemas[i].getMeasurementId().equals(measurements[i])) {
+ if (schemas[i] != null && schemas[i].getMeasurementName().equals(measurements[i])) {
indexMap.put(measurements[i], i);
continue;
}
for (int j = 0, m = schemas.length; j < m; j++) {
- if (schemas[j] != null && schemas[j].getMeasurementId().equals(measurements[i])) {
+ if (schemas[j] != null && schemas[j].getMeasurementName().equals(measurements[i])) {
indexMap.put(measurements[i], j);
break;
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java
index 32fff633559..cd4ca79ac43 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java
@@ -660,7 +660,7 @@ public class QueryDataSetUtils {
for (int i = 0; i < columns; i++) {
boolean hasBitMap = BytesUtils.byteToBool(buffer.get());
if (hasBitMap) {
- byte[] bytes = new byte[size / Byte.SIZE + 1];
+ byte[] bytes = new byte[BitMap.getSizeOfBytes(size)];
for (int j = 0; j < bytes.length; j++) {
bytes[j] = buffer.get();
}
@@ -679,7 +679,7 @@ public class QueryDataSetUtils {
for (int i = 0; i < columns; i++) {
boolean hasBitMap = BytesUtils.byteToBool(stream.readByte());
if (hasBitMap) {
- byte[] bytes = new byte[size / Byte.SIZE + 1];
+ byte[] bytes = new byte[BitMap.getSizeOfBytes(size)];
for (int j = 0; j < bytes.length; j++) {
bytes[j] = stream.readByte();
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/mtree/schemafile/WrappedSegmentTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/mtree/schemafile/WrappedSegmentTest.java
index 856aa2294de..307e57d37c2 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/mtree/schemafile/WrappedSegmentTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/mtree/schemafile/WrappedSegmentTest.java
@@ -87,7 +87,7 @@ public class WrappedSegmentTest {
ByteBuffer recMid01 = sf.getRecord("mid1");
Assert.assertEquals(
- "[measurementNode, alias: mid1als, type: FLOAT, encoding: PLAIN, compressor: LZ4]",
+ "[measurementNode, alias: mid1als, type: FLOAT, encoding: GORILLA, compressor: LZ4]",
RecordUtils.buffer2String(recMid01));
int resInsertNode = sf.insertRecord(rNode.getName(), RecordUtils.node2Buffer(rNode));
@@ -101,7 +101,7 @@ public class WrappedSegmentTest {
System.out.println(nsf);
ByteBuffer nrec = nsf.getRecord("mid1");
Assert.assertEquals(
- "[measurementNode, alias: mid1als, type: FLOAT, encoding: PLAIN, compressor: LZ4]",
+ "[measurementNode, alias: mid1als, type: FLOAT, encoding: GORILLA, compressor: LZ4]",
RecordUtils.buffer2String(nsf.getRecord("mid1")));
Assert.assertEquals(
"[entityNode, not aligned, not using template.]",
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/connector/PipeDataNodeThriftRequestTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/connector/PipeDataNodeThriftRequestTest.java
index 47065ef8eaa..1df32c9a374 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/connector/PipeDataNodeThriftRequestTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/connector/PipeDataNodeThriftRequestTest.java
@@ -63,6 +63,7 @@ import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.stream.Collectors;
public class PipeDataNodeThriftRequestTest {
@@ -212,7 +213,6 @@ public class PipeDataNodeThriftRequestTest {
schemaList.add(new MeasurementSchema("s9", TSDataType.BLOB));
schemaList.add(new MeasurementSchema("s10", TSDataType.STRING));
final Tablet t = new Tablet("root.sg.d", schemaList, 1024);
- t.rowSize = 2;
t.addTimestamp(0, 2000);
t.addTimestamp(1, 1000);
t.addValue("s1", 0, 2);
@@ -266,19 +266,26 @@ public class PipeDataNodeThriftRequestTest {
schemaList.add(new MeasurementSchema("s8", TSDataType.DATE));
schemaList.add(new MeasurementSchema("s9", TSDataType.BLOB));
schemaList.add(new MeasurementSchema("s10", TSDataType.STRING));
- List<Tablet.ColumnType> columnTypes = new ArrayList<>();
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- columnTypes.add(Tablet.ColumnType.MEASUREMENT);
- final Tablet t = new Tablet("root.sg.d", schemaList, columnTypes, 1024);
- t.rowSize = 2;
+ List<Tablet.ColumnCategory> columnTypes = new ArrayList<>();
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ columnTypes.add(Tablet.ColumnCategory.MEASUREMENT);
+ final Tablet t =
+ new Tablet(
+ "root.sg.d",
+ schemaList.stream()
+ .map(IMeasurementSchema::getMeasurementName)
+ .collect(Collectors.toList()),
+ IMeasurementSchema.getDataTypeList(schemaList),
+ columnTypes,
+ 1024);
t.addTimestamp(0, 2000);
t.addTimestamp(1, 1000);
t.addValue("s1", 0, 2);
@@ -362,7 +369,6 @@ public class PipeDataNodeThriftRequestTest {
schemaList.add(new MeasurementSchema("s10", TSDataType.STRING));
final Tablet t = new Tablet("root.sg.d", schemaList, 1024);
- t.rowSize = 2;
t.addTimestamp(0, 2000);
t.addTimestamp(1, 1000);
t.addValue("s1", 0, 2);
@@ -441,7 +447,6 @@ public class PipeDataNodeThriftRequestTest {
schemaList.add(new MeasurementSchema("s10", TSDataType.STRING));
final Tablet t = new Tablet("root.sg.d", schemaList, 1024);
- t.rowSize = 2;
t.addTimestamp(0, 2000);
t.addTimestamp(1, 1000);
t.addValue("s1", 0, 2);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/connector/PipeTabletEventSorterTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/connector/PipeTabletEventSorterTest.java
index e6977c7384c..a1cbaa0d03a 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/connector/PipeTabletEventSorterTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/connector/PipeTabletEventSorterTest.java
@@ -37,7 +37,7 @@ import java.util.Set;
public class PipeTabletEventSorterTest {
private static boolean checkSorted(final Tablet tablet) {
- for (int i = 1; i < tablet.rowSize; i++) {
+ for (int i = 1; i < tablet.getRowSize(); i++) {
if (tablet.timestamps[i] < tablet.timestamps[i - 1]) {
return false;
}
@@ -56,22 +56,22 @@ public class PipeTabletEventSorterTest {
long timestamp = 300;
for (long i = 0; i < 10; i++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp + i);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, timestamp + i);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, timestamp + i);
}
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp - i);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, timestamp - i);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, timestamp - i);
}
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, timestamp);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, timestamp);
}
}
@@ -86,15 +86,15 @@ public class PipeTabletEventSorterTest {
Assert.assertTrue(checkSorted(tablet));
- Assert.assertEquals(indices.size(), tablet.rowSize);
+ Assert.assertEquals(indices.size(), tablet.getRowSize());
- final long[] timestamps = Arrays.copyOfRange(tablet.timestamps, 0, tablet.rowSize);
+ final long[] timestamps = Arrays.copyOfRange(tablet.timestamps, 0, tablet.getRowSize());
for (int i = 0; i < 3; ++i) {
Assert.assertArrayEquals(
- timestamps, Arrays.copyOfRange((long[]) tablet.values[0], 0, tablet.rowSize));
+ timestamps, Arrays.copyOfRange((long[]) tablet.values[0], 0, tablet.getRowSize()));
}
- for (int i = 1; i < tablet.rowSize; ++i) {
+ for (int i = 1; i < tablet.getRowSize(); ++i) {
Assert.assertTrue(timestamps[i] > timestamps[i - 1]);
for (int j = 0; j < 3; ++j) {
Assert.assertTrue(((long[]) tablet.values[j])[i] > ((long[]) tablet.values[j])[i - 1]);
@@ -113,10 +113,10 @@ public class PipeTabletEventSorterTest {
long timestamp = 300;
for (long i = 0; i < 10; i++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, timestamp);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, timestamp);
}
}
@@ -131,15 +131,15 @@ public class PipeTabletEventSorterTest {
Assert.assertTrue(checkSorted(tablet));
- Assert.assertEquals(indices.size(), tablet.rowSize);
+ Assert.assertEquals(indices.size(), tablet.getRowSize());
- final long[] timestamps = Arrays.copyOfRange(tablet.timestamps, 0, tablet.rowSize);
+ final long[] timestamps = Arrays.copyOfRange(tablet.timestamps, 0, tablet.getRowSize());
for (int i = 0; i < 3; ++i) {
Assert.assertArrayEquals(
- timestamps, Arrays.copyOfRange((long[]) tablet.values[0], 0, tablet.rowSize));
+ timestamps, Arrays.copyOfRange((long[]) tablet.values[0], 0, tablet.getRowSize()));
}
- for (int i = 1; i < tablet.rowSize; ++i) {
+ for (int i = 1; i < tablet.getRowSize(); ++i) {
Assert.assertTrue(timestamps[i] > timestamps[i - 1]);
for (int j = 0; j < 3; ++j) {
Assert.assertTrue(((long[]) tablet.values[j])[i] > ((long[]) tablet.values[j])[i - 1]);
@@ -157,22 +157,22 @@ public class PipeTabletEventSorterTest {
Tablet tablet = new Tablet("root.sg.device", schemaList, 30);
for (long i = 0; i < 10; i++) {
- int rowIndex = tablet.rowSize++;
+ int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, (long) rowIndex + 2);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, (long) rowIndex + 2);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, (long) rowIndex + 2);
}
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, (long) rowIndex);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, (long) rowIndex);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, (long) rowIndex);
}
- rowIndex = tablet.rowSize++;
+ rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, (long) rowIndex - 2);
for (int s = 0; s < 3; s++) {
- tablet.addValue(schemaList.get(s).getMeasurementId(), rowIndex, (long) rowIndex - 2);
+ tablet.addValue(schemaList.get(s).getMeasurementName(), rowIndex, (long) rowIndex - 2);
}
}
@@ -183,13 +183,13 @@ public class PipeTabletEventSorterTest {
Assert.assertFalse(checkSorted(tablet));
- long[] timestamps = Arrays.copyOfRange(tablet.timestamps, 0, tablet.rowSize);
+ long[] timestamps = Arrays.copyOfRange(tablet.timestamps, 0, tablet.getRowSize());
for (int i = 0; i < 3; ++i) {
Assert.assertArrayEquals(
- timestamps, Arrays.copyOfRange((long[]) tablet.values[0], 0, tablet.rowSize));
+ timestamps, Arrays.copyOfRange((long[]) tablet.values[0], 0, tablet.getRowSize()));
}
- for (int i = 1; i < tablet.rowSize; ++i) {
+ for (int i = 1; i < tablet.getRowSize(); ++i) {
Assert.assertTrue(timestamps[i] != timestamps[i - 1]);
for (int j = 0; j < 3; ++j) {
Assert.assertTrue(((long[]) tablet.values[j])[i] != ((long[]) tablet.values[j])[i - 1]);
@@ -200,15 +200,15 @@ public class PipeTabletEventSorterTest {
Assert.assertTrue(checkSorted(tablet));
- Assert.assertEquals(indices.size(), tablet.rowSize);
+ Assert.assertEquals(indices.size(), tablet.getRowSize());
- timestamps = Arrays.copyOfRange(tablet.timestamps, 0, tablet.rowSize);
+ timestamps = Arrays.copyOfRange(tablet.timestamps, 0, tablet.getRowSize());
for (int i = 0; i < 3; ++i) {
Assert.assertArrayEquals(
- timestamps, Arrays.copyOfRange((long[]) tablet.values[0], 0, tablet.rowSize));
+ timestamps, Arrays.copyOfRange((long[]) tablet.values[0], 0, tablet.getRowSize()));
}
- for (int i = 1; i < tablet.rowSize; ++i) {
+ for (int i = 1; i < tablet.getRowSize(); ++i) {
Assert.assertTrue(timestamps[i] > timestamps[i - 1]);
for (int j = 0; j < 3; ++j) {
Assert.assertTrue(((long[]) tablet.values[j])[i] > ((long[]) tablet.values[j])[i - 1]);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/PipeTabletInsertionEventTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/PipeTabletInsertionEventTest.java
index f86b03116e4..dd3626b6fbc 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/PipeTabletInsertionEventTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/PipeTabletInsertionEventTest.java
@@ -216,7 +216,7 @@ public class PipeTabletInsertionEventTest {
tabletForInsertRowNode = new Tablet(deviceId, Arrays.asList(schemas), 1);
tabletForInsertRowNode.values = values;
tabletForInsertRowNode.timestamps = new long[] {times[0]};
- tabletForInsertRowNode.rowSize = 1;
+ tabletForInsertRowNode.setRowSize(1);
tabletForInsertRowNode.bitMaps = bitMapsForInsertRowNode;
// create tablet for insertTabletNode
@@ -252,7 +252,7 @@ public class PipeTabletInsertionEventTest {
tabletForInsertTabletNode = new Tablet(deviceId, Arrays.asList(schemas), times.length);
tabletForInsertTabletNode.values = values;
tabletForInsertTabletNode.timestamps = times;
- tabletForInsertTabletNode.rowSize = times.length;
+ tabletForInsertTabletNode.setRowSize(times.length);
tabletForInsertTabletNode.bitMaps = bitMapsForInsertTabletNode;
}
@@ -329,7 +329,7 @@ public class PipeTabletInsertionEventTest {
insertRowNode,
new PrefixTreePattern(pattern));
Tablet tablet1 = container1.convertToTablet();
- Assert.assertEquals(0, tablet1.rowSize);
+ Assert.assertEquals(0, tablet1.getRowSize());
boolean isAligned1 = container1.isAligned();
Assert.assertFalse(isAligned1);
@@ -340,7 +340,7 @@ public class PipeTabletInsertionEventTest {
insertRowNode,
new PrefixTreePattern(pattern));
Tablet tablet2 = container2.convertToTablet();
- Assert.assertEquals(1, tablet2.rowSize);
+ Assert.assertEquals(1, tablet2.getRowSize());
boolean isAligned2 = container2.isAligned();
Assert.assertFalse(isAligned2);
@@ -351,7 +351,7 @@ public class PipeTabletInsertionEventTest {
insertTabletNode,
new PrefixTreePattern(pattern));
Tablet tablet3 = container3.convertToTablet();
- Assert.assertEquals(3, tablet3.rowSize);
+ Assert.assertEquals(3, tablet3.getRowSize());
boolean isAligned3 = container3.isAligned();
Assert.assertFalse(isAligned3);
@@ -362,7 +362,7 @@ public class PipeTabletInsertionEventTest {
insertTabletNode,
new PrefixTreePattern(pattern));
Tablet tablet4 = container4.convertToTablet();
- Assert.assertEquals(0, tablet4.rowSize);
+ Assert.assertEquals(0, tablet4.getRowSize());
boolean isAligned4 = container4.isAligned();
Assert.assertFalse(isAligned4);
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/TsFileInsertionEventParserTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/TsFileInsertionEventParserTest.java
index 2b430c7487d..da87b705213 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/TsFileInsertionEventParserTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/event/TsFileInsertionEventParserTest.java
@@ -534,7 +534,6 @@ public class TsFileInsertionEventParserTest {
schemaList.add(new MeasurementSchema("s3", TSDataType.DATE));
final Tablet t = new Tablet("root.sg.d", schemaList, 1024);
- t.rowSize = 2;
t.addTimestamp(0, 1000);
t.addTimestamp(1, 2000);
t.addValue("s1", 0, 2L);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/resource/PipeTsFileResourceManagerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/resource/PipeTsFileResourceManagerTest.java
index ea12e41da20..a315285ad90 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/resource/PipeTsFileResourceManagerTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/resource/PipeTsFileResourceManagerTest.java
@@ -37,6 +37,7 @@ import org.apache.tsfile.write.record.TSRecord;
import org.apache.tsfile.write.record.datapoint.DataPoint;
import org.apache.tsfile.write.record.datapoint.FloatDataPoint;
import org.apache.tsfile.write.record.datapoint.IntDataPoint;
+import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.apache.tsfile.write.schema.Schema;
import org.junit.After;
@@ -79,6 +80,9 @@ public class PipeTsFileResourceManagerTest {
Schema schema = new Schema();
String template = "template";
+ IMeasurementSchema s1 = new MeasurementSchema("sensor1", TSDataType.FLOAT, TSEncoding.RLE);
+ IMeasurementSchema s2 = new MeasurementSchema("sensor2", TSDataType.INT32, TSEncoding.TS_2DIFF);
+ IMeasurementSchema s3 = new MeasurementSchema("sensor3", TSDataType.INT32, TSEncoding.TS_2DIFF);
schema.extendTemplate(
template, new MeasurementSchema("sensor1", TSDataType.FLOAT, TSEncoding.RLE));
schema.extendTemplate(
@@ -87,41 +91,44 @@ public class PipeTsFileResourceManagerTest {
template, new MeasurementSchema("sensor3", TSDataType.INT32, TSEncoding.TS_2DIFF));
TsFileWriter tsFileWriter = new TsFileWriter(file, schema);
+ tsFileWriter.registerDevice("root.lemming.device1", template);
+ tsFileWriter.registerDevice("root.lemming.device2", template);
+ tsFileWriter.registerDevice("root.lemming.device3", template);
// construct TSRecord
- TSRecord tsRecord = new TSRecord(1617206403001L, "root.lemming.device1");
+ TSRecord tsRecord = new TSRecord("root.lemming.device1", 1617206403001L);
DataPoint dPoint1 = new FloatDataPoint("sensor1", 1.1f);
DataPoint dPoint2 = new IntDataPoint("sensor2", 12);
DataPoint dPoint3 = new IntDataPoint("sensor3", 13);
tsRecord.addTuple(dPoint1);
tsRecord.addTuple(dPoint2);
tsRecord.addTuple(dPoint3);
- tsFileWriter.write(tsRecord);
- tsFileWriter.flushAllChunkGroups(); // flush above data to disk at once
+ tsFileWriter.writeRecord(tsRecord);
+ tsFileWriter.flush(); // flush above data to disk at once
- tsRecord = new TSRecord(1617206403002L, "root.lemming.device2");
+ tsRecord = new TSRecord("root.lemming.device2", 1617206403002L);
dPoint2 = new IntDataPoint("sensor2", 22);
tsRecord.addTuple(dPoint2);
- tsFileWriter.write(tsRecord);
- tsFileWriter.flushAllChunkGroups(); // flush above data to disk at once
+ tsFileWriter.writeRecord(tsRecord);
+ tsFileWriter.flush(); // flush above data to disk at once
- tsRecord = new TSRecord(1617206403003L, "root.lemming.device3");
+ tsRecord = new TSRecord("root.lemming.device3", 1617206403003L);
dPoint1 = new FloatDataPoint("sensor1", 3.1f);
dPoint2 = new IntDataPoint("sensor2", 32);
tsRecord.addTuple(dPoint1);
tsRecord.addTuple(dPoint2);
- tsFileWriter.write(tsRecord);
- tsFileWriter.flushAllChunkGroups(); // flush above data to disk at once
+ tsFileWriter.writeRecord(tsRecord);
+ tsFileWriter.flush(); // flush above data to disk at once
- tsRecord = new TSRecord(1617206403004L, "root.lemming.device1");
+ tsRecord = new TSRecord("root.lemming.device1", 1617206403004L);
dPoint1 = new FloatDataPoint("sensor1", 4.1f);
dPoint2 = new IntDataPoint("sensor2", 42);
dPoint3 = new IntDataPoint("sensor3", 43);
tsRecord.addTuple(dPoint1);
tsRecord.addTuple(dPoint2);
tsRecord.addTuple(dPoint3);
- tsFileWriter.write(tsRecord);
- tsFileWriter.flushAllChunkGroups(); // flush above data to disk at once
+ tsFileWriter.writeRecord(tsRecord);
+ tsFileWriter.flush(); // flush above data to disk at once
// close TsFile
tsFileWriter.close();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTreeTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTreeTest.java
index 60d1914ec9f..4642c69721f 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTreeTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTreeTest.java
@@ -709,7 +709,7 @@ public class ClusterSchemaTreeTest {
Assert.assertEquals(
measurements,
deviceSchemaInfo.getMeasurementSchemaList().stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()));
devicePath = new PartialPath("root.sg.d2.a");
@@ -722,7 +722,7 @@ public class ClusterSchemaTreeTest {
Assert.assertEquals(
measurements,
deviceSchemaInfo.getMeasurementSchemaList().stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()));
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesAggregationScanOperatorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesAggregationScanOperatorTest.java
index 2f38887e78e..79af612f7f6 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesAggregationScanOperatorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesAggregationScanOperatorTest.java
@@ -717,7 +717,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
IDeviceID.Factory.DEFAULT_FACTORY.create(
SERIES_AGGREGATION_SCAN_OPERATOR_TEST_SG + ".device0"),
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()),
new ArrayList<>(measurementSchemas));
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesScanOperatorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesScanOperatorTest.java
index 728a55d4e5c..ee3c544656b 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesScanOperatorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesScanOperatorTest.java
@@ -105,7 +105,7 @@ public class AlignedSeriesScanOperatorTest {
new AlignedFullPath(
IDeviceID.Factory.DEFAULT_FACTORY.create(SERIES_SCAN_OPERATOR_TEST_SG + ".device0"),
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()),
measurementSchemas.stream()
.map(m -> (IMeasurementSchema) m)
@@ -185,7 +185,7 @@ public class AlignedSeriesScanOperatorTest {
new AlignedFullPath(
IDeviceID.Factory.DEFAULT_FACTORY.create(SERIES_SCAN_OPERATOR_TEST_SG + ".device0"),
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()),
measurementSchemas.stream()
.map(m -> (IMeasurementSchema) m)
@@ -237,7 +237,7 @@ public class AlignedSeriesScanOperatorTest {
new AlignedFullPath(
IDeviceID.Factory.DEFAULT_FACTORY.create(SERIES_SCAN_OPERATOR_TEST_SG + ".device1"),
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()),
measurementSchemas.stream()
.map(m -> (IMeasurementSchema) m)
@@ -492,7 +492,7 @@ public class AlignedSeriesScanOperatorTest {
new AlignedFullPath(
IDeviceID.Factory.DEFAULT_FACTORY.create(SERIES_SCAN_OPERATOR_TEST_SG + ".device0"),
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()),
measurementSchemas.stream()
.map(m -> (IMeasurementSchema) m)
@@ -544,7 +544,7 @@ public class AlignedSeriesScanOperatorTest {
new AlignedFullPath(
IDeviceID.Factory.DEFAULT_FACTORY.create(SERIES_SCAN_OPERATOR_TEST_SG + ".device1"),
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList()),
measurementSchemas.stream()
.map(m -> (IMeasurementSchema) m)
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesTestUtil.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesTestUtil.java
index 0ce6867bab4..27efe831034 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesTestUtil.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AlignedSeriesTestUtil.java
@@ -146,35 +146,35 @@ public class AlignedSeriesTestUtil {
fileWriter.registerTimeseries(new Path(device2), measurementSchemas);
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
- TSRecord record = new TSRecord(i, device0);
+ TSRecord record = new TSRecord(device0, i);
int index = 0;
for (IMeasurementSchema measurementSchema : measurementSchemas) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchema.getType(),
- measurementSchema.getMeasurementId(),
+ measurementSchema.getMeasurementName(),
index == 0
? String.valueOf((i + valueOffset) % 2 == 0)
: String.valueOf((i + valueOffset))));
index++;
}
- fileWriter.writeAligned(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(device0), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(device0), i);
record.deviceId = IDeviceID.Factory.DEFAULT_FACTORY.create(device1);
- fileWriter.writeAligned(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(device1), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(device1), i);
record.deviceId = IDeviceID.Factory.DEFAULT_FACTORY.create(device2);
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(device2), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(device2), i);
long flushInterval = 20;
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
fileWriter.close();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/schema/SchemaFetchScanOperatorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/schema/SchemaFetchScanOperatorTest.java
index 0aea6894602..4c08373acba 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/schema/SchemaFetchScanOperatorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/schema/SchemaFetchScanOperatorTest.java
@@ -90,7 +90,7 @@ public class SchemaFetchScanOperatorTest {
Assert.assertEquals(
Arrays.asList("s1", "s2"),
measurementSchemaList.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.sorted()
.collect(Collectors.toList()));
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGeneratorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGeneratorTest.java
index b8b865f8aa1..968db18a065 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGeneratorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGeneratorTest.java
@@ -213,9 +213,11 @@ public class StatementGeneratorTest {
public void testInsertRelationalTablet() throws IllegalPathException {
List<String> measurements = Arrays.asList("id1", "attr1", "m1");
List<TSDataType> dataTypes = Arrays.asList(TSDataType.TEXT, TSDataType.TEXT, TSDataType.DOUBLE);
- List<Tablet.ColumnType> tsfileColumnCategories =
+ List<Tablet.ColumnCategory> tsfileColumnCategories =
Arrays.asList(
- Tablet.ColumnType.ID, Tablet.ColumnType.ATTRIBUTE, Tablet.ColumnType.MEASUREMENT);
+ Tablet.ColumnCategory.ID,
+ Tablet.ColumnCategory.ATTRIBUTE,
+ Tablet.ColumnCategory.MEASUREMENT);
List<TsTableColumnCategory> columnCategories =
tsfileColumnCategories.stream()
.map(TsTableColumnCategory::fromTsFileColumnType)
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/logical/RegionScanLogicalPlannerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/logical/RegionScanLogicalPlannerTest.java
index c73e045b962..ec994531475 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/logical/RegionScanLogicalPlannerTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/logical/RegionScanLogicalPlannerTest.java
@@ -24,6 +24,8 @@ import org.apache.iotdb.commons.path.AlignedPath;
import org.apache.iotdb.commons.path.MeasurementPath;
import org.apache.iotdb.commons.path.PartialPath;
import org.apache.iotdb.commons.schema.SchemaConstant;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.queryengine.common.DeviceContext;
import org.apache.iotdb.db.queryengine.common.QueryId;
import org.apache.iotdb.db.queryengine.common.TimeseriesContext;
@@ -52,6 +54,7 @@ public class RegionScanLogicalPlannerTest {
private static Map<PartialPath, Map<PartialPath, List<TimeseriesContext>>>
deviceToTimeseriesSchemaInfoMap;
+ private static IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
private static Map<PartialPath, Map<PartialPath, List<TimeseriesContext>>>
getDeviceToTimeseriesSchemaInfoMap() throws IllegalPathException {
@@ -66,17 +69,38 @@ public class RegionScanLogicalPlannerTest {
new MeasurementPath("root.sg.d1.s1", TSDataType.INT32),
Collections.singletonList(
new TimeseriesContext(
- "INT32", null, "PLAIN", "LZ4", "{\"key1\":\"value1\"}", null, null, null)));
+ "INT32",
+ null,
+ config.getDefaultInt32Encoding().toString(),
+ "LZ4",
+ "{\"key1\":\"value1\"}",
+ null,
+ null,
+ null)));
timeseriesSchemaInfoMap.put(
new MeasurementPath("root.sg.d1.s2", TSDataType.DOUBLE),
Collections.singletonList(
new TimeseriesContext(
- "DOUBLE", "status", "PLAIN", "LZ4", "{\"key1\":\"value1\"}", null, null, null)));
+ "DOUBLE",
+ "status",
+ config.getDefaultDoubleEncoding().toString(),
+ "LZ4",
+ "{\"key1\":\"value1\"}",
+ null,
+ null,
+ null)));
timeseriesSchemaInfoMap.put(
new MeasurementPath("root.sg.d1.s3", TSDataType.BOOLEAN),
Collections.singletonList(
new TimeseriesContext(
- "BOOLEAN", null, "PLAIN", "LZ4", "{\"key1\":\"value2\"}", null, null, null)));
+ "BOOLEAN",
+ null,
+ config.getDefaultBooleanEncoding().toString(),
+ "LZ4",
+ "{\"key1\":\"value2\"}",
+ null,
+ null,
+ null)));
deviceToTimeseriesSchemaInfoMap.put(new PartialPath("root.sg.d1"), timeseriesSchemaInfoMap);
Map<PartialPath, List<TimeseriesContext>> timeseriesSchemaInfoMap2 = new HashMap<>();
@@ -84,17 +108,38 @@ public class RegionScanLogicalPlannerTest {
new MeasurementPath("root.sg.d2.s1", TSDataType.INT32),
Collections.singletonList(
new TimeseriesContext(
- "INT32", null, "PLAIN", "LZ4", "{\"key1\":\"value1\"}", null, null, null)));
+ "INT32",
+ null,
+ config.getDefaultInt32Encoding().toString(),
+ "LZ4",
+ "{\"key1\":\"value1\"}",
+ null,
+ null,
+ null)));
timeseriesSchemaInfoMap2.put(
new MeasurementPath("root.sg.d2.s2", TSDataType.DOUBLE),
Collections.singletonList(
new TimeseriesContext(
- "DOUBLE", "status", "PLAIN", "LZ4", "{\"key1\":\"value1\"}", null, null, null)));
+ "DOUBLE",
+ "status",
+ config.getDefaultDoubleEncoding().toString(),
+ "LZ4",
+ "{\"key1\":\"value1\"}",
+ null,
+ null,
+ null)));
timeseriesSchemaInfoMap2.put(
new MeasurementPath("root.sg.d2.s4", TSDataType.TEXT),
Collections.singletonList(
new TimeseriesContext(
- "TEXT", null, "PLAIN", "LZ4", "{\"key2\":\"value1\"}", null, null, null)));
+ "TEXT",
+ null,
+ config.getDefaultTextEncoding().toString(),
+ "LZ4",
+ "{\"key2\":\"value1\"}",
+ null,
+ null,
+ null)));
deviceToTimeseriesSchemaInfoMap.put(new PartialPath("root.sg.d2"), timeseriesSchemaInfoMap2);
List<String> schemas = new ArrayList<>();
@@ -104,10 +149,24 @@ public class RegionScanLogicalPlannerTest {
Map<PartialPath, List<TimeseriesContext>> timeseriesSchemaInfoMap3 = new HashMap<>();
timeseriesContextList.add(
new TimeseriesContext(
- "INT32", null, "PLAIN", "LZ4", "{\"key1\":\"value1\"}", null, null, null));
+ "INT32",
+ null,
+ config.getDefaultInt32Encoding().toString(),
+ "LZ4",
+ "{\"key1\":\"value1\"}",
+ null,
+ null,
+ null));
timeseriesContextList.add(
new TimeseriesContext(
- "DOUBLE", "status", "PLAIN", "LZ4", "{\"key1\":\"value1\"}", null, null, null));
+ "DOUBLE",
+ "status",
+ config.getDefaultDoubleEncoding().toString(),
+ "LZ4",
+ "{\"key1\":\"value1\"}",
+ null,
+ null,
+ null));
timeseriesSchemaInfoMap3.put(
new AlignedPath("root.sg.d2.a", schemas, Collections.emptyList()), timeseriesContextList);
deviceToTimeseriesSchemaInfoMap.put(new PartialPath("root.sg.d2.a"), timeseriesSchemaInfoMap3);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/BloomFilterCacheTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/BloomFilterCacheTest.java
index 1758be2d43e..a6c1fd0afde 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/BloomFilterCacheTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/BloomFilterCacheTest.java
@@ -214,21 +214,21 @@ public class BloomFilterCacheTest {
long timestamp = 1;
long value = 1000000L;
for (int r = 0; r < rowNum; r++, value++) {
- int row = tablet.rowSize++;
- timestamps[row] = timestamp++;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, timestamp++);
for (int i = 0; i < sensorNum; i++) {
long[] sensor = (long[]) values[i];
sensor[row] = value;
}
// write Tablet to TsFile
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
- tsFileWriter.write(tablet);
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
+ tsFileWriter.writeTree(tablet);
tablet.reset();
}
}
// write Tablet to TsFile
- if (tablet.rowSize != 0) {
- tsFileWriter.write(tablet);
+ if (tablet.getRowSize() != 0) {
+ tsFileWriter.writeTree(tablet);
tablet.reset();
}
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/ChunkCacheTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/ChunkCacheTest.java
index 0477b1bf027..8f4fc0784a3 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/ChunkCacheTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/ChunkCacheTest.java
@@ -181,20 +181,20 @@ public class ChunkCacheTest {
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i + valueOffset)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
}
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
fileWriter.close();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/DataRegionTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/DataRegionTest.java
index 9367bb91a8a..ddce03e6833 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/DataRegionTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/DataRegionTest.java
@@ -187,20 +187,20 @@ public class DataRegionTest {
@Test
public void testUnseqUnsealedDelete()
throws WriteProcessException, IOException, MetadataException {
- TSRecord record = new TSRecord(10000, deviceId);
+ TSRecord record = new TSRecord(deviceId, 10000);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
for (int j = 1; j <= 10; j++) {
- record = new TSRecord(j, deviceId);
+ record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
dataRegion.syncCloseWorkingTsFileProcessors(false);
for (int j = 11; j <= 20; j++) {
- record = new TSRecord(j, deviceId);
+ record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
@@ -246,7 +246,7 @@ public class DataRegionTest {
public void testSequenceSyncClose()
throws WriteProcessException, QueryProcessException, IllegalPathException {
for (int j = 1; j <= 10; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
@@ -670,14 +670,14 @@ public class DataRegionTest {
public void testSeqAndUnSeqSyncClose()
throws WriteProcessException, QueryProcessException, IllegalPathException {
for (int j = 21; j <= 30; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
}
for (int j = 10; j >= 1; j--) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
@@ -700,7 +700,7 @@ public class DataRegionTest {
public void testAllMeasurementsFailedRecordSeqAndUnSeqSyncClose()
throws WriteProcessException, QueryProcessException, IllegalPathException {
for (int j = 21; j <= 30; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
InsertRowNode rowNode = buildInsertRowNodeByTSRecord(record);
rowNode.setFailedMeasurementNumber(1);
@@ -709,7 +709,7 @@ public class DataRegionTest {
}
for (int j = 10; j >= 1; j--) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
InsertRowNode rowNode = buildInsertRowNodeByTSRecord(record);
rowNode.setFailedMeasurementNumber(1);
@@ -737,14 +737,14 @@ public class DataRegionTest {
config.setEnableSeparateData(false);
for (int j = 21; j <= 30; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
}
for (int j = 10; j >= 1; j--) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
@@ -1019,7 +1019,7 @@ public class DataRegionTest {
List<Integer> indexList = new ArrayList<>();
List<InsertRowNode> nodes = new ArrayList<>();
for (int i = 0; i < 4; i++) {
- TSRecord record = new TSRecord(time[i], "root.Rows");
+ TSRecord record = new TSRecord("root.Rows", time[i]);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(i)));
nodes.add(buildInsertRowNodeByTSRecord(record));
indexList.add(i);
@@ -1059,7 +1059,7 @@ public class DataRegionTest {
DataRegion dataRegion1 = new DummyDataRegion(systemDir, "root.ln22");
for (int j = 21; j <= 30; j++) {
- TSRecord record = new TSRecord(j, "root.ln22");
+ TSRecord record = new TSRecord("root.ln22", j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion1.insert(buildInsertRowNodeByTSRecord(record));
dataRegion1.syncCloseAllWorkingTsFileProcessors();
@@ -1106,7 +1106,7 @@ public class DataRegionTest {
long finishedCompactionTaskNumWhenTestStart =
CompactionTaskManager.getInstance().getFinishedTaskNum();
for (int j = 21; j <= 30; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
@@ -1114,7 +1114,7 @@ public class DataRegionTest {
dataRegion.syncCloseAllWorkingTsFileProcessors();
for (int j = 10; j >= 1; j--) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
@@ -1171,7 +1171,7 @@ public class DataRegionTest {
IoTDBDescriptor.getInstance().getConfig().setInnerCompactionCandidateFileNum(10);
try {
for (int j = 0; j < 10; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
@@ -1228,7 +1228,7 @@ public class DataRegionTest {
public void testTimedFlushSeqMemTable()
throws IllegalPathException, InterruptedException, WriteProcessException, ShutdownException {
// create one sequence memtable
- TSRecord record = new TSRecord(10000, deviceId);
+ TSRecord record = new TSRecord(deviceId, 10000);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
Assert.assertEquals(1, MemTableManager.getInstance().getCurrentMemtableNumber());
@@ -1277,7 +1277,7 @@ public class DataRegionTest {
public void testTimedFlushUnseqMemTable()
throws IllegalPathException, InterruptedException, WriteProcessException, ShutdownException {
// create one sequence memtable & close
- TSRecord record = new TSRecord(10000, deviceId);
+ TSRecord record = new TSRecord(deviceId, 10000);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
Assert.assertEquals(1, MemTableManager.getInstance().getCurrentMemtableNumber());
@@ -1285,7 +1285,7 @@ public class DataRegionTest {
Assert.assertEquals(0, MemTableManager.getInstance().getCurrentMemtableNumber());
// create one unsequence memtable
- record = new TSRecord(1, deviceId);
+ record = new TSRecord(deviceId, 1);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
Assert.assertEquals(1, MemTableManager.getInstance().getCurrentMemtableNumber());
@@ -1343,7 +1343,7 @@ public class DataRegionTest {
if (i % 2 == 0) {
for (int d = 0; d < 2; d++) {
for (int count = i * 100; count < i * 100 + 100; count++) {
- TSRecord record = new TSRecord(count, "root.vehicle.d" + d);
+ TSRecord record = new TSRecord("root.vehicle.d" + d, count);
record.addTuple(
DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(count)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
@@ -1352,7 +1352,7 @@ public class DataRegionTest {
} else {
for (int d = 0; d < 3; d++) {
for (int count = i * 100; count < i * 100 + 100; count++) {
- TSRecord record = new TSRecord(count, "root.vehicle.d" + d);
+ TSRecord record = new TSRecord("root.vehicle.d" + d, count);
record.addTuple(
DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(count)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
@@ -1410,7 +1410,7 @@ public class DataRegionTest {
public void testDeleteDataNotInFlushingMemtable()
throws IllegalPathException, WriteProcessException, IOException {
for (int j = 0; j < 100; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
@@ -1440,7 +1440,7 @@ public class DataRegionTest {
public void testDeleteDataInSeqFlushingMemtable()
throws IllegalPathException, WriteProcessException, IOException {
for (int j = 100; j < 200; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
@@ -1483,7 +1483,7 @@ public class DataRegionTest {
public void testDeleteDataInUnSeqFlushingMemtable()
throws IllegalPathException, WriteProcessException, IOException {
for (int j = 100; j < 200; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
@@ -1520,7 +1520,7 @@ public class DataRegionTest {
// insert unseq data points
for (int j = 50; j < 100; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
@@ -1578,12 +1578,12 @@ public class DataRegionTest {
public void testDeleteDataInSeqWorkingMemtable()
throws IllegalPathException, WriteProcessException, IOException {
for (int j = 100; j < 200; j++) {
- TSRecord record = new TSRecord(j, "root.vehicle.d0");
+ TSRecord record = new TSRecord("root.vehicle.d0", j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
for (int j = 100; j < 200; j++) {
- TSRecord record = new TSRecord(j, "root.vehicle.d199");
+ TSRecord record = new TSRecord("root.vehicle.d199", j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
@@ -1620,7 +1620,7 @@ public class DataRegionTest {
public void testFlushingEmptyMemtable()
throws IllegalPathException, WriteProcessException, IOException {
for (int j = 100; j < 200; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
@@ -1660,7 +1660,7 @@ public class DataRegionTest {
public void testDeleteDataDirectlySeqWriteModsOrDeleteFiles()
throws IllegalPathException, WriteProcessException, IOException {
for (int j = 100; j < 200; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
@@ -1698,14 +1698,14 @@ public class DataRegionTest {
public void testDeleteDataDirectlyUnseqWriteModsOrDeleteFiles()
throws IllegalPathException, WriteProcessException, IOException {
for (int j = 100; j < 200; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
TsFileResource tsFileResourceSeq = dataRegion.getTsFileManager().getTsFileList(true).get(0);
dataRegion.syncCloseAllWorkingTsFileProcessors();
for (int j = 30; j < 100; j++) {
- TSRecord record = new TSRecord(j, deviceId);
+ TSRecord record = new TSRecord(deviceId, j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(buildInsertRowNodeByTSRecord(record));
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
index 397ed6037ac..d14d1f27a40 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
@@ -72,18 +72,18 @@ public class LastFlushTimeMapTest {
@Test
public void testDeviceLastFlushTimeMap()
throws IOException, IllegalPathException, WriteProcessException {
- TSRecord record = new TSRecord(10000, "root.vehicle.d0");
+ TSRecord record = new TSRecord("root.vehicle.d0", 10000);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
- record = new TSRecord(9999, "root.vehicle.d1");
+ record = new TSRecord("root.vehicle.d1", 9999);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
for (int j = 1; j <= 10; j++) {
- record = new TSRecord(j, "root.vehicle.d0");
+ record = new TSRecord("root.vehicle.d0", j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
}
@@ -99,18 +99,18 @@ public class LastFlushTimeMapTest {
@Test
public void testPartitionLastFlushTimeMap()
throws IOException, IllegalPathException, WriteProcessException {
- TSRecord record = new TSRecord(10000, "root.vehicle.d0");
+ TSRecord record = new TSRecord("root.vehicle.d0", 10000);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
- record = new TSRecord(9999, "root.vehicle.d1");
+ record = new TSRecord("root.vehicle.d1", 9999);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
for (int j = 1; j <= 10; j++) {
- record = new TSRecord(j, "root.vehicle.d0");
+ record = new TSRecord("root.vehicle.d0", j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
}
@@ -142,18 +142,18 @@ public class LastFlushTimeMapTest {
@Test
public void testRecoverLastFlushTimeMap()
throws IOException, IllegalPathException, WriteProcessException, DataRegionException {
- TSRecord record = new TSRecord(604_800_000, "root.vehicle.d0");
+ TSRecord record = new TSRecord("root.vehicle.d0", 604_800_000);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
- record = new TSRecord(604_799_999, "root.vehicle.d0");
+ record = new TSRecord("root.vehicle.d0", 604_799_999);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(1000)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
dataRegion.syncCloseAllWorkingTsFileProcessors();
for (int j = 1; j <= 10; j++) {
- record = new TSRecord(j, "root.vehicle.d0");
+ record = new TSRecord("root.vehicle.d0", j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
}
@@ -198,7 +198,7 @@ public class LastFlushTimeMapTest {
+ File.separator
+ "0";
for (int j = 1; j <= 10; j++) {
- TSRecord record = new TSRecord(j, "root.vehicle.d0");
+ TSRecord record = new TSRecord("root.vehicle.d0", j);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/AbstractCompactionTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/AbstractCompactionTest.java
index ee06ffefb18..6e301f662a5 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/AbstractCompactionTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/AbstractCompactionTest.java
@@ -855,7 +855,7 @@ public class AbstractCompactionTest {
}
List<String> existedMeasurements =
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList());
IFullPath seriesPath;
if (isAlign) {
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionDataTypeNotMatchTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionDataTypeNotMatchTest.java
index e9a33edcdf4..4e7810b65e4 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionDataTypeNotMatchTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionDataTypeNotMatchTest.java
@@ -145,10 +145,10 @@ public class CompactionDataTypeNotMatchTest extends AbstractCompactionTest {
resource1.setStatusForTest(TsFileResourceStatus.COMPACTING);
try (TsFileWriter writer = new TsFileWriter(resource1.getTsFile())) {
writer.registerTimeseries(new Path(device), measurementSchema1);
- TSRecord record = new TSRecord(1, device);
+ TSRecord record = new TSRecord(device, 1);
record.addTuple(new BooleanDataPoint("s1", true));
- writer.write(record);
- writer.flushAllChunkGroups();
+ writer.writeRecord(record);
+ writer.flush();
}
resource1.updateStartTime(device, 1);
resource1.updateEndTime(device, 1);
@@ -160,10 +160,10 @@ public class CompactionDataTypeNotMatchTest extends AbstractCompactionTest {
resource2.setStatusForTest(TsFileResourceStatus.COMPACTING);
try (TsFileWriter writer = new TsFileWriter(resource2.getTsFile())) {
writer.registerTimeseries(new Path(device), measurementSchema2);
- TSRecord record = new TSRecord(2, device);
+ TSRecord record = new TSRecord(device, 2);
record.addTuple(new IntDataPoint("s1", 10));
- writer.write(record);
- writer.flushAllChunkGroups();
+ writer.writeRecord(record);
+ writer.flush();
}
resource2.updateStartTime(device, 2);
resource2.updateEndTime(device, 2);
@@ -181,11 +181,11 @@ public class CompactionDataTypeNotMatchTest extends AbstractCompactionTest {
resource1.setStatusForTest(TsFileResourceStatus.COMPACTING);
try (TsFileWriter writer = new TsFileWriter(resource1.getTsFile())) {
writer.registerAlignedTimeseries(new Path(device), measurementSchemas1);
- TSRecord record = new TSRecord(1, device);
+ TSRecord record = new TSRecord(device, 1);
record.addTuple(new IntDataPoint("s1", 0));
record.addTuple(new IntDataPoint("s2", 1));
- writer.writeAligned(record);
- writer.flushAllChunkGroups();
+ writer.writeRecord(record);
+ writer.flush();
}
resource1.updateStartTime(device, 1);
resource1.updateEndTime(device, 1);
@@ -199,11 +199,11 @@ public class CompactionDataTypeNotMatchTest extends AbstractCompactionTest {
resource2.setStatusForTest(TsFileResourceStatus.COMPACTING);
try (TsFileWriter writer = new TsFileWriter(resource2.getTsFile())) {
writer.registerAlignedTimeseries(new Path(device), measurementSchemas2);
- TSRecord record = new TSRecord(2, device);
+ TSRecord record = new TSRecord(device, 2);
record.addTuple(new BooleanDataPoint("s1", true));
record.addTuple(new BooleanDataPoint("s2", true));
- writer.writeAligned(record);
- writer.flushAllChunkGroups();
+ writer.writeRecord(record);
+ writer.flush();
}
resource2.updateStartTime(device, 2);
resource2.updateEndTime(device, 2);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionValidationTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionValidationTest.java
index 172cd1d80d5..53469ed80b7 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionValidationTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionValidationTest.java
@@ -105,21 +105,21 @@ public class CompactionValidationTest {
long sensorNum = schemas.size();
for (long r = 0; r < rowNum; r++, startValue++) {
- int row = tablet.rowSize++;
- timestamps[row] = startTime++;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, startTime++);
for (int i = 0; i < sensorNum; i++) {
Binary[] textSensor = (Binary[]) values[i];
textSensor[row] = new Binary("testString.........", TSFileConfig.STRING_CHARSET);
}
// write
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
- tsFileWriter.write(tablet);
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
+ tsFileWriter.writeTree(tablet);
tablet.reset();
}
}
// write
- if (tablet.rowSize != 0) {
- tsFileWriter.write(tablet);
+ if (tablet.getRowSize() != 0) {
+ tsFileWriter.writeTree(tablet);
tablet.reset();
}
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/MergeTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/MergeTest.java
index f3f37c6b573..629fc5500e7 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/MergeTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/MergeTest.java
@@ -160,20 +160,20 @@ abstract class MergeTest {
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j].toString());
+ TSRecord record = new TSRecord(deviceIds[j].toString(), i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i + valueOffset)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(deviceIds[j], i);
tsFileResource.updateEndTime(deviceIds[j], i);
}
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
fileWriter.close();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/MergeUpgradeTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/MergeUpgradeTest.java
index 0a1d5b02f7e..326a2c815a8 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/MergeUpgradeTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/MergeUpgradeTest.java
@@ -184,15 +184,15 @@ public class MergeUpgradeTest {
fileWriter.registerTimeseries(new Path(deviceName), MeasurementSchema);
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
- TSRecord record = new TSRecord(i, deviceName);
+ TSRecord record = new TSRecord(deviceName, i);
for (int k = 0; k < timeseriesNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i + valueOffset)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceName), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceName), i);
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/RewriteCompactionFileSelectorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/RewriteCompactionFileSelectorTest.java
index 16ca83ccc16..e67ba538da9 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/RewriteCompactionFileSelectorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/RewriteCompactionFileSelectorTest.java
@@ -774,21 +774,21 @@ public class RewriteCompactionFileSelectorTest extends MergeTest {
if (j == 3 && i > 5) {
continue;
}
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; ++k) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
firstTsFileResource.updateStartTime(deviceIds[j], i);
firstTsFileResource.updateEndTime(deviceIds[j], i);
}
}
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
fileWriter.close();
// second file time range: [11, 20]
@@ -823,20 +823,20 @@ public class RewriteCompactionFileSelectorTest extends MergeTest {
}
for (long i = 11; i < 21; ++i) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
secondTsFileResource.updateStartTime(deviceIds[j], i);
secondTsFileResource.updateEndTime(deviceIds[j], i);
}
}
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
fileWriter.close();
// unseq file: [0, 1]
@@ -869,20 +869,20 @@ public class RewriteCompactionFileSelectorTest extends MergeTest {
}
for (long i = 0; i < 2; ++i) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
thirdTsFileResource.updateStartTime(deviceIds[j], i);
thirdTsFileResource.updateEndTime(deviceIds[j], i);
}
}
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
fileWriter.close();
// unseq file: [6, 14]
@@ -918,31 +918,31 @@ public class RewriteCompactionFileSelectorTest extends MergeTest {
if (j == 3) {
continue;
}
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
fourthTsFileResource.updateStartTime(deviceIds[j], i);
fourthTsFileResource.updateEndTime(deviceIds[j], i);
}
}
- TSRecord record = new TSRecord(1, deviceIds[3]);
+ TSRecord record = new TSRecord(deviceIds[3], 1);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(1)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
fourthTsFileResource.updateStartTime(deviceIds[3], 1);
fourthTsFileResource.updateEndTime(deviceIds[3], 1);
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
fileWriter.close();
long origin = SystemInfo.getInstance().getMemorySizeForCompaction();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/AbstractInnerSpaceCompactionTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/AbstractInnerSpaceCompactionTest.java
index 0632a09a344..5afc86221c9 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/AbstractInnerSpaceCompactionTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/AbstractInnerSpaceCompactionTest.java
@@ -198,20 +198,20 @@ public abstract class AbstractInnerSpaceCompactionTest {
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i + valueOffset)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
}
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/FastCompactionPerformerAlignedTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/FastCompactionPerformerAlignedTest.java
index 8941117f1b7..da9712f5ceb 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/FastCompactionPerformerAlignedTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/FastCompactionPerformerAlignedTest.java
@@ -133,7 +133,7 @@ public class FastCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -207,7 +207,7 @@ public class FastCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -273,7 +273,7 @@ public class FastCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -342,7 +342,7 @@ public class FastCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -409,7 +409,7 @@ public class FastCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -478,7 +478,7 @@ public class FastCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -548,7 +548,7 @@ public class FastCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -629,7 +629,7 @@ public class FastCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/FastCompactionPerformerNoAlignedTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/FastCompactionPerformerNoAlignedTest.java
index 22274152710..1b8c3f0c1cf 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/FastCompactionPerformerNoAlignedTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/FastCompactionPerformerNoAlignedTest.java
@@ -155,7 +155,7 @@ public class FastCompactionPerformerNoAlignedTest {
}
for (PartialPath device : devicePath) {
for (IMeasurementSchema schema : schemas) {
- fullPathSet.add(device.getFullPath() + "." + schema.getMeasurementId());
+ fullPathSet.add(device.getFullPath() + "." + schema.getMeasurementName());
paths.add(new NonAlignedFullPath(device.getIDeviceIDAsFullDevice(), schema));
schemaList.add(schema);
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerCompactionMoreDataTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerCompactionMoreDataTest.java
index 2f8960b8fa2..94da9429770 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerCompactionMoreDataTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerCompactionMoreDataTest.java
@@ -113,20 +113,20 @@ public class InnerCompactionMoreDataTest extends InnerCompactionTest {
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i + valueOffset + k)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
}
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
fileWriter.close();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerCompactionTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerCompactionTest.java
index 6b14eb84813..c6bc1778684 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerCompactionTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerCompactionTest.java
@@ -180,20 +180,20 @@ public abstract class InnerCompactionTest {
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i + valueOffset)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
}
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
fileWriter.close();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerSpaceCompactionExceptionTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerSpaceCompactionExceptionTest.java
index 5df2b8d57e3..9e93ac5c8f1 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerSpaceCompactionExceptionTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerSpaceCompactionExceptionTest.java
@@ -306,7 +306,7 @@ public class InnerSpaceCompactionExceptionTest extends AbstractInnerSpaceCompact
for (int i = 0; i < seqResources.size(); i++) {
Map<String, Pair<Long, Long>> deleteMap = new HashMap<>();
deleteMap.put(
- deviceIds[0] + "." + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + "." + measurementSchemas[0].getMeasurementName(),
new Pair<>(i * ptNum, i * ptNum + 10));
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), true);
}
@@ -333,7 +333,7 @@ public class InnerSpaceCompactionExceptionTest extends AbstractInnerSpaceCompact
Assert.assertEquals(seqResources.size(), modifications.size());
for (ModEntry modification : modifications) {
Assert.assertEquals(
- deviceIds[0] + PATH_SEPARATOR + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + PATH_SEPARATOR + measurementSchemas[0].getMeasurementName(),
((TreeDeletionEntry) modification).getPathPattern().getFullPath());
}
@@ -371,7 +371,7 @@ public class InnerSpaceCompactionExceptionTest extends AbstractInnerSpaceCompact
for (int i = 0; i < seqResources.size(); i++) {
Map<String, Pair<Long, Long>> deleteMap = new HashMap<>();
deleteMap.put(
- deviceIds[0] + "." + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + "." + measurementSchemas[0].getMeasurementName(),
new Pair<>(i * ptNum, i * ptNum + 10));
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), false);
}
@@ -435,7 +435,7 @@ public class InnerSpaceCompactionExceptionTest extends AbstractInnerSpaceCompact
for (int i = 0; i < seqResources.size(); i++) {
Map<String, Pair<Long, Long>> deleteMap = new HashMap<>();
deleteMap.put(
- deviceIds[0] + "." + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + "." + measurementSchemas[0].getMeasurementName(),
new Pair<>(i * ptNum, i * ptNum + 5));
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), false);
}
@@ -450,7 +450,7 @@ public class InnerSpaceCompactionExceptionTest extends AbstractInnerSpaceCompact
for (int i = 0; i < seqResources.size(); i++) {
Map<String, Pair<Long, Long>> deleteMap = new HashMap<>();
deleteMap.put(
- deviceIds[0] + "." + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + "." + measurementSchemas[0].getMeasurementName(),
new Pair<>(i * ptNum + 10, i * ptNum + 15));
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), true);
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), false);
@@ -481,7 +481,7 @@ public class InnerSpaceCompactionExceptionTest extends AbstractInnerSpaceCompact
Assert.assertEquals(2, modifications.size());
for (ModEntry modification : modifications) {
Assert.assertEquals(
- deviceIds[0] + PATH_SEPARATOR + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + PATH_SEPARATOR + measurementSchemas[0].getMeasurementName(),
((TreeDeletionEntry) modification).getPathPattern().getFullPath());
}
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerAlignedTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerAlignedTest.java
index 68e447da591..66771b0299a 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerAlignedTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerAlignedTest.java
@@ -140,7 +140,7 @@ public class ReadChunkCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -214,7 +214,7 @@ public class ReadChunkCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -280,7 +280,7 @@ public class ReadChunkCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -349,7 +349,7 @@ public class ReadChunkCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -416,7 +416,7 @@ public class ReadChunkCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -485,7 +485,7 @@ public class ReadChunkCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -555,7 +555,7 @@ public class ReadChunkCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
@@ -636,7 +636,7 @@ public class ReadChunkCompactionPerformerAlignedTest {
List<String> measurementIds = new ArrayList<>();
schemas.forEach(
(e) -> {
- measurementIds.add(e.getMeasurementId());
+ measurementIds.add(e.getMeasurementName());
});
for (String device : devices) {
iMeasurementSchemas.addAll(schemas);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerNoAlignedTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerNoAlignedTest.java
index 8a941ae62fe..d046343bcb4 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerNoAlignedTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerNoAlignedTest.java
@@ -154,7 +154,7 @@ public class ReadChunkCompactionPerformerNoAlignedTest {
}
for (PartialPath device : devicePath) {
for (IMeasurementSchema schema : schemas) {
- fullPathSet.add(device.getFullPath() + "." + schema.getMeasurementId());
+ fullPathSet.add(device.getFullPath() + "." + schema.getMeasurementName());
paths.add(new NonAlignedFullPath(device.getIDeviceIDAsFullDevice(), schema));
schemaList.add(schema);
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerOldTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerOldTest.java
index 65b3332ac9b..c0a6c1ca000 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerOldTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/ReadChunkCompactionPerformerOldTest.java
@@ -117,7 +117,7 @@ public class ReadChunkCompactionPerformerOldTest extends InnerCompactionTest {
CompactionTaskType.INNER_SEQ,
COMPACTION_TEST_SG);
sizeTieredCompactionLogger.close();
- Path path = new Path(deviceIds[0], measurementSchemas[0].getMeasurementId(), true);
+ Path path = new Path(deviceIds[0], measurementSchemas[0].getMeasurementName(), true);
try (TsFileSequenceReader reader =
new TsFileSequenceReader(targetTsFileResource.getTsFilePath());
TsFileReader readTsFile = new TsFileReader(reader)) {
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/sizetiered/SizeTieredCompactionRecoverTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/sizetiered/SizeTieredCompactionRecoverTest.java
index dbd4f53dc8e..42dd4f82292 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/sizetiered/SizeTieredCompactionRecoverTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/sizetiered/SizeTieredCompactionRecoverTest.java
@@ -103,7 +103,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -191,7 +191,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -223,7 +223,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -299,7 +299,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -331,7 +331,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -409,7 +409,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -439,9 +439,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
tsFileManager.addAll(unseqResources, false);
IFullPath path =
SchemaTestUtils.getNonAlignedFullPath(
- deviceIds[0]
- + TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ deviceIds[0] + PATH_SEPARATOR + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -513,9 +511,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
tsFileManager.add(targetTsFileResource, true);
path =
SchemaTestUtils.getNonAlignedFullPath(
- deviceIds[0]
- + TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ deviceIds[0] + PATH_SEPARATOR + measurementSchemas[0].getMeasurementName());
tsFilesReader =
new SeriesDataBlockReader(
@@ -566,7 +562,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
for (int i = 0; i < seqResources.size(); i++) {
Map<String, Pair<Long, Long>> deleteMap = new HashMap<>();
deleteMap.put(
- deviceIds[0] + "." + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + "." + measurementSchemas[0].getMeasurementName(),
new Pair<>(i * ptNum, i * ptNum + 10));
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), true);
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), false);
@@ -638,7 +634,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
for (int i = 0; i < seqResources.size(); i++) {
Map<String, Pair<Long, Long>> deleteMap = new HashMap<>();
deleteMap.put(
- deviceIds[0] + "." + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + "." + measurementSchemas[0].getMeasurementName(),
new Pair<>(i * ptNum, i * ptNum + 10));
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), true);
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), false);
@@ -714,7 +710,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
for (int i = 0; i < seqResources.size(); i++) {
Map<String, Pair<Long, Long>> deleteMap = new HashMap<>();
deleteMap.put(
- deviceIds[0] + "." + measurementSchemas[0].getMeasurementId(),
+ deviceIds[0] + "." + measurementSchemas[0].getMeasurementName(),
new Pair<>(i * ptNum, i * ptNum + 10));
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), true);
CompactionFileGeneratorUtils.generateMods(deleteMap, seqResources.get(i), false);
@@ -770,7 +766,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -834,7 +830,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
TimeSeriesMetadataCache.getInstance().clear();
ChunkCache.getInstance().clear();
tsFilesReader =
@@ -868,7 +864,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -927,7 +923,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -960,7 +956,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -1020,7 +1016,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
logger.warn("TsFiles in list is {}", tsFileManager.getTsFileList(true));
tsFilesReader =
new SeriesDataBlockReader(
@@ -1064,7 +1060,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -1105,7 +1101,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
@@ -1160,7 +1156,7 @@ public class SizeTieredCompactionRecoverTest extends AbstractInnerSpaceCompactio
SchemaTestUtils.getNonAlignedFullPath(
deviceIds[0]
+ TsFileConstant.PATH_SEPARATOR
- + measurementSchemas[0].getMeasurementId());
+ + measurementSchemas[0].getMeasurementName());
IDataBlockReader tsFilesReader =
new SeriesDataBlockReader(
path,
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/sizetiered/SizeTieredCompactionTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/sizetiered/SizeTieredCompactionTest.java
index 22e6a37dbfc..1d4413f1813 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/sizetiered/SizeTieredCompactionTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/sizetiered/SizeTieredCompactionTest.java
@@ -189,25 +189,25 @@ public class SizeTieredCompactionTest {
for (String deviceId : deviceIds) {
for (IMeasurementSchema measurementSchema : measurementSchemas) {
fileWriter.registerTimeseries(
- new Path(deviceId, measurementSchema.getMeasurementId(), true), measurementSchema);
+ new Path(deviceId, measurementSchema.getMeasurementName(), true), measurementSchema);
}
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i + valueOffset)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
}
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
fileWriter.close();
@@ -233,15 +233,15 @@ public class SizeTieredCompactionTest {
tsFileResource1.updatePlanIndexes((long) 0);
TsFileWriter fileWriter1 = new TsFileWriter(tsFileResource1.getTsFile());
fileWriter1.registerTimeseries(
- new Path(deviceIds[0], measurementSchemas[0].getMeasurementId(), true),
+ new Path(deviceIds[0], measurementSchemas[0].getMeasurementName(), true),
measurementSchemas[0]);
- TSRecord record1 = new TSRecord(0, deviceIds[0]);
+ TSRecord record1 = new TSRecord(deviceIds[0], 0);
record1.addTuple(
DataPoint.getDataPoint(
measurementSchemas[0].getType(),
- measurementSchemas[0].getMeasurementId(),
+ measurementSchemas[0].getMeasurementName(),
String.valueOf(0)));
- fileWriter1.write(record1);
+ fileWriter1.writeRecord(record1);
fileWriter1.close();
// prepare file 2
File file2 =
@@ -261,15 +261,15 @@ public class SizeTieredCompactionTest {
tsFileResource2.updatePlanIndexes((long) 1);
TsFileWriter fileWriter2 = new TsFileWriter(tsFileResource2.getTsFile());
fileWriter2.registerTimeseries(
- new Path(deviceIds[0], measurementSchemas[1].getMeasurementId(), true),
+ new Path(deviceIds[0], measurementSchemas[1].getMeasurementName(), true),
measurementSchemas[1]);
- TSRecord record2 = new TSRecord(0, deviceIds[0]);
+ TSRecord record2 = new TSRecord(deviceIds[0], 0);
record2.addTuple(
DataPoint.getDataPoint(
measurementSchemas[1].getType(),
- measurementSchemas[1].getMeasurementId(),
+ measurementSchemas[1].getMeasurementName(),
String.valueOf(0)));
- fileWriter2.write(record2);
+ fileWriter2.writeRecord(record2);
fileWriter2.close();
ret.add(tsFileResource1);
ret.add(tsFileResource2);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/settle/SettleRequestHandlerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/settle/SettleRequestHandlerTest.java
index 51e4a72079d..cedc288a2a9 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/settle/SettleRequestHandlerTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/settle/SettleRequestHandlerTest.java
@@ -140,7 +140,7 @@ public class SettleRequestHandlerTest {
for (int i = 0; i < 3; i++) {
for (int j = 1; j <= 3; j++) {
long timestamp = 3L * i + j;
- record = new TSRecord(timestamp, deviceId);
+ record = new TSRecord(deviceId, timestamp);
record.addTuple(
DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(timestamp)));
dataRegion.insert(DataRegionTest.buildInsertRowNodeByTSRecord(record));
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/tablemodel/CompactionTableModelTestFileWriter.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/tablemodel/CompactionTableModelTestFileWriter.java
index fb3cb08cc9c..d1403ed8e8c 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/tablemodel/CompactionTableModelTestFileWriter.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/tablemodel/CompactionTableModelTestFileWriter.java
@@ -29,7 +29,7 @@ import org.apache.tsfile.file.metadata.StringArrayDeviceID;
import org.apache.tsfile.file.metadata.TableSchema;
import org.apache.tsfile.file.metadata.enums.CompressionType;
import org.apache.tsfile.file.metadata.enums.TSEncoding;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.apache.tsfile.write.schema.Schema;
@@ -50,12 +50,12 @@ public class CompactionTableModelTestFileWriter extends CompactionTestFileWriter
public void registerTableSchema(String tableName, List<String> idColumnNames) {
CompactionTableSchema tableSchema = new CompactionTableSchema(tableName);
List<IMeasurementSchema> measurementSchemas = new ArrayList<>();
- List<ColumnType> columnTypes = new ArrayList<>();
+ List<ColumnCategory> columnTypes = new ArrayList<>();
for (String idColumnName : idColumnNames) {
measurementSchemas.add(
new MeasurementSchema(
idColumnName, TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED));
- columnTypes.add(ColumnType.ID);
+ columnTypes.add(ColumnCategory.ID);
}
tableSchema.merge(new TableSchema(tableName, measurementSchemas, columnTypes));
schema.registerTableSchema(tableSchema);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/tablemodel/CompactionTableSchemaCollectorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/tablemodel/CompactionTableSchemaCollectorTest.java
index 5767be8f40c..9c445916eab 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/tablemodel/CompactionTableSchemaCollectorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/tablemodel/CompactionTableSchemaCollectorTest.java
@@ -24,7 +24,7 @@ import org.apache.iotdb.db.storageengine.dataregion.compaction.execute.utils.Com
import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.file.metadata.TableSchema;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import org.apache.tsfile.write.schema.IMeasurementSchema;
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.junit.Assert;
@@ -44,12 +44,12 @@ public class CompactionTableSchemaCollectorTest {
measurementSchemaList1.add(new MeasurementSchema("id3", TSDataType.STRING));
measurementSchemaList1.add(new MeasurementSchema("s1", TSDataType.INT32));
measurementSchemaList1.add(new MeasurementSchema("s2", TSDataType.INT32));
- List<ColumnType> columnTypeList1 = new ArrayList<>();
- columnTypeList1.add(ColumnType.ID);
- columnTypeList1.add(ColumnType.ID);
- columnTypeList1.add(ColumnType.ID);
- columnTypeList1.add(ColumnType.MEASUREMENT);
- columnTypeList1.add(ColumnType.MEASUREMENT);
+ List<ColumnCategory> columnTypeList1 = new ArrayList<>();
+ columnTypeList1.add(ColumnCategory.ID);
+ columnTypeList1.add(ColumnCategory.ID);
+ columnTypeList1.add(ColumnCategory.ID);
+ columnTypeList1.add(ColumnCategory.MEASUREMENT);
+ columnTypeList1.add(ColumnCategory.MEASUREMENT);
TableSchema tableSchema1 = new TableSchema("t1", measurementSchemaList1, columnTypeList1);
compactionTableSchema.merge(tableSchema1);
Assert.assertEquals(3, compactionTableSchema.getColumnSchemas().size());
@@ -60,12 +60,12 @@ public class CompactionTableSchemaCollectorTest {
measurementSchemaList2.add(new MeasurementSchema("id2", TSDataType.STRING));
measurementSchemaList2.add(new MeasurementSchema("id3", TSDataType.STRING));
measurementSchemaList2.add(new MeasurementSchema("s2", TSDataType.INT32));
- List<ColumnType> columnTypeList2 = new ArrayList<>();
- columnTypeList2.add(ColumnType.MEASUREMENT);
- columnTypeList2.add(ColumnType.ID);
- columnTypeList2.add(ColumnType.ID);
- columnTypeList2.add(ColumnType.ID);
- columnTypeList2.add(ColumnType.MEASUREMENT);
+ List<ColumnCategory> columnTypeList2 = new ArrayList<>();
+ columnTypeList2.add(ColumnCategory.MEASUREMENT);
+ columnTypeList2.add(ColumnCategory.ID);
+ columnTypeList2.add(ColumnCategory.ID);
+ columnTypeList2.add(ColumnCategory.ID);
+ columnTypeList2.add(ColumnCategory.MEASUREMENT);
TableSchema tableSchema2 = new TableSchema("t1", measurementSchemaList2, columnTypeList2);
compactionTableSchema.merge(tableSchema2);
Assert.assertEquals(3, compactionTableSchema.getColumnSchemas().size());
@@ -77,13 +77,13 @@ public class CompactionTableSchemaCollectorTest {
measurementSchemaList3.add(new MeasurementSchema("id3", TSDataType.STRING));
measurementSchemaList3.add(new MeasurementSchema("s2", TSDataType.INT32));
measurementSchemaList3.add(new MeasurementSchema("id4", TSDataType.STRING));
- List<ColumnType> columnTypeList3 = new ArrayList<>();
- columnTypeList3.add(ColumnType.MEASUREMENT);
- columnTypeList3.add(ColumnType.ID);
- columnTypeList3.add(ColumnType.ID);
- columnTypeList3.add(ColumnType.ID);
- columnTypeList3.add(ColumnType.MEASUREMENT);
- columnTypeList3.add(ColumnType.ID);
+ List<ColumnCategory> columnTypeList3 = new ArrayList<>();
+ columnTypeList3.add(ColumnCategory.MEASUREMENT);
+ columnTypeList3.add(ColumnCategory.ID);
+ columnTypeList3.add(ColumnCategory.ID);
+ columnTypeList3.add(ColumnCategory.ID);
+ columnTypeList3.add(ColumnCategory.MEASUREMENT);
+ columnTypeList3.add(ColumnCategory.ID);
TableSchema tableSchema3 = new TableSchema("t1", measurementSchemaList3, columnTypeList3);
compactionTableSchema.merge(tableSchema3);
@@ -96,13 +96,13 @@ public class CompactionTableSchemaCollectorTest {
measurementSchemaList4.add(new MeasurementSchema("id4", TSDataType.STRING));
measurementSchemaList4.add(new MeasurementSchema("s2", TSDataType.INT32));
measurementSchemaList4.add(new MeasurementSchema("id3", TSDataType.STRING));
- List<ColumnType> columnTypeList4 = new ArrayList<>();
- columnTypeList4.add(ColumnType.MEASUREMENT);
- columnTypeList4.add(ColumnType.ID);
- columnTypeList4.add(ColumnType.ID);
- columnTypeList4.add(ColumnType.ID);
- columnTypeList4.add(ColumnType.MEASUREMENT);
- columnTypeList4.add(ColumnType.ID);
+ List<ColumnCategory> columnTypeList4 = new ArrayList<>();
+ columnTypeList4.add(ColumnCategory.MEASUREMENT);
+ columnTypeList4.add(ColumnCategory.ID);
+ columnTypeList4.add(ColumnCategory.ID);
+ columnTypeList4.add(ColumnCategory.ID);
+ columnTypeList4.add(ColumnCategory.MEASUREMENT);
+ columnTypeList4.add(ColumnCategory.ID);
TableSchema tableSchema4 = new TableSchema("t1", measurementSchemaList4, columnTypeList4);
try {
compactionTableSchema.merge(tableSchema4);
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionCheckerUtils.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionCheckerUtils.java
index e9c6eb96fdc..77e8498c858 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionCheckerUtils.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionCheckerUtils.java
@@ -539,7 +539,7 @@ public class CompactionCheckerUtils {
}
List<String> existedMeasurements =
measurementSchemas.stream()
- .map(IMeasurementSchema::getMeasurementId)
+ .map(IMeasurementSchema::getMeasurementName)
.collect(Collectors.toList());
IFullPath seriesPath;
if (isAlign) {
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessorTest.java
index 2e731ed66c9..0393067f109 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessorTest.java
@@ -130,7 +130,7 @@ public class TsFileProcessorTest {
assertTrue(tsfileResourcesForQuery.isEmpty());
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
processor.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
@@ -188,7 +188,7 @@ public class TsFileProcessorTest {
assertTrue(tsfileResourcesForQuery.isEmpty());
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
processor.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
@@ -272,7 +272,7 @@ public class TsFileProcessorTest {
for (int flushId = 0; flushId < 10; flushId++) {
for (int i = 1; i <= 10; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
processor.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
@@ -329,7 +329,7 @@ public class TsFileProcessorTest {
Assert.assertEquals(720360, memTable.memSize());
// Test records
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
processor.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
@@ -416,14 +416,14 @@ public class TsFileProcessorTest {
Assert.assertEquals(1920960, memTable.memSize());
// Test records
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
processor.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
Assert.assertEquals(6387232, memTable.getTVListsRamCost());
// Test records
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, "s1", String.valueOf(i)));
processor.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
@@ -474,7 +474,7 @@ public class TsFileProcessorTest {
Assert.assertEquals(1440000, memTable.memSize());
// Test records
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
processor.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
@@ -500,7 +500,7 @@ public class TsFileProcessorTest {
SystemInfo.getInstance().reportStorageGroupStatus(sgInfo, processor1);
// insert 100 rows by insertRow
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
processor1.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
@@ -521,7 +521,7 @@ public class TsFileProcessorTest {
InsertRowsNode insertRowsNode = new InsertRowsNode(new PlanNodeId(""));
// insert 100 rows by insertRows
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
insertRowsNode.addOneInsertRowNode(buildInsertRowNodeByTSRecord(record), i - 1);
}
@@ -533,19 +533,19 @@ public class TsFileProcessorTest {
Assert.assertEquals(memTable1.memSize(), memTable2.memSize());
// insert more rows by insertRow
- TSRecord record = new TSRecord(101, deviceId);
+ TSRecord record = new TSRecord(deviceId, 101);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, "1"));
InsertRowNode insertRowNode1 = buildInsertRowNodeByTSRecord(record);
processor1.insert(insertRowNode1, new long[5]);
- record = new TSRecord(101, deviceId);
+ record = new TSRecord(deviceId, 101);
record.addTuple(DataPoint.getDataPoint(dataType, "s99", "1"));
InsertRowNode insertRowNode2 = buildInsertRowNodeByTSRecord(record);
processor1.insert(insertRowNode2, new long[5]);
- record = new TSRecord(102, deviceId);
+ record = new TSRecord(deviceId, 102);
record.addTuple(DataPoint.getDataPoint(dataType, "s99", "1"));
InsertRowNode insertRowNode3 = buildInsertRowNodeByTSRecord(record);
processor1.insert(insertRowNode3, new long[5]);
- record = new TSRecord(102, "root.vehicle.d2");
+ record = new TSRecord("root.vehicle.d2", 102);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, "1"));
InsertRowNode insertRowNode4 = buildInsertRowNodeByTSRecord(record);
processor1.insert(insertRowNode4, new long[5]);
@@ -593,7 +593,7 @@ public class TsFileProcessorTest {
SystemInfo.getInstance().reportStorageGroupStatus(sgInfo, processor1);
// insert 100 rows by insertRow
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
InsertRowNode node = buildInsertRowNodeByTSRecord(record);
node.setAligned(true);
@@ -617,7 +617,7 @@ public class TsFileProcessorTest {
insertRowsNode.setAligned(true);
// insert 100 rows by insertRows
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
InsertRowNode node = buildInsertRowNodeByTSRecord(record);
node.setAligned(true);
@@ -631,22 +631,22 @@ public class TsFileProcessorTest {
Assert.assertEquals(memTable1.memSize(), memTable2.memSize());
// insert more rows by insertRow
- TSRecord record = new TSRecord(101, deviceId);
+ TSRecord record = new TSRecord(deviceId, 101);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, "1"));
InsertRowNode insertRowNode1 = buildInsertRowNodeByTSRecord(record);
insertRowNode1.setAligned(true);
processor1.insert(insertRowNode1, new long[5]);
- record = new TSRecord(101, deviceId);
+ record = new TSRecord(deviceId, 101);
record.addTuple(DataPoint.getDataPoint(dataType, "s99", "1"));
InsertRowNode insertRowNode2 = buildInsertRowNodeByTSRecord(record);
insertRowNode2.setAligned(true);
processor1.insert(insertRowNode2, new long[5]);
- record = new TSRecord(102, deviceId);
+ record = new TSRecord(deviceId, 102);
record.addTuple(DataPoint.getDataPoint(dataType, "s99", "1"));
InsertRowNode insertRowNode3 = buildInsertRowNodeByTSRecord(record);
insertRowNode3.setAligned(true);
processor1.insert(insertRowNode3, new long[5]);
- record = new TSRecord(102, "root.vehicle.d2");
+ record = new TSRecord("root.vehicle.d2", 102);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, "1"));
InsertRowNode insertRowNode4 = buildInsertRowNodeByTSRecord(record);
insertRowNode4.setAligned(true);
@@ -697,7 +697,7 @@ public class TsFileProcessorTest {
SystemInfo.getInstance().reportStorageGroupStatus(sgInfo, processor1);
// insert 100 rows (50 aligned, 50 non-aligned) by insertRow
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, i <= 50 ? deviceId : "root.vehicle.d2");
+ TSRecord record = new TSRecord(i <= 50 ? deviceId : "root.vehicle.d2", i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
InsertRowNode node = buildInsertRowNodeByTSRecord(record);
if (i <= 50) {
@@ -724,7 +724,7 @@ public class TsFileProcessorTest {
// insert 100 rows (50 aligned, 50 non-aligned) by insertRows
insertRowsNode.setMixingAlignment(true);
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, i <= 50 ? deviceId : "root.vehicle.d2");
+ TSRecord record = new TSRecord(i <= 50 ? deviceId : "root.vehicle.d2", i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
InsertRowNode node = buildInsertRowNodeByTSRecord(record);
if (i <= 50) {
@@ -757,7 +757,7 @@ public class TsFileProcessorTest {
SystemInfo.getInstance().reportStorageGroupStatus(sgInfo, processor1);
// insert 100 rows (50 aligned, 50 non-aligned) by insertRow
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, i <= 50 ? deviceId : "root.vehicle.d2");
+ TSRecord record = new TSRecord(i <= 50 ? deviceId : "root.vehicle.d2", i);
record.addTuple(DataPoint.getDataPoint(dataType, "s" + i, String.valueOf(i)));
InsertRowNode node = buildInsertRowNodeByTSRecord(record);
node.setAligned(true);
@@ -785,7 +785,7 @@ public class TsFileProcessorTest {
// insert 100 rows (50 aligned, 50 non-aligned) by insertRows
insertRowsNode.setMixingAlignment(true);
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, i <= 50 ? deviceId : "root.vehicle.d2");
+ TSRecord record = new TSRecord(i <= 50 ? deviceId : "root.vehicle.d2", i);
record.addTuple(DataPoint.getDataPoint(dataType, "s" + i, String.valueOf(i)));
InsertRowNode node = buildInsertRowNodeByTSRecord(record);
node.setAligned(true);
@@ -829,7 +829,7 @@ public class TsFileProcessorTest {
assertTrue(tsfileResourcesForQuery.isEmpty());
for (int i = 1; i <= 100; i++) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
processor.insert(buildInsertRowNodeByTSRecord(record), new long[5]);
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/series/SeriesReaderTestUtil.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/series/SeriesReaderTestUtil.java
index 667fd171bb8..66e96378f09 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/series/SeriesReaderTestUtil.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/series/SeriesReaderTestUtil.java
@@ -166,7 +166,7 @@ public class SeriesReaderTestUtil {
TsFileWriter fileWriter = new TsFileWriter(file);
Map<String, IMeasurementSchema> template = new HashMap<>();
for (IMeasurementSchema measurementSchema : measurementSchemas) {
- template.put(measurementSchema.getMeasurementId(), measurementSchema);
+ template.put(measurementSchema.getMeasurementName(), measurementSchema);
}
fileWriter.registerSchemaTemplate("template0", template, false);
for (String deviceId : deviceIds) {
@@ -174,20 +174,20 @@ public class SeriesReaderTestUtil {
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
for (String deviceId : deviceIds) {
- TSRecord record = new TSRecord(i, deviceId);
+ TSRecord record = new TSRecord(deviceId, i);
for (IMeasurementSchema measurementSchema : measurementSchemas) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchema.getType(),
- measurementSchema.getMeasurementId(),
+ measurementSchema.getMeasurementName(),
String.valueOf(i + valueOffset)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceId), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceId), i);
}
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
fileWriter.close();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/WALRecoverManagerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/WALRecoverManagerTest.java
index 51f17facd91..e4f82b5b367 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/WALRecoverManagerTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/WALRecoverManagerTest.java
@@ -590,27 +590,27 @@ public class WALRecoverManagerTest {
new Path(DEVICE2_NAME), new MeasurementSchema("s1", TSDataType.FLOAT, TSEncoding.RLE));
writer.registerTimeseries(
new Path(DEVICE2_NAME), new MeasurementSchema("s2", TSDataType.DOUBLE, TSEncoding.RLE));
- writer.write(
- new TSRecord(1, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 1)
.addTuple(new IntDataPoint("s1", 1))
.addTuple(new LongDataPoint("s2", 1)));
- writer.write(
- new TSRecord(2, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 2)
.addTuple(new IntDataPoint("s1", 2))
.addTuple(new LongDataPoint("s2", 2)));
- writer.write(
- new TSRecord(3, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 3)
.addTuple(new FloatDataPoint("s1", 3))
.addTuple(new DoubleDataPoint("s2", 3)));
- writer.flushAllChunkGroups();
+ writer.flush();
try (FileChannel channel = new FileInputStream(tsFile).getChannel()) {
truncateSize = channel.size();
}
- writer.write(
- new TSRecord(4, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 4)
.addTuple(new FloatDataPoint("s1", 4))
.addTuple(new DoubleDataPoint("s2", 4)));
- writer.flushAllChunkGroups();
+ writer.flush();
try (FileChannel channel = new FileInputStream(tsFile).getChannel()) {
truncateSize = (truncateSize + channel.size()) / 2;
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/SealedTsFileRecoverPerformerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/SealedTsFileRecoverPerformerTest.java
index c36abcc8f50..f1de11549e2 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/SealedTsFileRecoverPerformerTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/SealedTsFileRecoverPerformerTest.java
@@ -212,20 +212,20 @@ public class SealedTsFileRecoverPerformerTest {
new Path(DEVICE2_NAME), new MeasurementSchema("s1", TSDataType.FLOAT, TSEncoding.RLE));
writer.registerTimeseries(
new Path(DEVICE2_NAME), new MeasurementSchema("s2", TSDataType.DOUBLE, TSEncoding.RLE));
- writer.write(
- new TSRecord(1, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 1)
.addTuple(new IntDataPoint("s1", 1))
.addTuple(new LongDataPoint("s2", 1)));
- writer.write(
- new TSRecord(2, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 2)
.addTuple(new IntDataPoint("s1", 2))
.addTuple(new LongDataPoint("s2", 2)));
- writer.write(
- new TSRecord(3, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 3)
.addTuple(new FloatDataPoint("s1", 3))
.addTuple(new DoubleDataPoint("s2", 3)));
- writer.write(
- new TSRecord(4, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 4)
.addTuple(new FloatDataPoint("s1", 4))
.addTuple(new DoubleDataPoint("s2", 4)));
}
@@ -282,27 +282,27 @@ public class SealedTsFileRecoverPerformerTest {
new Path(DEVICE2_NAME), new MeasurementSchema("s1", TSDataType.FLOAT, TSEncoding.RLE));
writer.registerTimeseries(
new Path(DEVICE2_NAME), new MeasurementSchema("s2", TSDataType.DOUBLE, TSEncoding.RLE));
- writer.write(
- new TSRecord(1, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 1)
.addTuple(new IntDataPoint("s1", 1))
.addTuple(new LongDataPoint("s2", 1)));
- writer.write(
- new TSRecord(2, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 2)
.addTuple(new IntDataPoint("s1", 2))
.addTuple(new LongDataPoint("s2", 2)));
- writer.write(
- new TSRecord(3, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 3)
.addTuple(new FloatDataPoint("s1", 3))
.addTuple(new DoubleDataPoint("s2", 3)));
- writer.flushAllChunkGroups();
+ writer.flush();
try (FileChannel channel = new FileInputStream(tsFile).getChannel()) {
truncateSize = channel.size();
}
- writer.write(
- new TSRecord(4, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 4)
.addTuple(new FloatDataPoint("s1", 4))
.addTuple(new DoubleDataPoint("s2", 4)));
- writer.flushAllChunkGroups();
+ writer.flush();
try (FileChannel channel = new FileInputStream(tsFile).getChannel()) {
truncateSize = (truncateSize + channel.size()) / 2;
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoerTest.java
index 76f354bd291..f311328f632 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoerTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoerTest.java
@@ -753,24 +753,24 @@ public class TsFilePlanRedoerTest {
new MeasurementSchema("s3", TSDataType.BOOLEAN, TSEncoding.RLE),
new MeasurementSchema("s4", TSDataType.FLOAT, TSEncoding.RLE),
new MeasurementSchema("s5", TSDataType.TEXT, TSEncoding.PLAIN)));
- writer.write(
- new TSRecord(1, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 1)
.addTuple(new IntDataPoint("s1", 1))
.addTuple(new LongDataPoint("s2", 1)));
- writer.write(
- new TSRecord(2, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 2)
.addTuple(new IntDataPoint("s1", 2))
.addTuple(new LongDataPoint("s2", 2)));
- writer.write(
- new TSRecord(3, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 3)
.addTuple(new FloatDataPoint("s1", 3))
.addTuple(new DoubleDataPoint("s2", 3)));
- writer.write(
- new TSRecord(4, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 4)
.addTuple(new FloatDataPoint("s1", 4))
.addTuple(new DoubleDataPoint("s2", 4)));
- writer.writeAligned(
- new TSRecord(5, DEVICE3_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE3_NAME, 5)
.addTuple(new IntDataPoint("s1", 5))
.addTuple(new LongDataPoint("s2", 5))
.addTuple(new BooleanDataPoint("s3", true))
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/UnsealedTsFileRecoverPerformerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/UnsealedTsFileRecoverPerformerTest.java
index 3aa432bd3f7..ac8a187d187 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/UnsealedTsFileRecoverPerformerTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/UnsealedTsFileRecoverPerformerTest.java
@@ -288,27 +288,27 @@ public class UnsealedTsFileRecoverPerformerTest {
new Path(DEVICE2_NAME), new MeasurementSchema("s1", TSDataType.FLOAT, TSEncoding.RLE));
writer.registerTimeseries(
new Path(DEVICE2_NAME), new MeasurementSchema("s2", TSDataType.DOUBLE, TSEncoding.RLE));
- writer.write(
- new TSRecord(1, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 1)
.addTuple(new IntDataPoint("s1", 1))
.addTuple(new LongDataPoint("s2", 1)));
- writer.write(
- new TSRecord(2, DEVICE1_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE1_NAME, 2)
.addTuple(new IntDataPoint("s1", 2))
.addTuple(new LongDataPoint("s2", 2)));
- writer.write(
- new TSRecord(3, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 3)
.addTuple(new FloatDataPoint("s1", 3))
.addTuple(new DoubleDataPoint("s2", 3)));
- writer.flushAllChunkGroups();
+ writer.flush();
try (FileChannel channel = new FileInputStream(tsFile).getChannel()) {
truncateSize = channel.size();
}
- writer.write(
- new TSRecord(4, DEVICE2_NAME)
+ writer.writeRecord(
+ new TSRecord(DEVICE2_NAME, 4)
.addTuple(new FloatDataPoint("s1", 4))
.addTuple(new DoubleDataPoint("s2", 4)));
- writer.flushAllChunkGroups();
+ writer.flush();
try (FileChannel channel = new FileInputStream(tsFile).getChannel()) {
truncateSize = (truncateSize + channel.size()) / 2;
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/rescon/memory/ResourceManagerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/rescon/memory/ResourceManagerTest.java
index f1341386d76..0d0e618c969 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/rescon/memory/ResourceManagerTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/rescon/memory/ResourceManagerTest.java
@@ -145,20 +145,20 @@ public class ResourceManagerTest {
}
for (long i = timeOffset; i < timeOffset + ptNum; i++) {
for (int j = 0; j < deviceNum; j++) {
- TSRecord record = new TSRecord(i, deviceIds[j]);
+ TSRecord record = new TSRecord(deviceIds[j], i);
for (int k = 0; k < measurementNum; k++) {
record.addTuple(
DataPoint.getDataPoint(
measurementSchemas[k].getType(),
- measurementSchemas[k].getMeasurementId(),
+ measurementSchemas[k].getMeasurementName(),
String.valueOf(i + valueOffset)));
}
- fileWriter.write(record);
+ fileWriter.writeRecord(record);
tsFileResource.updateStartTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
tsFileResource.updateEndTime(IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIds[j]), i);
}
if ((i + 1) % flushInterval == 0) {
- fileWriter.flushAllChunkGroups();
+ fileWriter.flush();
}
}
fileWriter.close();
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileAndModSettleToolTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileAndModSettleToolTest.java
index 2a04a955706..e49fa963ee4 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileAndModSettleToolTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileAndModSettleToolTest.java
@@ -202,15 +202,15 @@ public class TsFileAndModSettleToolTest {
for (long timestamp = 0; timestamp < maxTimestamp; timestamp += 1000) {
for (Map.Entry<String, List<String>> entry : deviceSensorsMap.entrySet()) {
String device = entry.getKey();
- TSRecord tsRecord = new TSRecord(timestamp, device);
+ TSRecord tsRecord = new TSRecord(device, timestamp);
for (String sensor : entry.getValue()) {
DataPoint dataPoint = new LongDataPoint(sensor, timestamp + VALUE_OFFSET);
tsRecord.addTuple(dataPoint);
}
- tsFileWriter.write(tsRecord);
+ tsFileWriter.writeRecord(tsRecord);
}
}
- tsFileWriter.flushAllChunkGroups();
+ tsFileWriter.flush();
tsFileWriter.close();
} catch (Throwable e) {
Assert.fail(e.getMessage());
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileSelfCheckToolTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileSelfCheckToolTest.java
index 8eddfa51738..1aca298ba17 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileSelfCheckToolTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileSelfCheckToolTest.java
@@ -109,21 +109,21 @@ public class TsFileSelfCheckToolTest {
long value = 1000000L;
for (int r = 0; r < rowNum; r++, value++) {
- int row = tablet.rowSize++;
- timestamps[row] = timestamp++;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, timestamp++);
for (int i = 0; i < sensorNum; i++) {
long[] sensor = (long[]) values[i];
sensor[row] = value;
}
// write Tablet to TsFile
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
- tsFileWriter.write(tablet);
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
+ tsFileWriter.writeTree(tablet);
tablet.reset();
}
}
// write Tablet to TsFile
- if (tablet.rowSize != 0) {
- tsFileWriter.write(tablet);
+ if (tablet.getRowSize() != 0) {
+ tsFileWriter.writeTree(tablet);
tablet.reset();
}
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileSketchToolTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileSketchToolTest.java
index 920fbd0b2ea..d7b3cd73957 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileSketchToolTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/tools/TsFileSketchToolTest.java
@@ -108,21 +108,21 @@ public class TsFileSketchToolTest {
long timestamp = 1;
long value = 1000000L;
for (int r = 0; r < rowNum; r++, value++) {
- int row = tablet.rowSize++;
- timestamps[row] = timestamp++;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, timestamp++);
for (int i = 0; i < sensorNum; i++) {
long[] sensor = (long[]) values[i];
sensor[row] = value;
}
// write Tablet to TsFile
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
- tsFileWriter.write(tablet);
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
+ tsFileWriter.writeTree(tablet);
tablet.reset();
}
}
// write Tablet to TsFile
- if (tablet.rowSize != 0) {
- tsFileWriter.write(tablet);
+ if (tablet.getRowSize() != 0) {
+ tsFileWriter.writeTree(tablet);
tablet.reset();
}
@@ -134,20 +134,20 @@ public class TsFileSketchToolTest {
timestamp = 1;
value = 1000000L;
for (int r = 0; r < rowNum; r++, value++) {
- int row = tablet.rowSize++;
- timestamps[row] = timestamp++;
+ int row = tablet.getRowSize();
+ tablet.addTimestamp(row, timestamp++);
for (int i = 0; i < sensorNum; i++) {
long[] sensor = (long[]) values[i];
sensor[row] = value;
}
// write Tablet to TsFile
- if (tablet.rowSize == tablet.getMaxRowNumber()) {
+ if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
tsFileWriter.writeAligned(tablet);
tablet.reset();
}
}
// write Tablet to TsFile
- if (tablet.rowSize != 0) {
+ if (tablet.getRowSize() != 0) {
tsFileWriter.writeAligned(tablet);
tablet.reset();
}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/MemUtilsTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/MemUtilsTest.java
index 57cbc4524fb..efe132318d8 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/MemUtilsTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/MemUtilsTest.java
@@ -180,7 +180,7 @@ public class MemUtilsTest {
public void getMemSizeTest() {
long totalSize = 0;
IDeviceID device = IDeviceID.Factory.DEFAULT_FACTORY.create("root.sg.d1");
- TSRecord record = new TSRecord(0, device);
+ TSRecord record = new TSRecord(device, 0);
DataPoint point1 = new IntDataPoint("s1", 1);
Assert.assertEquals(MemUtils.getStringMem("s1") + 20, MemUtils.getDataPointMem(point1));
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
index 150613e066c..33f4266ac81 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
@@ -166,7 +166,7 @@ public class AlignedPath extends PartialPath {
schemaList.sort(
Comparator.comparing(
iMeasurementSchema ->
- new Binary(iMeasurementSchema.getMeasurementId(), TSFileConfig.STRING_CHARSET),
+ new Binary(iMeasurementSchema.getMeasurementName(), TSFileConfig.STRING_CHARSET),
comparator));
}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/NonAlignedFullPath.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/NonAlignedFullPath.java
index 49dab01d2b3..229a6ace1b2 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/NonAlignedFullPath.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/NonAlignedFullPath.java
@@ -55,7 +55,7 @@ public class NonAlignedFullPath implements IFullPath {
}
public String getMeasurement() {
- return measurementSchema.getMeasurementId();
+ return measurementSchema.getMeasurementName();
}
@Override
@@ -90,6 +90,6 @@ public class NonAlignedFullPath implements IFullPath {
public long ramBytesUsed() {
return INSTANCE_SIZE
+ deviceID.ramBytesUsed()
- + RamUsageEstimator.sizeOf(measurementSchema.getMeasurementId());
+ + RamUsageEstimator.sizeOf(measurementSchema.getMeasurementName());
}
}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/column/TsTableColumnCategory.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/column/TsTableColumnCategory.java
index 86c9551501d..ae287e4f551 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/column/TsTableColumnCategory.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/column/TsTableColumnCategory.java
@@ -20,7 +20,7 @@
package org.apache.iotdb.commons.schema.table.column;
import org.apache.tsfile.utils.ReadWriteIOUtils;
-import org.apache.tsfile.write.record.Tablet.ColumnType;
+import org.apache.tsfile.write.record.Tablet.ColumnCategory;
import java.io.IOException;
import java.io.InputStream;
@@ -76,20 +76,20 @@ public enum TsTableColumnCategory {
}
}
- public ColumnType toTsFileColumnType() {
+ public ColumnCategory toTsFileColumnType() {
switch (this) {
case ID:
- return ColumnType.ID;
+ return ColumnCategory.ID;
case ATTRIBUTE:
- return ColumnType.ATTRIBUTE;
+ return ColumnCategory.ATTRIBUTE;
case MEASUREMENT:
- return ColumnType.MEASUREMENT;
+ return ColumnCategory.MEASUREMENT;
default:
throw new IllegalArgumentException("Unsupported column type in TsFile: " + this);
}
}
- public static TsTableColumnCategory fromTsFileColumnType(ColumnType columnType) {
+ public static TsTableColumnCategory fromTsFileColumnType(ColumnCategory columnType) {
switch (columnType) {
case MEASUREMENT:
return MEASUREMENT;
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/view/LogicalViewSchema.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/view/LogicalViewSchema.java
index 09048bb6b48..7c74a1791c5 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/view/LogicalViewSchema.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/view/LogicalViewSchema.java
@@ -46,14 +46,14 @@ import java.util.Map;
public class LogicalViewSchema
implements IMeasurementSchema, Comparable<LogicalViewSchema>, Serializable {
- private String measurementId;
+ private String measurementName;
private ViewExpression expression;
private TSDataType dataType = TSDataType.UNKNOWN;
public LogicalViewSchema(String measurementId, ViewExpression expression) {
- this.measurementId = measurementId;
+ this.measurementName = measurementId;
this.expression = expression;
}
@@ -62,7 +62,7 @@ public class LogicalViewSchema
if (equals(o)) {
return 0;
} else {
- return this.measurementId.compareTo(o.measurementId);
+ return this.measurementName.compareTo(o.measurementName);
}
}
@@ -72,8 +72,8 @@ public class LogicalViewSchema
}
@Override
- public String getMeasurementId() {
- return this.measurementId;
+ public String getMeasurementName() {
+ return this.measurementName;
}
@Override
@@ -99,7 +99,7 @@ public class LogicalViewSchema
}
@Override
- public void setType(TSDataType dataType) {
+ public void setDataType(TSDataType dataType) {
this.dataType = dataType;
}
@@ -148,7 +148,7 @@ public class LogicalViewSchema
@Override
public int getSubMeasurementIndex(String measurementId) {
- return this.measurementId.equals(measurementId) ? 0 : -1;
+ return this.measurementName.equals(measurementId) ? 0 : -1;
}
@Override
@@ -158,7 +158,7 @@ public class LogicalViewSchema
@Override
public boolean containsSubMeasurement(String measurementId) {
- return this.measurementId.equals(measurementId);
+ return this.measurementName.equals(measurementId);
}
// region serialize and deserialize
@@ -173,7 +173,7 @@ public class LogicalViewSchema
@Override
public int serializeTo(ByteBuffer buffer) {
// TODO: CRTODO: the size of buffer is not calculated!
- ReadWriteIOUtils.write(measurementId, buffer);
+ ReadWriteIOUtils.write(measurementName, buffer);
ViewExpression.serialize(this.expression, buffer);
return 0;
@@ -182,7 +182,7 @@ public class LogicalViewSchema
@Override
public int serializeTo(OutputStream outputStream) throws IOException {
// TODO: CRTODO: the size of buffer is not calculated!
- ReadWriteIOUtils.write(measurementId, outputStream);
+ ReadWriteIOUtils.write(measurementName, outputStream);
ViewExpression.serialize(this.expression, outputStream);
return 0;
@@ -249,7 +249,7 @@ public class LogicalViewSchema
new MetadataException(
String.format(
"View with measurementID [%s] is broken. It stores illegal path [%s].",
- this.measurementId, this.getSourcePathStringIfWritable())));
+ this.measurementName, this.getSourcePathStringIfWritable())));
}
}
return null;
diff --git a/pom.xml b/pom.xml
index 69d2ed5bcfa..a0eeb5cacb1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -166,7 +166,7 @@
<thrift.version>0.14.1</thrift.version>
<xz.version>1.9</xz.version>
<zstd-jni.version>1.5.6-3</zstd-jni.version>
- <tsfile.version>1.2.0-dd29bcc-SNAPSHOT</tsfile.version>
+ <tsfile.version>1.2.0-241128-SNAPSHOT</tsfile.version>
</properties>
<!--
if we claim dependencies in dependencyManagement, then we do not claim