You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2022/03/28 04:34:30 UTC
[iotdb] branch master updated: Rename SchemaEngine to LocalSchemaProcessor and Rename SchemaRegionManager to SchemaEngine (#5359)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin 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 5404730 Rename SchemaEngine to LocalSchemaProcessor and Rename SchemaRegionManager to SchemaEngine (#5359)
5404730 is described below
commit 540473054aa1b9cef9cfead12aedf2b0dd5d48bd
Author: Marcos_Zyk <38...@users.noreply.github.com>
AuthorDate: Mon Mar 28 12:33:30 2022 +0800
Rename SchemaEngine to LocalSchemaProcessor and Rename SchemaRegionManager to SchemaEngine (#5359)
---
.../org/apache/iotdb/cluster/ClusterIoTDB.java | 8 +-
.../iotdb/cluster/coordinator/Coordinator.java | 10 +-
.../cluster/log/applier/AsyncDataLogApplier.java | 8 +-
.../iotdb/cluster/log/applier/DataLogApplier.java | 6 +-
.../log/manage/MetaSingleSnapshotLogManager.java | 2 +-
.../log/manage/PartitionedSnapshotLogManager.java | 4 +-
.../cluster/log/snapshot/MetaSimpleSnapshot.java | 4 +-
.../{CSchemaEngine.java => CSchemaProcessor.java} | 20 +-
.../apache/iotdb/cluster/metadata/MetaPuller.java | 10 +-
.../iotdb/cluster/partition/PartitionTable.java | 4 +-
.../cluster/query/ClusterPhysicalGenerator.java | 8 +-
.../iotdb/cluster/query/ClusterPlanExecutor.java | 22 +-
.../iotdb/cluster/query/ClusterPlanRouter.java | 17 +-
.../iotdb/cluster/query/LocalQueryExecutor.java | 31 +-
.../iotdb/cluster/query/filter/SlotSgFilter.java | 2 +-
.../cluster/query/reader/ClusterTimeGenerator.java | 4 +-
.../cluster/server/member/DataGroupMember.java | 6 +-
.../cluster/server/member/MetaGroupMember.java | 2 +-
.../cluster/server/service/DataAsyncService.java | 15 +-
.../cluster/server/service/DataSyncService.java | 12 +-
.../iotdb/cluster/utils/ClusterQueryUtils.java | 2 +-
.../apache/iotdb/cluster/utils/ClusterUtils.java | 4 +-
.../log/applier/AsyncDataLogApplierTest.java | 2 +-
.../cluster/log/applier/DataLogApplierTest.java | 13 +-
.../cluster/log/applier/MetaLogApplierTest.java | 6 +-
.../cluster/log/snapshot/DataSnapshotTest.java | 2 +-
.../cluster/log/snapshot/FileSnapshotTest.java | 12 +-
.../log/snapshot/MetaSimpleSnapshotTest.java | 4 +-
.../log/snapshot/PartitionedSnapshotTest.java | 5 +-
.../cluster/log/snapshot/PullSnapshotTaskTest.java | 3 +-
...eWhiteBox.java => SchemaProcessorWhiteBox.java} | 20 +-
.../cluster/partition/SlotPartitionTableTest.java | 26 +-
.../cluster/query/ClusterPlanExecutorTest.java | 2 +-
.../clusterinfo/ClusterInfoServiceImplTest.java | 4 +-
.../iotdb/cluster/server/member/BaseMember.java | 10 +-
.../cluster/server/member/DataGroupMemberTest.java | 4 +-
.../cluster/server/member/MetaGroupMemberTest.java | 22 +-
.../iotdb/db/integration/IoTDBArithmeticIT.java | 18 +-
.../apache/iotdb/db/integration/IoTDBLastIT.java | 14 +-
.../iotdb/db/integration/IoTDBNestedQueryIT.java | 12 +-
.../iotdb/db/integration/IoTDBSelectIntoIT.java | 18 +-
.../iotdb/db/integration/IoTDBSimpleQueryIT.java | 8 +-
.../db/integration/IoTDBTriggerExecutionIT.java | 26 +-
.../db/integration/IoTDBTriggerManagementIT.java | 8 +-
.../iotdb/db/integration/IoTDBUDFManagementIT.java | 6 +-
.../apache/iotdb/session/IoTDBSessionSimpleIT.java | 4 +-
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 6 +-
.../org/apache/iotdb/db/engine/StorageEngine.java | 21 +-
.../db/engine/compaction/CompactionUtils.java | 4 +-
.../inner/utils/InnerSpaceCompactionUtils.java | 2 +-
.../engine/cq/ContinuousQuerySchemaCheckTask.java | 2 +-
.../storagegroup/VirtualStorageGroupProcessor.java | 14 +-
.../service/TriggerRegistrationService.java | 2 +-
.../trigger/sink/local/LocalIoTDBHandler.java | 6 +-
.../iotdb/db/metadata/LocalConfigManager.java | 42 +-
...SchemaEngine.java => LocalSchemaProcessor.java} | 32 +-
.../db/metadata/idtable/IDTableHashmapImpl.java | 10 +-
.../iotdb/db/metadata/idtable/IDTableManager.java | 2 +-
.../idtable/entry/InsertMeasurementMNode.java | 2 +-
.../db/metadata/lastCache/LastCacheManager.java | 6 +-
.../iotdb/db/metadata/mtree/MTreeAboveSG.java | 4 +-
.../iotdb/db/metadata/mtree/MTreeBelowSG.java | 2 +-
.../mtree/traverser/collector/MNodeCollector.java | 2 +-
...{SchemaRegionManager.java => SchemaEngine.java} | 14 +-
.../db/metadata/schemaregion/SchemaRegion.java | 4 +-
.../storagegroup/IStorageGroupSchemaManager.java | 4 +-
.../storagegroup/StorageGroupSchemaManager.java | 4 +-
.../db/metadata/upgrade/MetadataUpgrader.java | 62 +-
.../execution/scheduler/StandaloneScheduler.java | 4 +-
.../db/mpp/sql/rewriter/ConcatPathRewriter.java | 3 +-
.../db/mpp/sql/rewriter/WildcardsRemover.java | 2 +-
.../apache/iotdb/db/qp/executor/PlanExecutor.java | 91 ++-
.../iotdb/db/qp/logical/crud/QueryOperator.java | 4 +-
.../iotdb/db/qp/physical/crud/InsertPlan.java | 2 +-
.../iotdb/db/qp/physical/crud/QueryPlan.java | 3 +-
.../qp/strategy/optimizer/ConcatPathOptimizer.java | 3 +-
.../apache/iotdb/db/qp/utils/WildcardsRemover.java | 4 +-
.../iotdb/db/query/dataset/ShowDevicesDataSet.java | 2 +-
.../db/query/dataset/ShowTimeseriesDataSet.java | 2 +-
.../iotdb/db/query/executor/LastQueryExecutor.java | 16 +-
.../java/org/apache/iotdb/db/service/IoTDB.java | 8 +-
.../db/service/thrift/impl/TSServiceImpl.java | 20 +-
.../db/sync/receiver/transfer/SyncServiceImpl.java | 2 +-
.../db/tools/virtualsg/DeviceMappingViewer.java | 6 +-
.../org/apache/iotdb/db/utils/SchemaTestUtils.java | 2 +-
.../org/apache/iotdb/db/utils/SchemaUtils.java | 4 +-
.../iotdb/db/writelog/recover/LogReplayer.java | 4 +-
.../iotdb/db/engine/MetadataManagerHelper.java | 46 +-
.../iotdb/db/engine/cache/ChunkCacheTest.java | 4 +-
.../engine/compaction/AbstractCompactionTest.java | 6 +-
.../engine/compaction/CompactionSchedulerTest.java | 60 +-
.../compaction/TestUtilsForAlignedSeries.java | 6 +-
.../compaction/cross/CrossSpaceCompactionTest.java | 4 +-
.../db/engine/compaction/cross/MergeTest.java | 4 +-
.../inner/AbstractInnerSpaceCompactionTest.java | 4 +-
.../inner/InnerCompactionMoreDataTest.java | 4 +-
.../compaction/inner/InnerCompactionTest.java | 4 +-
.../compaction/inner/InnerSeqCompactionTest.java | 4 +-
.../InnerSpaceCompactionUtilsNoAlignedTest.java | 4 +-
.../compaction/inner/InnerUnseqCompactionTest.java | 4 +-
.../inner/sizetiered/SizeTieredCompactionTest.java | 4 +-
.../recover/SizeTieredCompactionRecoverTest.java | 4 +-
.../engine/modification/DeletionFileNodeTest.java | 4 +-
.../db/engine/modification/DeletionQueryTest.java | 4 +-
.../storagegroup/FileNodeManagerBenchmark.java | 8 +-
.../iotdb/db/engine/storagegroup/TTLTest.java | 17 +-
...neAdvancedTest.java => SchemaAdvancedTest.java} | 72 +-
...maEngineBasicTest.java => SchemaBasicTest.java} | 906 +++++++++++----------
...gineImproveTest.java => SchemaImproveTest.java} | 36 +-
.../org/apache/iotdb/db/metadata/TemplateTest.java | 116 +--
.../iotdb/db/metadata/idtable/IDTableTest.java | 70 +-
.../db/metadata/idtable/InsertWithIDTableTest.java | 16 +-
.../iotdb/db/metadata/mtree/MTreeAboveSGTest.java | 5 +-
.../iotdb/db/metadata/mtree/MTreeBelowSGTest.java | 4 +-
.../db/metadata/upgrade/MetadataUpgradeTest.java | 20 +-
.../java/org/apache/iotdb/db/qp/PlannerTest.java | 32 +-
.../iotdb/db/qp/physical/ConcatOptimizerTest.java | 14 +-
.../iotdb/db/qp/physical/InsertRowPlanTest.java | 12 +-
.../iotdb/db/qp/physical/InsertTabletPlanTest.java | 8 +-
.../iotdb/db/qp/physical/PhysicalPlanTest.java | 12 +-
.../iotdb/db/qp/physical/SerializationTest.java | 10 +-
.../query/dataset/UDTFAlignByTimeDataSetTest.java | 14 +-
.../query/reader/series/SeriesReaderTestUtil.java | 4 +-
.../iotdb/db/rescon/ResourceManagerTest.java | 4 +-
.../db/sync/receiver/load/FileLoaderTest.java | 10 +-
.../recover/SyncReceiverLogAnalyzerTest.java | 10 +-
.../db/sync/sender/manage/SyncFileManagerTest.java | 2 +-
.../sender/recover/SyncSenderLogAnalyzerTest.java | 2 +-
.../org/apache/iotdb/db/tools/MLogParserTest.java | 26 +-
.../org/apache/iotdb/db/utils/SchemaUtilsTest.java | 6 +-
.../apache/iotdb/db/writelog/PerformanceTest.java | 10 +-
.../db/writelog/recover/DeviceStringTest.java | 12 +-
.../iotdb/db/writelog/recover/LogReplayerTest.java | 4 +-
.../recover/RecoverResourceFromReaderTest.java | 8 +-
.../db/writelog/recover/SeqTsFileRecoverTest.java | 8 +-
.../writelog/recover/UnseqTsFileRecoverTest.java | 8 +-
136 files changed, 1298 insertions(+), 1237 deletions(-)
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java
index 087eb8f..4b56784 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java
@@ -32,7 +32,7 @@ import org.apache.iotdb.cluster.config.ClusterDescriptor;
import org.apache.iotdb.cluster.coordinator.Coordinator;
import org.apache.iotdb.cluster.exception.ConfigInconsistentException;
import org.apache.iotdb.cluster.exception.StartUpCheckFailureException;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.metadata.MetaPuller;
import org.apache.iotdb.cluster.partition.slot.SlotPartitionTable;
import org.apache.iotdb.cluster.partition.slot.SlotStrategy;
@@ -151,9 +151,9 @@ public class ClusterIoTDB implements ClusterIoTDBMBean {
IoTDBDescriptor.getInstance().getConfig().isRpcThriftCompressionEnable());
metaGroupMember = new MetaGroupMember(protocolFactory, thisNode, coordinator);
IoTDB.setClusterMode();
- IoTDB.setSchemaEngine(CSchemaEngine.getInstance());
- ((CSchemaEngine) IoTDB.schemaEngine).setMetaGroupMember(metaGroupMember);
- ((CSchemaEngine) IoTDB.schemaEngine).setCoordinator(coordinator);
+ IoTDB.setSchemaProcessor(CSchemaProcessor.getInstance());
+ ((CSchemaProcessor) IoTDB.schemaProcessor).setMetaGroupMember(metaGroupMember);
+ ((CSchemaProcessor) IoTDB.schemaProcessor).setCoordinator(coordinator);
MetaPuller.getInstance().init(metaGroupMember);
// set coordinator for serviceProvider construction
try {
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java b/cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java
index db39cbf..b779cb0 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java
@@ -29,7 +29,7 @@ import org.apache.iotdb.cluster.exception.CheckConsistencyException;
import org.apache.iotdb.cluster.exception.UnknownLogTypeException;
import org.apache.iotdb.cluster.exception.UnsupportedPlanException;
import org.apache.iotdb.cluster.log.Log;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.partition.PartitionGroup;
import org.apache.iotdb.cluster.query.ClusterPlanRouter;
import org.apache.iotdb.cluster.rpc.thrift.Node;
@@ -178,7 +178,7 @@ public class Coordinator {
// them to full paths so the executor nodes will not need to query the metadata holders,
// eliminating the risk that when they are querying the metadata holders, the timeseries
// has already been deleted
- ((CSchemaEngine) IoTDB.schemaEngine).convertToFullPaths(plan);
+ ((CSchemaProcessor) IoTDB.schemaProcessor).convertToFullPaths(plan);
} else {
// function convertToFullPaths has already sync leader
metaGroupMember.syncLeaderWithConsistencyCheck(true);
@@ -209,12 +209,12 @@ public class Coordinator {
throws MetadataException, CheckConsistencyException {
if (plan instanceof SetTemplatePlan) {
try {
- IoTDB.schemaEngine.getBelongedStorageGroup(
+ IoTDB.schemaProcessor.getBelongedStorageGroup(
new PartialPath(((SetTemplatePlan) plan).getPrefixPath()));
} catch (IllegalPathException e) {
// the plan has been checked
} catch (StorageGroupNotSetException e) {
- ((CSchemaEngine) IoTDB.schemaEngine).createSchema(plan);
+ ((CSchemaProcessor) IoTDB.schemaProcessor).createSchema(plan);
}
}
}
@@ -255,7 +255,7 @@ public class Coordinator {
logger.debug("{}: No associated storage group found for {}, auto-creating", name, plan);
try {
- ((CSchemaEngine) IoTDB.schemaEngine).createSchema(plan);
+ ((CSchemaProcessor) IoTDB.schemaProcessor).createSchema(plan);
return processPartitionedPlan(plan);
} catch (MetadataException | CheckConsistencyException e) {
logger.error(
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplier.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplier.java
index 15291ab..576f213 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplier.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplier.java
@@ -154,16 +154,16 @@ public class AsyncDataLogApplier implements LogApplier {
PartialPath sgPath = null;
if (plan instanceof InsertMultiTabletPlan) {
PartialPath deviceId = ((InsertMultiTabletPlan) plan).getFirstDeviceId();
- sgPath = IoTDB.schemaEngine.getBelongedStorageGroup(deviceId);
+ sgPath = IoTDB.schemaProcessor.getBelongedStorageGroup(deviceId);
} else if (plan instanceof InsertRowsPlan) {
PartialPath path = ((InsertRowsPlan) plan).getFirstDeviceId();
- sgPath = IoTDB.schemaEngine.getBelongedStorageGroup(path);
+ sgPath = IoTDB.schemaProcessor.getBelongedStorageGroup(path);
} else if (plan instanceof InsertPlan) {
PartialPath deviceId = ((InsertPlan) plan).getDevicePath();
- sgPath = IoTDB.schemaEngine.getBelongedStorageGroup(deviceId);
+ sgPath = IoTDB.schemaProcessor.getBelongedStorageGroup(deviceId);
} else if (plan instanceof CreateTimeSeriesPlan) {
PartialPath path = ((CreateTimeSeriesPlan) plan).getPath();
- sgPath = IoTDB.schemaEngine.getBelongedStorageGroup(path);
+ sgPath = IoTDB.schemaProcessor.getBelongedStorageGroup(path);
}
return sgPath;
}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/DataLogApplier.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/DataLogApplier.java
index f765bfa..f1c5c39 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/DataLogApplier.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/DataLogApplier.java
@@ -128,7 +128,7 @@ public class DataLogApplier extends BaseApplier {
boolean hasSync = false;
for (InsertTabletPlan insertTabletPlan : plan.getInsertTabletPlanList()) {
try {
- IoTDB.schemaEngine.getBelongedStorageGroup(insertTabletPlan.getDevicePath());
+ IoTDB.schemaProcessor.getBelongedStorageGroup(insertTabletPlan.getDevicePath());
} catch (StorageGroupNotSetException e) {
try {
if (!hasSync) {
@@ -150,7 +150,7 @@ public class DataLogApplier extends BaseApplier {
boolean hasSync = false;
for (InsertRowPlan insertRowPlan : plan.getInsertRowPlanList()) {
try {
- IoTDB.schemaEngine.getBelongedStorageGroup(insertRowPlan.getDevicePath());
+ IoTDB.schemaProcessor.getBelongedStorageGroup(insertRowPlan.getDevicePath());
} catch (StorageGroupNotSetException e) {
try {
if (!hasSync) {
@@ -170,7 +170,7 @@ public class DataLogApplier extends BaseApplier {
private void applyInsert(InsertPlan plan)
throws StorageGroupNotSetException, QueryProcessException, StorageEngineException {
try {
- IoTDB.schemaEngine.getBelongedStorageGroup(plan.getDevicePath());
+ IoTDB.schemaProcessor.getBelongedStorageGroup(plan.getDevicePath());
} catch (StorageGroupNotSetException e) {
// the sg may not exist because the node does not catch up with the leader, retry after
// synchronization
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/MetaSingleSnapshotLogManager.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/MetaSingleSnapshotLogManager.java
index 1d81755..4e28d10 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/MetaSingleSnapshotLogManager.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/MetaSingleSnapshotLogManager.java
@@ -63,7 +63,7 @@ public class MetaSingleSnapshotLogManager extends RaftLogManager {
// TODO-cluster https://issues.apache.org/jira/browse/IOTDB-820
super.takeSnapshot();
synchronized (this) {
- storageGroupTTLMap = IoTDB.schemaEngine.getStorageGroupsTTL();
+ storageGroupTTLMap = IoTDB.schemaProcessor.getStorageGroupsTTL();
try {
IAuthorizer authorizer = BasicAuthorizer.getInstance();
userMap = authorizer.getAllUsers();
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/PartitionedSnapshotLogManager.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/PartitionedSnapshotLogManager.java
index e749f36..0a8b1b9 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/PartitionedSnapshotLogManager.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/PartitionedSnapshotLogManager.java
@@ -116,7 +116,7 @@ public abstract class PartitionedSnapshotLogManager<T extends Snapshot> extends
void collectTimeseriesSchemas(List<Integer> requiredSlots) {
slotTimeseries.clear();
- List<PartialPath> allSgPaths = IoTDB.schemaEngine.getAllStorageGroupPaths();
+ List<PartialPath> allSgPaths = IoTDB.schemaProcessor.getAllStorageGroupPaths();
Set<Integer> requiredSlotsSet = new HashSet<Integer>(requiredSlots);
for (PartialPath sgPath : allSgPaths) {
@@ -130,7 +130,7 @@ public abstract class PartitionedSnapshotLogManager<T extends Snapshot> extends
}
Collection<TimeseriesSchema> schemas =
slotTimeseries.computeIfAbsent(slot, s -> new HashSet<>());
- IoTDB.schemaEngine.collectTimeseriesSchema(sgPath, schemas);
+ IoTDB.schemaProcessor.collectTimeseriesSchema(sgPath, schemas);
logger.debug("{}: {} timeseries are snapshot in slot {}", getName(), schemas.size(), slot);
}
}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshot.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshot.java
index 5a1011e..dc9b966 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshot.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshot.java
@@ -226,7 +226,7 @@ public class MetaSimpleSnapshot extends Snapshot {
for (Map.Entry<PartialPath, Long> entry : snapshot.getStorageGroupTTLMap().entrySet()) {
PartialPath sgPath = entry.getKey();
try {
- IoTDB.schemaEngine.setStorageGroup(sgPath);
+ IoTDB.schemaProcessor.setStorageGroup(sgPath);
} catch (StorageGroupAlreadySetException e) {
// ignore
} catch (MetadataException e) {
@@ -239,7 +239,7 @@ public class MetaSimpleSnapshot extends Snapshot {
// 2. register ttl in the snapshot
try {
- IoTDB.schemaEngine.setTTL(sgPath, entry.getValue());
+ IoTDB.schemaProcessor.setTTL(sgPath, entry.getValue());
StorageEngine.getInstance().setTTL(sgPath, entry.getValue());
} catch (MetadataException | IOException e) {
logger.error(
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaEngine.java b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaProcessor.java
similarity index 99%
rename from cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaEngine.java
rename to cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaProcessor.java
index 81c0975..308e123 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaEngine.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaProcessor.java
@@ -47,7 +47,7 @@ import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.metadata.PathAlreadyExistException;
import org.apache.iotdb.db.exception.metadata.PathNotExistException;
import org.apache.iotdb.db.exception.metadata.StorageGroupNotSetException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.lastCache.LastCacheManager;
import org.apache.iotdb.db.metadata.mnode.IMNode;
import org.apache.iotdb.db.metadata.mnode.IMeasurementMNode;
@@ -127,9 +127,9 @@ import static org.apache.iotdb.cluster.query.ClusterPlanExecutor.waitForThreadPo
import static org.apache.iotdb.db.utils.EncodingInferenceUtils.getDefaultEncoding;
@SuppressWarnings("java:S1135") // ignore todos
-public class CSchemaEngine extends SchemaEngine {
+public class CSchemaProcessor extends LocalSchemaProcessor {
- private static final Logger logger = LoggerFactory.getLogger(CSchemaEngine.class);
+ private static final Logger logger = LoggerFactory.getLogger(CSchemaProcessor.class);
private ReentrantReadWriteLock cacheLock = new ReentrantReadWriteLock();
// only cache the series who is writing, we need not to cache series who is reading
@@ -139,20 +139,20 @@ public class CSchemaEngine extends SchemaEngine {
private MetaGroupMember metaGroupMember;
private Coordinator coordinator;
- private CSchemaEngine() {
+ private CSchemaProcessor() {
super();
metaPuller = MetaPuller.getInstance();
int remoteCacheSize = config.getmRemoteSchemaCacheSize();
mRemoteMetaCache = new RemoteMetaCache(remoteCacheSize);
}
- private static class CSchemaEngineHolder {
+ private static class CSchemaProcessorHolder {
- private CSchemaEngineHolder() {
+ private CSchemaProcessorHolder() {
// allowed to do nothing
}
- private static final CSchemaEngine INSTANCE = new CSchemaEngine();
+ private static final CSchemaProcessor INSTANCE = new CSchemaProcessor();
}
/**
@@ -160,8 +160,8 @@ public class CSchemaEngine extends SchemaEngine {
*
* @return
*/
- public static CSchemaEngine getInstance() {
- return CSchemaEngineHolder.INSTANCE;
+ public static CSchemaProcessor getInstance() {
+ return CSchemaProcessorHolder.INSTANCE;
}
/**
@@ -559,7 +559,7 @@ public class CSchemaEngine extends SchemaEngine {
if (ready[i]) {
continue;
}
- if (IoTDB.schemaEngine.isStorageGroup(storageGroups.get(i))) {
+ if (IoTDB.schemaProcessor.isStorageGroup(storageGroups.get(i))) {
ready[i] = true;
} else {
allReady = false;
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java
index aa11d14..e830922 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java
@@ -149,7 +149,7 @@ public class MetaPuller {
}
int preSize = results.size();
for (PartialPath prefixPath : prefixPaths) {
- IoTDB.schemaEngine.collectMeasurementSchema(prefixPath, results);
+ IoTDB.schemaProcessor.collectMeasurementSchema(prefixPath, results);
}
if (logger.isDebugEnabled()) {
logger.debug(
@@ -266,7 +266,7 @@ public class MetaPuller {
/**
* Pull the all timeseries schemas of given prefixPaths from remote nodes. All prefixPaths must
- * contain a storage group. The pulled schemas will be cache in CSchemaEngine.
+ * contain a storage group. The pulled schemas will be cache in CSchemaProcessor.
*
* @param ignoredGroup do not pull schema from the group to avoid backward dependency. If a user
* send an insert request before registering schemas, then this method may pull schemas from
@@ -319,7 +319,7 @@ public class MetaPuller {
* Pull timeseries schemas of "prefixPaths" from "partitionGroup". If this node is a member of
* "partitionGroup", synchronize with the group leader and collect local schemas. Otherwise pull
* schemas from one node in the group. If "timeseriesSchemas" is null, the pulled schemas will be
- * cached in CSchemaEngine.
+ * cached in CSchemaProcessor.
*/
public void pullTimeSeriesSchemas(
PartitionGroup partitionGroup,
@@ -352,8 +352,8 @@ public class MetaPuller {
}
/**
- * send the PullSchemaRequest to "node" and cache the results in CSchemaEngine or add the results
- * to "timeseriesSchemas" if they are successfully returned.
+ * send the PullSchemaRequest to "node" and cache the results in CSchemaProcessor or add the
+ * results to "timeseriesSchemas" if they are successfully returned.
*
* @return true if the pull succeeded, false otherwise
*/
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/partition/PartitionTable.java b/cluster/src/main/java/org/apache/iotdb/cluster/partition/PartitionTable.java
index 79edd8b..1ce35a9 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/partition/PartitionTable.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/partition/PartitionTable.java
@@ -124,7 +124,7 @@ public interface PartitionTable {
*/
default PartitionGroup partitionByPathTime(PartialPath path, long timestamp)
throws MetadataException {
- PartialPath storageGroup = IoTDB.schemaEngine.getBelongedStorageGroup(path);
+ PartialPath storageGroup = IoTDB.schemaProcessor.getBelongedStorageGroup(path);
return this.route(storageGroup.getFullPath(), timestamp);
}
@@ -138,7 +138,7 @@ public interface PartitionTable {
long partitionInterval = StorageEngine.getTimePartitionInterval();
MultiKeyMap<Long, PartitionGroup> timeRangeMapRaftGroup = new MultiKeyMap<>();
- PartialPath storageGroup = IoTDB.schemaEngine.getBelongedStorageGroup(path);
+ PartialPath storageGroup = IoTDB.schemaProcessor.getBelongedStorageGroup(path);
startTime = StorageEngine.convertMilliWithPrecision(startTime);
endTime = StorageEngine.convertMilliWithPrecision(endTime);
while (startTime <= endTime) {
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPhysicalGenerator.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPhysicalGenerator.java
index c588480..b61ab1b 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPhysicalGenerator.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPhysicalGenerator.java
@@ -20,7 +20,7 @@
package org.apache.iotdb.cluster.query;
import org.apache.iotdb.cluster.config.ClusterDescriptor;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.query.QueryProcessException;
@@ -50,8 +50,8 @@ public class ClusterPhysicalGenerator extends PhysicalGenerator {
private static final Logger logger = LoggerFactory.getLogger(ClusterPhysicalGenerator.class);
- private CSchemaEngine getCSchemaEngine() {
- return ((CSchemaEngine) IoTDB.schemaEngine);
+ private CSchemaProcessor getCSchemaProcessor() {
+ return ((CSchemaProcessor) IoTDB.schemaProcessor);
}
@Override
@@ -64,7 +64,7 @@ public class ClusterPhysicalGenerator extends PhysicalGenerator {
// update storage groups before parsing query plans
if (operator instanceof QueryOperator) {
try {
- getCSchemaEngine().syncMetaLeader();
+ getCSchemaProcessor().syncMetaLeader();
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
index 109ee19..8b149bb 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
@@ -26,7 +26,7 @@ import org.apache.iotdb.cluster.client.sync.SyncDataClient;
import org.apache.iotdb.cluster.config.ClusterConstant;
import org.apache.iotdb.cluster.config.ClusterDescriptor;
import org.apache.iotdb.cluster.exception.CheckConsistencyException;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.partition.PartitionGroup;
import org.apache.iotdb.cluster.partition.slot.SlotPartitionTable;
import org.apache.iotdb.cluster.query.filter.SlotSgFilter;
@@ -123,7 +123,7 @@ public class ClusterPlanExecutor extends PlanExecutor {
@Override
@TestOnly
protected List<MeasurementPath> getPathsName(PartialPath path) throws MetadataException {
- return ((CSchemaEngine) IoTDB.schemaEngine).getMatchedPaths(path);
+ return ((CSchemaProcessor) IoTDB.schemaProcessor).getMatchedPaths(path);
}
@Override
@@ -142,7 +142,7 @@ public class ClusterPlanExecutor extends PlanExecutor {
} catch (CheckConsistencyException e) {
throw new MetadataException(e);
}
- Map<String, List<PartialPath>> sgPathMap = IoTDB.schemaEngine.groupPathByStorageGroup(path);
+ Map<String, List<PartialPath>> sgPathMap = IoTDB.schemaProcessor.groupPathByStorageGroup(path);
if (sgPathMap.isEmpty()) {
throw new PathNotExistException(path.getFullPath());
}
@@ -235,7 +235,7 @@ public class ClusterPlanExecutor extends PlanExecutor {
}
private int getLocalDeviceCount(PartialPath path) throws MetadataException {
- return IoTDB.schemaEngine.getDevicesNum(path);
+ return IoTDB.schemaProcessor.getDevicesNum(path);
}
private int getRemoteDeviceCount(PartitionGroup partitionGroup, List<String> pathsToCount)
@@ -331,7 +331,7 @@ public class ClusterPlanExecutor extends PlanExecutor {
wildcardPath = wildcardPath.concatNode(IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD);
}
Map<String, List<PartialPath>> sgPathMap =
- IoTDB.schemaEngine.groupPathByStorageGroup(wildcardPath);
+ IoTDB.schemaProcessor.groupPathByStorageGroup(wildcardPath);
if (sgPathMap.isEmpty()) {
return 0;
}
@@ -459,9 +459,9 @@ public class ClusterPlanExecutor extends PlanExecutor {
private int getLocalPathCount(PartialPath path, int level) throws MetadataException {
int localResult;
if (level == -1) {
- localResult = IoTDB.schemaEngine.getAllTimeseriesCount(path);
+ localResult = IoTDB.schemaProcessor.getAllTimeseriesCount(path);
} else {
- localResult = IoTDB.schemaEngine.getNodesCountInGivenLevel(path, level);
+ localResult = IoTDB.schemaProcessor.getNodesCountInGivenLevel(path, level);
}
return localResult;
}
@@ -569,7 +569,7 @@ public class ClusterPlanExecutor extends PlanExecutor {
DataGroupMember localDataMember = metaGroupMember.getLocalDataMember(group.getHeader());
localDataMember.syncLeaderWithConsistencyCheck(false);
try {
- return IoTDB.schemaEngine.getNodesListInGivenLevel(
+ return IoTDB.schemaProcessor.getNodesListInGivenLevel(
schemaPattern,
level,
new SlotSgFilter(
@@ -678,7 +678,7 @@ public class ClusterPlanExecutor extends PlanExecutor {
metaGroupMember.getLocalDataMember(group.getHeader(), group.getRaftId());
localDataMember.syncLeaderWithConsistencyCheck(false);
try {
- return IoTDB.schemaEngine.getChildNodeNameInNextLevel(path);
+ return IoTDB.schemaProcessor.getChildNodeNameInNextLevel(path);
} catch (MetadataException e) {
logger.error("Cannot not get next children nodes of {} from {} locally", path, group);
return Collections.emptySet();
@@ -803,7 +803,7 @@ public class ClusterPlanExecutor extends PlanExecutor {
DataGroupMember localDataMember = metaGroupMember.getLocalDataMember(group.getHeader());
localDataMember.syncLeaderWithConsistencyCheck(false);
try {
- return IoTDB.schemaEngine.getChildNodePathInNextLevel(path);
+ return IoTDB.schemaProcessor.getChildNodePathInNextLevel(path);
} catch (MetadataException e) {
logger.error("Cannot not get next children of {} from {} locally", path, group);
return Collections.emptySet();
@@ -868,7 +868,7 @@ public class ClusterPlanExecutor extends PlanExecutor {
} catch (CheckConsistencyException e) {
logger.warn("Failed to check consistency.", e);
}
- return IoTDB.schemaEngine.getAllStorageGroupNodes();
+ return IoTDB.schemaProcessor.getAllStorageGroupNodes();
}
@Override
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanRouter.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanRouter.java
index 88819c0..3dfa431 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanRouter.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanRouter.java
@@ -31,7 +31,7 @@ import org.apache.iotdb.cluster.utils.PartitionUtils;
import org.apache.iotdb.commons.utils.TestOnly;
import org.apache.iotdb.db.engine.StorageEngine;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.apache.iotdb.db.qp.physical.crud.InsertMultiTabletPlan;
@@ -71,8 +71,8 @@ public class ClusterPlanRouter {
this.partitionTable = partitionTable;
}
- private SchemaEngine SchemaEngine() {
- return IoTDB.schemaEngine;
+ private LocalSchemaProcessor SchemaProcessor() {
+ return IoTDB.schemaProcessor;
}
@TestOnly
@@ -108,7 +108,7 @@ public class ClusterPlanRouter {
private PartitionGroup routePlan(ShowChildPathsPlan plan) {
try {
return partitionTable.route(
- SchemaEngine().getBelongedStorageGroup(plan.getPath()).getFullPath(), 0);
+ SchemaProcessor().getBelongedStorageGroup(plan.getPath()).getFullPath(), 0);
} catch (MetadataException e) {
// the path is too short to have no a storage group name, e.g., "root"
// so we can do it locally.
@@ -218,7 +218,8 @@ public class ClusterPlanRouter {
InsertTabletPlan tmpPlan = (InsertTabletPlan) entry.getKey();
PartitionGroup tmpPg = entry.getValue();
// 1.1 the sg that the plan(actually calculated based on device) belongs to
- PartialPath tmpSgPath = IoTDB.schemaEngine.getBelongedStorageGroup(tmpPlan.getDevicePath());
+ PartialPath tmpSgPath =
+ IoTDB.schemaProcessor.getBelongedStorageGroup(tmpPlan.getDevicePath());
Map<PartialPath, InsertMultiTabletPlan> sgPathPlanMap = pgSgPathPlanMap.get(tmpPg);
if (sgPathPlanMap == null) {
// 2.1 construct the InsertMultiTabletPlan
@@ -279,7 +280,7 @@ public class ClusterPlanRouter {
Map<PartitionGroup, InsertRowsPlan> groupPlanMap = new HashMap<>();
for (int i = 0; i < insertRowsPlan.getInsertRowPlanList().size(); i++) {
InsertRowPlan rowPlan = insertRowsPlan.getInsertRowPlanList().get(i);
- PartialPath storageGroup = SchemaEngine().getBelongedStorageGroup(rowPlan.getDevicePath());
+ PartialPath storageGroup = SchemaProcessor().getBelongedStorageGroup(rowPlan.getDevicePath());
PartitionGroup group = partitionTable.route(storageGroup.getFullPath(), rowPlan.getTime());
if (groupPlanMap.containsKey(group)) {
InsertRowsPlan tmpPlan = groupPlanMap.get(group);
@@ -300,7 +301,7 @@ public class ClusterPlanRouter {
@SuppressWarnings("SuspiciousSystemArraycopy")
private Map<PhysicalPlan, PartitionGroup> splitAndRoutePlan(InsertTabletPlan plan)
throws MetadataException {
- PartialPath storageGroup = SchemaEngine().getBelongedStorageGroup(plan.getDevicePath());
+ PartialPath storageGroup = SchemaProcessor().getBelongedStorageGroup(plan.getDevicePath());
Map<PhysicalPlan, PartitionGroup> result = new HashMap<>();
long[] times = plan.getTimes();
if (times.length == 0) {
@@ -481,7 +482,7 @@ public class ClusterPlanRouter {
Map<PhysicalPlan, PartitionGroup> result = new HashMap<>();
Map<PartitionGroup, List<InsertRowPlan>> groupPlanMap = new HashMap<>();
Map<PartitionGroup, List<Integer>> groupPlanIndexMap = new HashMap<>();
- PartialPath storageGroup = SchemaEngine().getBelongedStorageGroup(plan.getDevicePath());
+ PartialPath storageGroup = SchemaProcessor().getBelongedStorageGroup(plan.getDevicePath());
for (int i = 0; i < plan.getRowPlans().length; i++) {
InsertRowPlan p = plan.getRowPlans()[i];
PartitionGroup group = partitionTable.route(storageGroup.getFullPath(), p.getTime());
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/LocalQueryExecutor.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/LocalQueryExecutor.java
index dfbad17..d00ea80 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/LocalQueryExecutor.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/LocalQueryExecutor.java
@@ -21,7 +21,7 @@ package org.apache.iotdb.cluster.query;
import org.apache.iotdb.cluster.exception.CheckConsistencyException;
import org.apache.iotdb.cluster.exception.ReaderNotFoundException;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.metadata.MetaPuller;
import org.apache.iotdb.cluster.partition.PartitionGroup;
import org.apache.iotdb.cluster.partition.slot.SlotPartitionTable;
@@ -111,8 +111,8 @@ public class LocalQueryExecutor {
this.queryManager = dataGroupMember.getQueryManager();
}
- private CSchemaEngine getCSchemaEngine() {
- return ((CSchemaEngine) IoTDB.schemaEngine);
+ private CSchemaProcessor getCSchemaProcessor() {
+ return ((CSchemaProcessor) IoTDB.schemaProcessor);
}
/** Return the data of the reader whose id is "readerId", using timestamps in "timeBuffer". */
@@ -225,7 +225,7 @@ public class LocalQueryExecutor {
// The request is routed to this node since this node contains the data and
// metadata of the designated timeseries. Because of which, the following metadata access will
// not trigger an RPC.
- path.setMeasurementSchema(IoTDB.schemaEngine.getSeriesSchema(path));
+ path.setMeasurementSchema(IoTDB.schemaProcessor.getSeriesSchema(path));
TSDataType dataType = TSDataType.values()[request.getDataTypeOrdinal()];
Filter timeFilter = null;
Filter valueFilter = null;
@@ -313,7 +313,7 @@ public class LocalQueryExecutor {
// The request is routed to this node since this node contains the data and
// metadata of the designated timeseries. Because of which, the following metadata access will
// not trigger an RPC.
- path.setMeasurementSchema(IoTDB.schemaEngine.getSeriesSchema(path));
+ path.setMeasurementSchema(IoTDB.schemaProcessor.getSeriesSchema(path));
paths.add(path);
dataTypes.add(TSDataType.values()[request.getDataTypeOrdinal().get(i)]);
}
@@ -485,7 +485,7 @@ public class LocalQueryExecutor {
.computeIfAbsent(slotPreviousHolderMap.get(slot), s -> new ArrayList<>())
.add(new PartialPath(prefixPath));
} else {
- getCSchemaEngine()
+ getCSchemaProcessor()
.collectMeasurementSchema(new PartialPath(prefixPath), measurementSchemas);
}
}
@@ -524,7 +524,8 @@ public class LocalQueryExecutor {
.computeIfAbsent(slotPreviousHolderMap.get(slot), s -> new ArrayList<>())
.add(prefixPath);
} else {
- getCSchemaEngine().collectTimeseriesSchema(new PartialPath(prefixPath), timeseriesSchemas);
+ getCSchemaProcessor()
+ .collectTimeseriesSchema(new PartialPath(prefixPath), timeseriesSchemas);
}
}
@@ -560,7 +561,7 @@ public class LocalQueryExecutor {
// The request is routed to this node since this node contains the data and
// metadata of the designated timeseries. Because of which, the following metadata access will
// not trigger an RPC.
- path.setMeasurementSchema(IoTDB.schemaEngine.getSeriesSchema(path));
+ path.setMeasurementSchema(IoTDB.schemaProcessor.getSeriesSchema(path));
TSDataType dataType = TSDataType.values()[request.dataTypeOrdinal];
Set<String> deviceMeasurements = request.getDeviceMeasurements();
@@ -611,7 +612,7 @@ public class LocalQueryExecutor {
List<ShowTimeSeriesResult> allTimeseriesSchema;
RemoteQueryContext queryContext =
queryManager.getQueryContext(request.getRequester(), request.getQueryId());
- allTimeseriesSchema = getCSchemaEngine().showLocalTimeseries(plan, queryContext);
+ allTimeseriesSchema = getCSchemaProcessor().showLocalTimeseries(plan, queryContext);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try (DataOutputStream dataOutputStream = new DataOutputStream(outputStream)) {
@@ -627,7 +628,7 @@ public class LocalQueryExecutor {
throws CheckConsistencyException, IOException, MetadataException {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
ShowDevicesPlan plan = (ShowDevicesPlan) PhysicalPlan.Factory.create(planBuffer);
- List<ShowDevicesResult> allDevicesResult = getCSchemaEngine().getLocalDevices(plan);
+ List<ShowDevicesResult> allDevicesResult = getCSchemaProcessor().getLocalDevices(plan);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try (DataOutputStream dataOutputStream = new DataOutputStream(outputStream)) {
@@ -768,7 +769,7 @@ public class LocalQueryExecutor {
for (String seriesPath : timeseriesList) {
try {
List<MeasurementPath> path =
- getCSchemaEngine().getMeasurementPaths(new PartialPath(seriesPath));
+ getCSchemaProcessor().getMeasurementPaths(new PartialPath(seriesPath));
if (path.size() != 1) {
throw new MetadataException(
String.format("Timeseries number of the name [%s] is not 1.", seriesPath));
@@ -1008,9 +1009,9 @@ public class LocalQueryExecutor {
int count = 0;
for (String s : pathsToQuery) {
if (level == -1) {
- count += getCSchemaEngine().getAllTimeseriesCount(new PartialPath(s));
+ count += getCSchemaProcessor().getAllTimeseriesCount(new PartialPath(s));
} else {
- count += getCSchemaEngine().getNodesCountInGivenLevel(new PartialPath(s), level);
+ count += getCSchemaProcessor().getNodesCountInGivenLevel(new PartialPath(s), level);
}
}
return count;
@@ -1022,7 +1023,7 @@ public class LocalQueryExecutor {
int count = 0;
for (String s : pathsToQuery) {
- count += getCSchemaEngine().getDevicesNum(new PartialPath(s));
+ count += getCSchemaProcessor().getDevicesNum(new PartialPath(s));
}
return count;
}
@@ -1039,7 +1040,7 @@ public class LocalQueryExecutor {
for (String path : request.getPaths()) {
PartialPath partialPath = new PartialPath(path);
seriesPaths.add(
- new MeasurementPath(partialPath, IoTDB.schemaEngine.getSeriesSchema(partialPath)));
+ new MeasurementPath(partialPath, IoTDB.schemaProcessor.getSeriesSchema(partialPath)));
}
List<TSDataType> dataTypes = new ArrayList<>(request.dataTypeOrdinals.size());
for (Integer dataTypeOrdinal : request.dataTypeOrdinals) {
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/filter/SlotSgFilter.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/filter/SlotSgFilter.java
index d336822..4e8f67d 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/filter/SlotSgFilter.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/filter/SlotSgFilter.java
@@ -21,7 +21,7 @@ package org.apache.iotdb.cluster.query.filter;
import org.apache.iotdb.cluster.config.ClusterConstant;
import org.apache.iotdb.cluster.partition.slot.SlotPartitionTable;
-import org.apache.iotdb.db.metadata.SchemaEngine.StorageGroupFilter;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor.StorageGroupFilter;
import java.util.List;
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterTimeGenerator.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterTimeGenerator.java
index 500d43e..c2f117f 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterTimeGenerator.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterTimeGenerator.java
@@ -111,7 +111,7 @@ public class ClusterTimeGenerator extends ServerTimeGenerator {
TSDataType dataType;
ManagedSeriesReader mergeReader;
try {
- dataType = IoTDB.schemaEngine.getSeriesType(path);
+ dataType = IoTDB.schemaProcessor.getSeriesType(path);
mergeReader =
readerFactory.getSeriesReader(
path,
@@ -173,7 +173,7 @@ public class ClusterTimeGenerator extends ServerTimeGenerator {
PartialPath path = (PartialPath) expression.getSeriesPath();
TSDataType dataType;
try {
- dataType = IoTDB.schemaEngine.getSeriesType(path);
+ dataType = IoTDB.schemaProcessor.getSeriesType(path);
List<PartitionGroup> partitionGroups = metaGroupMember.routeFilter(null, path);
for (PartitionGroup partitionGroup : partitionGroups) {
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/DataGroupMember.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/DataGroupMember.java
index ec305cd..66d8143 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/DataGroupMember.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/DataGroupMember.java
@@ -42,7 +42,7 @@ import org.apache.iotdb.cluster.log.snapshot.FileSnapshot;
import org.apache.iotdb.cluster.log.snapshot.PartitionedSnapshot;
import org.apache.iotdb.cluster.log.snapshot.PullSnapshotTask;
import org.apache.iotdb.cluster.log.snapshot.PullSnapshotTaskDescriptor;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.partition.NodeAdditionResult;
import org.apache.iotdb.cluster.partition.NodeRemovalResult;
import org.apache.iotdb.cluster.partition.PartitionGroup;
@@ -876,7 +876,7 @@ public class DataGroupMember extends RaftMember implements DataGroupMemberMBean
plan.getPlanFromFailed();
}
- return ((CSchemaEngine) IoTDB.schemaEngine).createTimeseries(plan);
+ return ((CSchemaProcessor) IoTDB.schemaProcessor).createTimeseries(plan);
}
/**
@@ -889,7 +889,7 @@ public class DataGroupMember extends RaftMember implements DataGroupMemberMBean
}
Set<Integer> slotSet = new HashSet<>(slots);
- List<PartialPath> allStorageGroupNames = IoTDB.schemaEngine.getAllStorageGroupPaths();
+ List<PartialPath> allStorageGroupNames = IoTDB.schemaProcessor.getAllStorageGroupPaths();
TimePartitionFilter filter =
(storageGroupName, timePartitionId) -> {
int slot =
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
index 6b80479..a241192 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
@@ -1430,7 +1430,7 @@ public class MetaGroupMember extends RaftMember implements IService, MetaGroupMe
List<PartitionGroup> partitionGroups = new ArrayList<>();
PartialPath storageGroupName;
try {
- storageGroupName = IoTDB.schemaEngine.getBelongedStorageGroup(path);
+ storageGroupName = IoTDB.schemaProcessor.getBelongedStorageGroup(path);
} catch (MetadataException e) {
throw new StorageEngineException(e);
}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataAsyncService.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataAsyncService.java
index 11f026f..bb4ad10 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataAsyncService.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataAsyncService.java
@@ -24,7 +24,7 @@ import org.apache.iotdb.cluster.config.ClusterConstant;
import org.apache.iotdb.cluster.exception.CheckConsistencyException;
import org.apache.iotdb.cluster.exception.LeaderUnknownException;
import org.apache.iotdb.cluster.exception.ReaderNotFoundException;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.rpc.thrift.GetAggrResultRequest;
import org.apache.iotdb.cluster.rpc.thrift.GetAllPathsResult;
import org.apache.iotdb.cluster.rpc.thrift.GroupByRequest;
@@ -297,7 +297,8 @@ public class DataAsyncService extends BaseAsyncService implements TSDataService.
AsyncMethodCallback<GetAllPathsResult> resultHandler) {
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
- resultHandler.onComplete(((CSchemaEngine) IoTDB.schemaEngine).getAllPaths(paths, withAlias));
+ resultHandler.onComplete(
+ ((CSchemaProcessor) IoTDB.schemaProcessor).getAllPaths(paths, withAlias));
} catch (MetadataException | CheckConsistencyException e) {
resultHandler.onError(e);
}
@@ -312,7 +313,7 @@ public class DataAsyncService extends BaseAsyncService implements TSDataService.
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
resultHandler.onComplete(
- ((CSchemaEngine) IoTDB.schemaEngine).getAllDevices(path, isPrefixMatch));
+ ((CSchemaProcessor) IoTDB.schemaProcessor).getAllDevices(path, isPrefixMatch));
} catch (MetadataException | CheckConsistencyException e) {
resultHandler.onError(e);
}
@@ -336,7 +337,8 @@ public class DataAsyncService extends BaseAsyncService implements TSDataService.
AsyncMethodCallback<List<String>> resultHandler) {
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
- resultHandler.onComplete(((CSchemaEngine) IoTDB.schemaEngine).getNodeList(path, nodeLevel));
+ resultHandler.onComplete(
+ ((CSchemaProcessor) IoTDB.schemaProcessor).getNodeList(path, nodeLevel));
} catch (CheckConsistencyException | MetadataException e) {
resultHandler.onError(e);
}
@@ -347,7 +349,8 @@ public class DataAsyncService extends BaseAsyncService implements TSDataService.
RaftNode header, String path, AsyncMethodCallback<Set<String>> resultHandler) {
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
- resultHandler.onComplete(((CSchemaEngine) IoTDB.schemaEngine).getChildNodeInNextLevel(path));
+ resultHandler.onComplete(
+ ((CSchemaProcessor) IoTDB.schemaProcessor).getChildNodeInNextLevel(path));
} catch (CheckConsistencyException | MetadataException e) {
resultHandler.onError(e);
}
@@ -359,7 +362,7 @@ public class DataAsyncService extends BaseAsyncService implements TSDataService.
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
resultHandler.onComplete(
- ((CSchemaEngine) IoTDB.schemaEngine).getChildNodePathInNextLevel(path));
+ ((CSchemaProcessor) IoTDB.schemaProcessor).getChildNodePathInNextLevel(path));
} catch (CheckConsistencyException | MetadataException e) {
resultHandler.onError(e);
}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
index 61e478a..748382f 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
@@ -24,7 +24,7 @@ import org.apache.iotdb.cluster.config.ClusterConstant;
import org.apache.iotdb.cluster.exception.CheckConsistencyException;
import org.apache.iotdb.cluster.exception.LeaderUnknownException;
import org.apache.iotdb.cluster.exception.ReaderNotFoundException;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.rpc.thrift.GetAggrResultRequest;
import org.apache.iotdb.cluster.rpc.thrift.GetAllPathsResult;
import org.apache.iotdb.cluster.rpc.thrift.GroupByRequest;
@@ -287,7 +287,7 @@ public class DataSyncService extends BaseSyncService implements TSDataService.If
throws TException {
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
- return ((CSchemaEngine) IoTDB.schemaEngine).getAllPaths(paths, withAlias);
+ return ((CSchemaProcessor) IoTDB.schemaProcessor).getAllPaths(paths, withAlias);
} catch (MetadataException | CheckConsistencyException e) {
throw new TException(e);
}
@@ -298,7 +298,7 @@ public class DataSyncService extends BaseSyncService implements TSDataService.If
throws TException {
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
- return ((CSchemaEngine) IoTDB.schemaEngine).getAllDevices(path, isPrefixMatch);
+ return ((CSchemaProcessor) IoTDB.schemaProcessor).getAllDevices(path, isPrefixMatch);
} catch (MetadataException | CheckConsistencyException e) {
throw new TException(e);
}
@@ -317,7 +317,7 @@ public class DataSyncService extends BaseSyncService implements TSDataService.If
public List<String> getNodeList(RaftNode header, String path, int nodeLevel) throws TException {
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
- return ((CSchemaEngine) IoTDB.schemaEngine).getNodeList(path, nodeLevel);
+ return ((CSchemaProcessor) IoTDB.schemaProcessor).getNodeList(path, nodeLevel);
} catch (CheckConsistencyException | MetadataException e) {
throw new TException(e);
}
@@ -327,7 +327,7 @@ public class DataSyncService extends BaseSyncService implements TSDataService.If
public Set<String> getChildNodeInNextLevel(RaftNode header, String path) throws TException {
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
- return ((CSchemaEngine) IoTDB.schemaEngine).getChildNodeInNextLevel(path);
+ return ((CSchemaProcessor) IoTDB.schemaProcessor).getChildNodeInNextLevel(path);
} catch (CheckConsistencyException | MetadataException e) {
throw new TException(e);
}
@@ -337,7 +337,7 @@ public class DataSyncService extends BaseSyncService implements TSDataService.If
public Set<String> getChildNodePathInNextLevel(RaftNode header, String path) throws TException {
try {
dataGroupMember.syncLeaderWithConsistencyCheck(false);
- return ((CSchemaEngine) IoTDB.schemaEngine).getChildNodePathInNextLevel(path);
+ return ((CSchemaProcessor) IoTDB.schemaProcessor).getChildNodePathInNextLevel(path);
} catch (CheckConsistencyException | MetadataException e) {
throw new TException(e);
}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterQueryUtils.java b/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterQueryUtils.java
index 4ad2332..56435ab 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterQueryUtils.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterQueryUtils.java
@@ -44,7 +44,7 @@ public class ClusterQueryUtils {
}
public static void checkPathExistence(PartialPath path) throws QueryProcessException {
- if (!IoTDB.schemaEngine.isPathExist(path)) {
+ if (!IoTDB.schemaProcessor.isPathExist(path)) {
try {
MetaPuller.getInstance().pullTimeSeriesSchemas(Collections.singletonList(path), null);
} catch (MetadataException e) {
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterUtils.java b/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterUtils.java
index 55cb8ac..2b098a1 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterUtils.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterUtils.java
@@ -323,7 +323,7 @@ public class ClusterUtils {
PartialPath prefixPath, MetaGroupMember metaGroupMember) throws MetadataException {
int slot;
try {
- PartialPath storageGroup = IoTDB.schemaEngine.getBelongedStorageGroup(prefixPath);
+ PartialPath storageGroup = IoTDB.schemaProcessor.getBelongedStorageGroup(prefixPath);
slot =
SlotPartitionTable.getSlotStrategy()
.calculateSlotByPartitionNum(storageGroup.getFullPath(), 0, ClusterConstant.SLOT_NUM);
@@ -335,7 +335,7 @@ public class ClusterUtils {
} catch (CheckConsistencyException checkConsistencyException) {
throw new MetadataException(checkConsistencyException.getMessage());
}
- PartialPath storageGroup = IoTDB.schemaEngine.getBelongedStorageGroup(prefixPath);
+ PartialPath storageGroup = IoTDB.schemaProcessor.getBelongedStorageGroup(prefixPath);
slot =
SlotPartitionTable.getSlotStrategy()
.calculateSlotByPartitionNum(storageGroup.getFullPath(), 0, ClusterConstant.SLOT_NUM);
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplierTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplierTest.java
index e764ebd..f5b148a 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplierTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplierTest.java
@@ -54,7 +54,7 @@ public class AsyncDataLogApplierTest {
appliedLogs = new ConcurrentSkipListSet<>();
IoTDB.configManager.init();
for (int i = 0; i < 10; i++) {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(TestUtils.getTestSg(i)));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(TestUtils.getTestSg(i)));
}
}
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/DataLogApplierTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/DataLogApplierTest.java
index 63eab72..8fa0ad7 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/DataLogApplierTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/DataLogApplierTest.java
@@ -31,7 +31,7 @@ import org.apache.iotdb.cluster.common.TestUtils;
import org.apache.iotdb.cluster.coordinator.Coordinator;
import org.apache.iotdb.cluster.log.logtypes.CloseFileLog;
import org.apache.iotdb.cluster.log.logtypes.PhysicalPlanLog;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.metadata.MetaPuller;
import org.apache.iotdb.cluster.partition.PartitionGroup;
import org.apache.iotdb.cluster.partition.slot.SlotPartitionTable;
@@ -115,7 +115,7 @@ public class DataLogApplierTest extends IoTDBTest {
public boolean syncLeader(RaftMember.CheckConsistency checkConsistency) {
try {
// for testApplyCreateMultiTimeseiresWithPulling()
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.sg2"));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.sg2"));
} catch (StorageGroupAlreadySetException e) {
logger.warn("[may ignore me in tests] {}", e.getMessage(), e);
} catch (MetadataException e) {
@@ -158,7 +158,7 @@ public class DataLogApplierTest extends IoTDBTest {
@Override
@Before
public void setUp() throws StartupException, QueryProcessException, IllegalPathException {
- IoTDB.setSchemaEngine(CSchemaEngine.getInstance());
+ IoTDB.setSchemaProcessor(CSchemaProcessor.getInstance());
testMetaGroupMember.setCoordinator(new Coordinator());
MetaPuller.getInstance().init(testMetaGroupMember);
super.setUp();
@@ -276,7 +276,7 @@ public class DataLogApplierTest extends IoTDBTest {
public void returnSyncClient(
RaftService.Client client, Node node, ClientCategory category) {}
});
- ((CSchemaEngine) IoTDB.schemaEngine).setMetaGroupMember(testMetaGroupMember);
+ ((CSchemaProcessor) IoTDB.schemaProcessor).setMetaGroupMember(testMetaGroupMember);
testDataGroupMember.setMetaGroupMember(testMetaGroupMember);
applier = new DataLogApplier(testMetaGroupMember, testDataGroupMember);
}
@@ -439,7 +439,7 @@ public class DataLogApplierTest extends IoTDBTest {
@Test
public void testApplyCreateMultiTimeseiresWithPulling() throws MetadataException {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.sg1"));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.sg1"));
CreateMultiTimeSeriesPlan multiTimeSeriesPlan = new CreateMultiTimeSeriesPlan();
multiTimeSeriesPlan.setIndexes(Collections.emptyList());
multiTimeSeriesPlan.setPaths(
@@ -455,7 +455,8 @@ public class DataLogApplierTest extends IoTDBTest {
PhysicalPlanLog log = new PhysicalPlanLog(multiTimeSeriesPlan);
// the applier should sync meta leader to get root.sg2 and report no error
applier.apply(log);
- assertTrue(IoTDB.schemaEngine.getAllStorageGroupPaths().contains(new PartialPath("root.sg2")));
+ assertTrue(
+ IoTDB.schemaProcessor.getAllStorageGroupPaths().contains(new PartialPath("root.sg2")));
assertNull(log.getException());
}
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/MetaLogApplierTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/MetaLogApplierTest.java
index f0c5e67..5c77c77 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/MetaLogApplierTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/applier/MetaLogApplierTest.java
@@ -113,7 +113,7 @@ public class MetaLogApplierTest extends IoTDBTest {
physicalPlanLog.setPlan(setStorageGroupPlan);
applier.apply(physicalPlanLog);
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath("root.applyMeta")));
+ assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath("root.applyMeta")));
CreateTimeSeriesPlan createTimeSeriesPlan =
new CreateTimeSeriesPlan(
@@ -127,9 +127,9 @@ public class MetaLogApplierTest extends IoTDBTest {
null);
physicalPlanLog.setPlan(createTimeSeriesPlan);
applier.apply(physicalPlanLog);
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath("root.applyMeta.s1")));
+ assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath("root.applyMeta.s1")));
assertEquals(
TSDataType.DOUBLE,
- IoTDB.schemaEngine.getSeriesType(new PartialPath("root" + ".applyMeta.s1")));
+ IoTDB.schemaProcessor.getSeriesType(new PartialPath("root" + ".applyMeta.s1")));
}
}
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/DataSnapshotTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/DataSnapshotTest.java
index 26ddd20..5485506 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/DataSnapshotTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/DataSnapshotTest.java
@@ -179,7 +179,7 @@ public abstract class DataSnapshotTest {
dataGroupMember.setLogManager(new TestLogManager(0));
EnvironmentUtils.envSetUp();
for (int i = 0; i < 10; i++) {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(TestUtils.getTestSg(i)));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(TestUtils.getTestSg(i)));
}
addNetFailure = false;
}
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshotTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshotTest.java
index 407c373..8919016 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshotTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshotTest.java
@@ -114,7 +114,8 @@ public class FileSnapshotTest extends DataSnapshotTest {
assertEquals(SlotStatus.NULL, dataGroupMember.getSlotManager().getStatus(0));
for (TimeseriesSchema timeseriesSchema : timeseriesSchemas) {
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ assertTrue(
+ IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
}
VirtualStorageGroupProcessor processor =
StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
@@ -157,7 +158,8 @@ public class FileSnapshotTest extends DataSnapshotTest {
assertEquals(SlotStatus.NULL, dataGroupMember.getSlotManager().getStatus(0));
for (TimeseriesSchema timeseriesSchema : timeseriesSchemas) {
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ assertTrue(
+ IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
}
VirtualStorageGroupProcessor processor =
StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
@@ -206,7 +208,8 @@ public class FileSnapshotTest extends DataSnapshotTest {
assertEquals(SlotStatus.NULL, dataGroupMember.getSlotManager().getStatus(0));
for (TimeseriesSchema timeseriesSchema : timeseriesSchemas) {
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ assertTrue(
+ IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
}
VirtualStorageGroupProcessor processor =
StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
@@ -291,7 +294,8 @@ public class FileSnapshotTest extends DataSnapshotTest {
defaultInstaller.install(snapshot, 0, false);
for (TimeseriesSchema timeseriesSchema : timeseriesSchemas) {
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ assertTrue(
+ IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
}
VirtualStorageGroupProcessor processor =
StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshotTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshotTest.java
index 062c600..8d151bc 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshotTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshotTest.java
@@ -199,7 +199,7 @@ public class MetaSimpleSnapshotTest extends IoTDBTest {
SnapshotInstaller defaultInstaller = metaSimpleSnapshot.getDefaultInstaller(metaGroupMember);
defaultInstaller.install(metaSimpleSnapshot, -1, false);
- Map<PartialPath, Long> storageGroupsTTL = IoTDB.schemaEngine.getStorageGroupsTTL();
+ Map<PartialPath, Long> storageGroupsTTL = IoTDB.schemaProcessor.getStorageGroupsTTL();
for (int i = 0; i < 10; i++) {
PartialPath partialPath = new PartialPath("root.ln.sg" + i);
assertEquals(i, (long) storageGroupsTTL.get(partialPath));
@@ -307,7 +307,7 @@ public class MetaSimpleSnapshotTest extends IoTDBTest {
SnapshotInstaller defaultInstaller = metaSimpleSnapshot.getDefaultInstaller(metaGroupMember);
defaultInstaller.install(metaSimpleSnapshot, -1, false);
- Map<PartialPath, Long> storageGroupsTTL = IoTDB.schemaEngine.getStorageGroupsTTL();
+ Map<PartialPath, Long> storageGroupsTTL = IoTDB.schemaProcessor.getStorageGroupsTTL();
for (int i = 0; i < 10; i++) {
PartialPath partialPath = new PartialPath("root.ln.sg" + i);
assertNull(storageGroupsTTL.get(partialPath));
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PartitionedSnapshotTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PartitionedSnapshotTest.java
index fd241f5..7ff6c58 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PartitionedSnapshotTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PartitionedSnapshotTest.java
@@ -107,7 +107,8 @@ public class PartitionedSnapshotTest extends DataSnapshotTest {
}
for (TimeseriesSchema timeseriesSchema : timeseriesSchemas) {
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ assertTrue(
+ IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
}
VirtualStorageGroupProcessor processor =
StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
@@ -184,7 +185,7 @@ public class PartitionedSnapshotTest extends DataSnapshotTest {
for (TimeseriesSchema timeseriesSchema : timeseriesSchemas) {
assertFalse(
- IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
}
VirtualStorageGroupProcessor processor =
StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java
index c5afe2b..6701148 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java
@@ -289,7 +289,8 @@ public class PullSnapshotTaskTest extends DataSnapshotTest {
task.call();
for (TimeseriesSchema timeseriesSchema : timeseriesSchemas) {
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ assertTrue(
+ IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
}
VirtualStorageGroupProcessor processor =
StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/partition/SchemaEngineWhiteBox.java b/cluster/src/test/java/org/apache/iotdb/cluster/partition/SchemaProcessorWhiteBox.java
similarity index 67%
rename from cluster/src/test/java/org/apache/iotdb/cluster/partition/SchemaEngineWhiteBox.java
rename to cluster/src/test/java/org/apache/iotdb/cluster/partition/SchemaProcessorWhiteBox.java
index 8476fa7..abd29cb 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/partition/SchemaEngineWhiteBox.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/partition/SchemaProcessorWhiteBox.java
@@ -18,7 +18,7 @@
*/
package org.apache.iotdb.cluster.partition;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.powermock.reflect.Whitebox;
@@ -26,26 +26,26 @@ import java.io.File;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
-public class SchemaEngineWhiteBox {
+public class SchemaProcessorWhiteBox {
- public static SchemaEngine newSchemaEngine(String logFilePath) {
- Constructor<SchemaEngine> constructor = getSchemaEngineConstructor();
+ public static LocalSchemaProcessor newSchemaProcessor(String logFilePath) {
+ Constructor<LocalSchemaProcessor> constructor = getSchemaProcessorConstructor();
constructor.setAccessible(true);
try {
- SchemaEngine schemaEngine = constructor.newInstance();
+ LocalSchemaProcessor schemaProcessor = constructor.newInstance();
new File(logFilePath).getParentFile().mkdirs();
- Whitebox.setInternalState(schemaEngine, "logFilePath", logFilePath);
- // schemaEngine.initForMultiSchemaEngineTest();
- return schemaEngine;
+ Whitebox.setInternalState(schemaProcessor, "logFilePath", logFilePath);
+ // schemaProcessor.initForMultiSchemaProcessorTest();
+ return schemaProcessor;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
- private static Constructor<SchemaEngine> getSchemaEngineConstructor() {
+ private static Constructor<LocalSchemaProcessor> getSchemaProcessorConstructor() {
try {
- return SchemaEngine.class.getDeclaredConstructor();
+ return LocalSchemaProcessor.class.getDeclaredConstructor();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/partition/SlotPartitionTableTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/partition/SlotPartitionTableTest.java
index 38a0057..bfd7c10 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/partition/SlotPartitionTableTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/partition/SlotPartitionTableTest.java
@@ -33,7 +33,7 @@ import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.query.QueryProcessException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
import org.apache.iotdb.db.qp.logical.sys.AuthorOperator.AuthorType;
@@ -96,7 +96,7 @@ public class SlotPartitionTableTest {
Node localNode;
int replica_size = 5;
int raftId = 0;
- SchemaEngine[] schemaEngines;
+ LocalSchemaProcessor[] schemaProcessors;
SlotPartitionTable[] tables; // The PartitionTable on each node.
List<Node> nodes;
@@ -119,7 +119,7 @@ public class SlotPartitionTableTest {
prevReplicaNum = ClusterDescriptor.getInstance().getConfig().getReplicationNum();
ClusterDescriptor.getInstance().getConfig().setReplicationNum(replica_size);
tables = new SlotPartitionTable[20];
- schemaEngines = new SchemaEngine[20];
+ schemaProcessors = new LocalSchemaProcessor[20];
// suppose there are 40 storage groups and each node maintains two of them.
String[] storageNames = new String[40];
@@ -141,23 +141,23 @@ public class SlotPartitionTableTest {
nodeSGs[node.getNode().getMetaPort() - 30000].add(storageNames[i + 20]);
}
for (int i = 0; i < 20; i++) {
- schemaEngines[i] = SchemaEngineWhiteBox.newSchemaEngine("target/schemas/mlog_" + i);
- initMockSchemaEngine(i, schemaEngines[i], storageNames, nodeSGs[i]);
- Whitebox.setInternalState(tables[i], "schemaEngine", schemaEngines[i]);
+ schemaProcessors[i] = SchemaProcessorWhiteBox.newSchemaProcessor("target/schemas/mlog_" + i);
+ initMockSchemaProcessor(i, schemaProcessors[i], storageNames, nodeSGs[i]);
+ Whitebox.setInternalState(tables[i], "schemaProcessor", schemaProcessors[i]);
}
}
- private void initMockSchemaEngine(
- int id, SchemaEngine schemaEngine, String[] storageGroups, List<String> ownedSGs)
+ private void initMockSchemaProcessor(
+ int id, LocalSchemaProcessor schemaProcessor, String[] storageGroups, List<String> ownedSGs)
throws MetadataException {
for (String sg : storageGroups) {
- schemaEngine.setStorageGroup(new PartialPath(sg));
+ schemaProcessor.setStorageGroup(new PartialPath(sg));
}
for (String sg : ownedSGs) {
// register 4 series;
for (int i = 0; i < 4; i++) {
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath(String.format(sg + ".ld.l1.d%d.s%d", i / 2, i % 2)),
TSDataType.INT32,
TSEncoding.RLE,
@@ -173,9 +173,9 @@ public class SlotPartitionTableTest {
@After
public void tearDown() throws IOException, StorageEngineException {
ClusterDescriptor.getInstance().getConfig().setReplicationNum(prevReplicaNum);
- if (schemaEngines != null) {
- for (SchemaEngine schemaEngine : schemaEngines) {
- // schemaEngine.clear();
+ if (schemaProcessors != null) {
+ for (LocalSchemaProcessor schemaProcessor : schemaProcessors) {
+ // schemaProcessor.clear();
}
}
EnvironmentUtils.cleanEnv();
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/query/ClusterPlanExecutorTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/query/ClusterPlanExecutorTest.java
index a5704f3..4a754db 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/query/ClusterPlanExecutorTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/query/ClusterPlanExecutorTest.java
@@ -85,7 +85,7 @@ public class ClusterPlanExecutorTest extends BaseQueryTest {
List<IStorageGroupMNode> allStorageGroupNodes = queryExecutor.getAllStorageGroupNodes();
for (int i = 0; i < allStorageGroupNodes.size(); i++) {
assertEquals(
- IoTDB.schemaEngine.getAllStorageGroupNodes().get(i).getFullPath(),
+ IoTDB.schemaProcessor.getAllStorageGroupNodes().get(i).getFullPath(),
allStorageGroupNodes.get(i).getFullPath());
}
}
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/server/clusterinfo/ClusterInfoServiceImplTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/server/clusterinfo/ClusterInfoServiceImplTest.java
index 158b178..18cfb94 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/server/clusterinfo/ClusterInfoServiceImplTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/server/clusterinfo/ClusterInfoServiceImplTest.java
@@ -54,7 +54,7 @@ public class ClusterInfoServiceImplTest {
ClusterIoTDB.getInstance()
.getIotdb()
- .schemaEngine
+ .schemaProcessor
.setStorageGroup(new PartialPath("root", "sg"));
// metaClusterServer.getMember()
impl = new ClusterInfoServiceImpl();
@@ -64,7 +64,7 @@ public class ClusterInfoServiceImplTest {
public void tearDown() throws MetadataException, IOException, StorageEngineException {
ClusterIoTDB.getInstance()
.getIotdb()
- .schemaEngine
+ .schemaProcessor
.deleteStorageGroups(Collections.singletonList(new PartialPath("root", "sg")));
ClusterIoTDB.getInstance().getMetaGroupMember().stop();
EnvironmentUtils.cleanEnv();
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/server/member/BaseMember.java b/cluster/src/test/java/org/apache/iotdb/cluster/server/member/BaseMember.java
index bc88217..2a96b68 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/server/member/BaseMember.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/server/member/BaseMember.java
@@ -37,7 +37,7 @@ import org.apache.iotdb.cluster.log.applier.DataLogApplier;
import org.apache.iotdb.cluster.log.manage.PartitionedSnapshotLogManager;
import org.apache.iotdb.cluster.log.manage.RaftLogManager;
import org.apache.iotdb.cluster.log.snapshot.FileSnapshot;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.metadata.MetaPuller;
import org.apache.iotdb.cluster.partition.PartitionGroup;
import org.apache.iotdb.cluster.partition.PartitionTable;
@@ -147,9 +147,9 @@ public class BaseMember {
getDataGroupMember(node);
}
- IoTDB.setSchemaEngine(CSchemaEngine.getInstance());
- CSchemaEngine.getInstance().setMetaGroupMember(testMetaMember);
- CSchemaEngine.getInstance().setCoordinator(coordinator);
+ IoTDB.setSchemaProcessor(CSchemaProcessor.getInstance());
+ CSchemaProcessor.getInstance().setMetaGroupMember(testMetaMember);
+ CSchemaProcessor.getInstance().setCoordinator(coordinator);
EnvironmentUtils.envSetUp();
prevUrls = ClusterDescriptor.getInstance().getConfig().getSeedNodeUrls();
@@ -162,7 +162,7 @@ public class BaseMember {
for (int i = 0; i < 10; i++) {
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(TestUtils.getTestSg(i)));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(TestUtils.getTestSg(i)));
for (int j = 0; j < 20; j++) {
SchemaUtils.registerTimeseries(TestUtils.getTestTimeSeriesSchema(i, j));
}
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/server/member/DataGroupMemberTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/server/member/DataGroupMemberTest.java
index 7d9bb00..4977b89 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/server/member/DataGroupMemberTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/server/member/DataGroupMemberTest.java
@@ -605,7 +605,7 @@ public class DataGroupMemberTest extends BaseMember {
Collections.emptyMap(),
null);
assertEquals(200, dataGroupMember.executeNonQueryPlan(createTimeSeriesPlan).code);
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
}
@Test
@@ -634,7 +634,7 @@ public class DataGroupMemberTest extends BaseMember {
partitionTable.getPartitionGroup(new RaftNode(TestUtils.getNode(0), 0)),
dataGroupMember));
assertEquals(200, dataGroupMember.executeNonQueryPlan(createTimeSeriesPlan).code);
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
+ assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath(timeseriesSchema.getFullPath())));
testThreadPool.shutdownNow();
}
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberTest.java
index 64809cf..da1cb4b 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberTest.java
@@ -43,7 +43,7 @@ import org.apache.iotdb.cluster.log.logtypes.AddNodeLog;
import org.apache.iotdb.cluster.log.logtypes.CloseFileLog;
import org.apache.iotdb.cluster.log.logtypes.RemoveNodeLog;
import org.apache.iotdb.cluster.log.snapshot.MetaSimpleSnapshot;
-import org.apache.iotdb.cluster.metadata.CSchemaEngine;
+import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
import org.apache.iotdb.cluster.partition.NodeRemovalResult;
import org.apache.iotdb.cluster.partition.PartitionGroup;
import org.apache.iotdb.cluster.partition.PartitionTable;
@@ -332,7 +332,7 @@ public class MetaGroupMemberTest extends BaseMember {
try {
for (String prefixPath : prefixPaths) {
if (!prefixPath.equals(TestUtils.getTestSeries(10, 0))) {
- IoTDB.schemaEngine.collectMeasurementSchema(new PartialPath(prefixPath), schemas);
+ IoTDB.schemaProcessor.collectMeasurementSchema(new PartialPath(prefixPath), schemas);
dataOutputStream.writeInt(schemas.size());
for (IMeasurementSchema schema : schemas) {
schema.partialSerializeTo(dataOutputStream);
@@ -810,7 +810,7 @@ public class MetaGroupMemberTest extends BaseMember {
.sendSnapshot(request, new GenericHandler(TestUtils.getNode(0), reference));
// 6. check whether the snapshot applied or not
- Map<PartialPath, Long> localStorageGroupTTL = IoTDB.schemaEngine.getStorageGroupsTTL();
+ Map<PartialPath, Long> localStorageGroupTTL = IoTDB.schemaProcessor.getStorageGroupsTTL();
assertNotNull(localStorageGroupTTL);
assertEquals(storageGroupTTL, localStorageGroupTTL);
@@ -851,7 +851,7 @@ public class MetaGroupMemberTest extends BaseMember {
new SetStorageGroupPlan(new PartialPath(TestUtils.getTestSg(i)));
TSStatus status = coordinator.executeNonQueryPlan(setStorageGroupPlan);
assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.code);
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(TestUtils.getTestSg(i))));
+ assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath(TestUtils.getTestSg(i))));
// process a partitioned plan
TimeseriesSchema schema = TestUtils.getTestTimeSeriesSchema(i, 0);
@@ -870,7 +870,7 @@ public class MetaGroupMemberTest extends BaseMember {
status.setCode(TSStatusCode.SUCCESS_STATUS.getStatusCode());
}
assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.code);
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(TestUtils.getTestSeries(i, 0))));
+ assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath(TestUtils.getTestSeries(i, 0))));
}
testThreadPool.shutdownNow();
}
@@ -893,7 +893,7 @@ public class MetaGroupMemberTest extends BaseMember {
new SetStorageGroupPlan(new PartialPath(TestUtils.getTestSg(i)));
TSStatus status = coordinator.executeNonQueryPlan(setStorageGroupPlan);
assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.code);
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(TestUtils.getTestSg(i))));
+ assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath(TestUtils.getTestSg(i))));
// process a partitioned plan
TimeseriesSchema schema = TestUtils.getTestTimeSeriesSchema(i, 0);
@@ -934,7 +934,7 @@ public class MetaGroupMemberTest extends BaseMember {
status.setCode(TSStatusCode.SUCCESS_STATUS.getStatusCode());
}
assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.code);
- assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(TestUtils.getTestSeries(i, 0))));
+ assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath(TestUtils.getTestSeries(i, 0))));
}
testThreadPool.shutdownNow();
}
@@ -954,7 +954,7 @@ public class MetaGroupMemberTest extends BaseMember {
insertPlan.setDevicePath(new PartialPath(TestUtils.getTestSg(i)));
IMeasurementSchema schema = TestUtils.getTestMeasurementSchema(0);
try {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(schema.getMeasurementId()),
schema.getType(),
schema.getEncodingType(),
@@ -1020,7 +1020,7 @@ public class MetaGroupMemberTest extends BaseMember {
insertPlan.setDevicePath(new PartialPath(TestUtils.getTestSg(i)));
IMeasurementSchema schema = TestUtils.getTestMeasurementSchema(0);
try {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(schema.getMeasurementId()),
schema.getType(),
schema.getEncodingType(),
@@ -1076,14 +1076,14 @@ public class MetaGroupMemberTest extends BaseMember {
public void testGetMatchedPaths() throws MetadataException {
System.out.println("Start testGetMatchedPaths()");
List<MeasurementPath> matchedPaths =
- ((CSchemaEngine) IoTDB.schemaEngine)
+ ((CSchemaProcessor) IoTDB.schemaProcessor)
.getMatchedPaths(new PartialPath(TestUtils.getTestSg(0) + ".*"));
assertEquals(20, matchedPaths.size());
for (int j = 0; j < 10; j++) {
assertTrue(matchedPaths.contains(new PartialPath(TestUtils.getTestSeries(0, j))));
}
matchedPaths =
- ((CSchemaEngine) IoTDB.schemaEngine)
+ ((CSchemaProcessor) IoTDB.schemaProcessor)
.getMatchedPaths(new PartialPath(TestUtils.getTestSg(10) + ".*"));
assertTrue(matchedPaths.isEmpty());
}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBArithmeticIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBArithmeticIT.java
index 72f41f5..865422e 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBArithmeticIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBArithmeticIT.java
@@ -69,50 +69,50 @@ public class IoTDBArithmeticIT {
}
private static void createTimeSeries() throws MetadataException {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.sg"));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.sg"));
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s2"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s3"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s4"),
TSDataType.DOUBLE,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s5"),
TSDataType.BOOLEAN,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s6"),
TSDataType.TEXT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s7"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s8"),
TSDataType.INT32,
TSEncoding.PLAIN,
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBLastIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBLastIT.java
index 6cc18be..2afbd3d 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBLastIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBLastIT.java
@@ -226,13 +226,13 @@ public class IoTDBLastIT {
}
PartialPath path = new PartialPath("root.ln.wf01.wt01.temperature");
- IoTDB.schemaEngine.resetLastCache(path);
+ IoTDB.schemaProcessor.resetLastCache(path);
statement.execute(
"insert into root.ln.wf01.wt01(time, temperature, status, id) values(700, 33.1, false, 3)");
// Last cache is updated with above insert sql
- long time = IoTDB.schemaEngine.getLastCache(path).getTimestamp();
+ long time = IoTDB.schemaProcessor.getLastCache(path).getTimestamp();
Assert.assertEquals(700, time);
hasResultSet = statement.execute("select last temperature,status,id from root.ln.wf01.wt01");
@@ -256,7 +256,7 @@ public class IoTDBLastIT {
"insert into root.ln.wf01.wt01(time, temperature, status, id) values(600, 19.1, false, 1)");
// Last cache is not updated with above insert sql
- time = IoTDB.schemaEngine.getLastCache(path).getTimestamp();
+ time = IoTDB.schemaProcessor.getLastCache(path).getTimestamp();
Assert.assertEquals(700, time);
hasResultSet = statement.execute("select last temperature,status,id from root.ln.wf01.wt01");
@@ -298,7 +298,7 @@ public class IoTDBLastIT {
Statement statement = connection.createStatement()) {
PartialPath path = new PartialPath("root.ln.wf01.wt02.temperature");
- IoTDB.schemaEngine.resetLastCache(path);
+ IoTDB.schemaProcessor.resetLastCache(path);
boolean hasResultSet =
statement.execute("select last temperature,status,id from root.ln.wf01.wt02");
@@ -343,7 +343,7 @@ public class IoTDBLastIT {
}
Assert.assertEquals(cnt, retArray.length);
- IoTDB.schemaEngine.resetLastCache(path);
+ IoTDB.schemaProcessor.resetLastCache(path);
String[] retArray3 =
new String[] {
"900,root.ln.wf01.wt01.temperature,10.2,DOUBLE",
@@ -389,7 +389,7 @@ public class IoTDBLastIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- IoTDB.schemaEngine.resetLastCache(new PartialPath("root.ln.wf01.wt03.temperature"));
+ IoTDB.schemaProcessor.resetLastCache(new PartialPath("root.ln.wf01.wt03.temperature"));
statement.execute(
"INSERT INTO root.ln.wf01.wt03(timestamp,status, id) values(500, false, 9)");
@@ -440,7 +440,7 @@ public class IoTDBLastIT {
statement.execute("INSERT INTO root.ln.wf01.wt04(timestamp,temperature) values(150,31.2)");
statement.execute("flush");
- IoTDB.schemaEngine.resetLastCache(new PartialPath("root.ln.wf01.wt04.temperature"));
+ IoTDB.schemaProcessor.resetLastCache(new PartialPath("root.ln.wf01.wt04.temperature"));
boolean hasResultSet = statement.execute("select last temperature from root.ln.wf01.wt04");
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
index fe35d15..317f7df 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
@@ -65,32 +65,32 @@ public class IoTDBNestedQueryIT {
}
private static void createTimeSeries() throws MetadataException {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s2"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s2"),
TSDataType.DOUBLE,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.empty"),
TSDataType.DOUBLE,
TSEncoding.PLAIN,
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
index 9f625b3..1c120ca 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
@@ -73,58 +73,58 @@ public class IoTDBSelectIntoIT {
}
private static void createTimeSeries() throws MetadataException {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s2"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s3"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s4"),
TSDataType.DOUBLE,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s5"),
TSDataType.BOOLEAN,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s6"),
TSDataType.TEXT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.empty"),
TSDataType.TEXT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d2.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.datatype"),
TSDataType.DOUBLE,
TSEncoding.PLAIN,
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
index cdf12db..72e46de 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.db.integration;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.mnode.IMeasurementMNode;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.integration.env.EnvFactory;
@@ -76,7 +76,7 @@ public class IoTDBSimpleQueryIT {
}
IMeasurementMNode mNode =
- SchemaEngine.getInstance().getMeasurementMNode(new PartialPath("root.sg1.d0.s1"));
+ LocalSchemaProcessor.getInstance().getMeasurementMNode(new PartialPath("root.sg1.d0.s1"));
assertNull(mNode.getSchema().getProps());
}
@@ -94,7 +94,7 @@ public class IoTDBSimpleQueryIT {
}
IMeasurementMNode mNode =
- SchemaEngine.getInstance().getMeasurementMNode(new PartialPath("root.sg1.d0.s1"));
+ LocalSchemaProcessor.getInstance().getMeasurementMNode(new PartialPath("root.sg1.d0.s1"));
// check if SDT property is set
assertEquals(2, mNode.getSchema().getProps().size());
@@ -115,7 +115,7 @@ public class IoTDBSimpleQueryIT {
}
IMeasurementMNode mNode =
- SchemaEngine.getInstance().getMeasurementMNode(new PartialPath("root.sg1.d0.s1"));
+ LocalSchemaProcessor.getInstance().getMeasurementMNode(new PartialPath("root.sg1.d0.s1"));
// check if SDT property is set
assertEquals(4, mNode.getSchema().getProps().size());
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerExecutionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerExecutionIT.java
index 5f9aa60..695af46 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerExecutionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerExecutionIT.java
@@ -101,37 +101,37 @@ public class IoTDBTriggerExecutionIT {
}
private void createTimeseries() throws MetadataException {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s2"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s3"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s4"),
TSDataType.DOUBLE,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s5"),
TSDataType.BOOLEAN,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s6"),
TSDataType.TEXT,
TSEncoding.PLAIN,
@@ -487,12 +487,12 @@ public class IoTDBTriggerExecutionIT {
stopDataGenerator();
- IoTDB.schemaEngine.deleteTimeseries(new PartialPath("root.vehicle.d1.s1"));
- IoTDB.schemaEngine.deleteTimeseries(new PartialPath("root.vehicle.d1.s2"));
- IoTDB.schemaEngine.deleteTimeseries(new PartialPath("root.vehicle.d1.s3"));
- IoTDB.schemaEngine.deleteTimeseries(new PartialPath("root.vehicle.d1.s4"));
- IoTDB.schemaEngine.deleteTimeseries(new PartialPath("root.vehicle.d1.s5"));
- IoTDB.schemaEngine.deleteTimeseries(new PartialPath("root.vehicle.d1.s6"));
+ IoTDB.schemaProcessor.deleteTimeseries(new PartialPath("root.vehicle.d1.s1"));
+ IoTDB.schemaProcessor.deleteTimeseries(new PartialPath("root.vehicle.d1.s2"));
+ IoTDB.schemaProcessor.deleteTimeseries(new PartialPath("root.vehicle.d1.s3"));
+ IoTDB.schemaProcessor.deleteTimeseries(new PartialPath("root.vehicle.d1.s4"));
+ IoTDB.schemaProcessor.deleteTimeseries(new PartialPath("root.vehicle.d1.s5"));
+ IoTDB.schemaProcessor.deleteTimeseries(new PartialPath("root.vehicle.d1.s6"));
for (int i = 0; i < 6; ++i) {
try {
@@ -566,7 +566,7 @@ public class IoTDBTriggerExecutionIT {
stopDataGenerator();
- IoTDB.schemaEngine.deleteStorageGroups(
+ IoTDB.schemaProcessor.deleteStorageGroups(
Collections.singletonList(new PartialPath("root.vehicle")));
for (int i = 0; i < 6; ++i) {
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerManagementIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerManagementIT.java
index 1d4a3ca..c05c0ef 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerManagementIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerManagementIT.java
@@ -56,25 +56,25 @@ public class IoTDBTriggerManagementIT {
@Before
public void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s2"),
TSDataType.DOUBLE,
TSEncoding.GORILLA,
CompressionType.LZ4,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s3"),
TSDataType.INT32,
TSEncoding.RLE,
CompressionType.LZ4,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s4"),
TSDataType.INT64,
TSEncoding.RLE,
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFManagementIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFManagementIT.java
index 2eb36b6..861222b 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFManagementIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFManagementIT.java
@@ -59,14 +59,14 @@ public class IoTDBUDFManagementIT {
@Before
public void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s2"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
diff --git a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
index e82f7f6..2a2abf6 100644
--- a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
+++ b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
@@ -22,7 +22,7 @@ import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.conf.OperationType;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.mnode.IMeasurementMNode;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.utils.EnvironmentUtils;
@@ -332,7 +332,7 @@ public class IoTDBSessionSimpleIT {
assertTrue(session.checkTimeseriesExists("root.sg1.d1.s1"));
assertTrue(session.checkTimeseriesExists("root.sg1.d1.s2"));
IMeasurementMNode mNode =
- SchemaEngine.getInstance().getMeasurementMNode(new PartialPath("root.sg1.d1.s1"));
+ LocalSchemaProcessor.getInstance().getMeasurementMNode(new PartialPath("root.sg1.d1.s1"));
assertNull(mNode.getSchema().getProps());
session.close();
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index 0d59b58..580d8f7 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -25,7 +25,7 @@ import org.apache.iotdb.db.engine.compaction.cross.CrossCompactionStrategy;
import org.apache.iotdb.db.engine.compaction.inner.InnerCompactionStrategy;
import org.apache.iotdb.db.engine.storagegroup.timeindex.TimeIndexLevel;
import org.apache.iotdb.db.exception.LoadConfigurationException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.service.thrift.impl.InfluxDBServiceImpl;
import org.apache.iotdb.db.service.thrift.impl.TSServiceImpl;
import org.apache.iotdb.rpc.RpcTransportFactory;
@@ -457,10 +457,10 @@ public class IoTDBConfig {
/** Set true to enable writing monitor time series. */
private boolean enableMonitorSeriesWrite = false;
- /** Cache size of {@code checkAndGetDataTypeCache} in {@link SchemaEngine}. */
+ /** Cache size of {@code checkAndGetDataTypeCache} in {@link LocalSchemaProcessor}. */
private int schemaRegionCacheSize = 10000;
- /** Cache size of {@code checkAndGetDataTypeCache} in {@link SchemaEngine}. */
+ /** Cache size of {@code checkAndGetDataTypeCache} in {@link LocalSchemaProcessor}. */
private int mRemoteSchemaCacheSize = 100000;
/** Is external sort enable. */
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
index 2c0075d..1e41abb 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
@@ -223,7 +223,7 @@ public class StorageEngine implements IService {
Runtime.getRuntime().availableProcessors(), "Recovery-Thread-Pool");
// recover all logic storage group processors
- List<IStorageGroupMNode> sgNodes = IoTDB.schemaEngine.getAllStorageGroupNodes();
+ List<IStorageGroupMNode> sgNodes = IoTDB.schemaProcessor.getAllStorageGroupNodes();
List<Future<Void>> futures = new LinkedList<>();
for (IStorageGroupMNode storageGroup : sgNodes) {
StorageGroupManager storageGroupManager =
@@ -377,7 +377,7 @@ public class StorageEngine implements IService {
unseqMemtableTimedFlushCheckThread, ThreadName.TIMED_FlUSH_UNSEQ_MEMTABLE);
ThreadUtils.stopThreadPool(tsFileTimedCloseCheckThread, ThreadName.TIMED_CLOSE_TSFILE);
recoveryThreadPool.shutdownNow();
- for (PartialPath storageGroup : IoTDB.schemaEngine.getAllStorageGroupPaths()) {
+ for (PartialPath storageGroup : IoTDB.schemaProcessor.getAllStorageGroupPaths()) {
this.releaseWalDirectByteBufferPoolInOneStorageGroup(storageGroup);
}
processorMap.clear();
@@ -459,7 +459,7 @@ public class StorageEngine implements IService {
throws StorageEngineException {
PartialPath storageGroupPath;
try {
- IStorageGroupMNode storageGroupMNode = IoTDB.schemaEngine.getStorageGroupNodeByPath(path);
+ IStorageGroupMNode storageGroupMNode = IoTDB.schemaProcessor.getStorageGroupNodeByPath(path);
storageGroupPath = storageGroupMNode.getPartialPath();
return getStorageGroupProcessorByPath(storageGroupPath, storageGroupMNode);
} catch (StorageGroupProcessorException | MetadataException e) {
@@ -475,7 +475,7 @@ public class StorageEngine implements IService {
*/
public VirtualStorageGroupProcessor getProcessor(PartialPath path) throws StorageEngineException {
try {
- IStorageGroupMNode storageGroupMNode = IoTDB.schemaEngine.getStorageGroupNodeByPath(path);
+ IStorageGroupMNode storageGroupMNode = IoTDB.schemaProcessor.getStorageGroupNodeByPath(path);
return getStorageGroupProcessorByPath(path, storageGroupMNode);
} catch (StorageGroupProcessorException | MetadataException e) {
throw new StorageEngineException(e);
@@ -491,7 +491,8 @@ public class StorageEngine implements IService {
try {
List<String> lockHolderList = new ArrayList<>(pathList.size());
for (PartialPath path : pathList) {
- IStorageGroupMNode storageGroupMNode = IoTDB.schemaEngine.getStorageGroupNodeByPath(path);
+ IStorageGroupMNode storageGroupMNode =
+ IoTDB.schemaProcessor.getStorageGroupNodeByPath(path);
VirtualStorageGroupProcessor virtualStorageGroupProcessor =
getStorageGroupProcessorByPath(path, storageGroupMNode);
lockHolderList.add(virtualStorageGroupProcessor.getInsertWriteLockHolder());
@@ -699,7 +700,7 @@ public class StorageEngine implements IService {
TimePartitionFilter timePartitionFilter)
throws StorageEngineException {
try {
- List<PartialPath> sgPaths = IoTDB.schemaEngine.getBelongedStorageGroups(path);
+ List<PartialPath> sgPaths = IoTDB.schemaProcessor.getBelongedStorageGroups(path);
for (PartialPath storageGroupPath : sgPaths) {
// storage group has no data
if (!processorMap.containsKey(storageGroupPath)) {
@@ -723,7 +724,7 @@ public class StorageEngine implements IService {
PartialPath path, long planIndex, TimePartitionFilter timePartitionFilter)
throws StorageEngineException {
try {
- List<PartialPath> sgPaths = IoTDB.schemaEngine.getBelongedStorageGroups(path);
+ List<PartialPath> sgPaths = IoTDB.schemaProcessor.getBelongedStorageGroups(path);
for (PartialPath storageGroupPath : sgPaths) {
// storage group has no data
if (!processorMap.containsKey(storageGroupPath)) {
@@ -836,7 +837,7 @@ public class StorageEngine implements IService {
public synchronized boolean deleteAll() {
logger.info("Start deleting all storage groups' timeseries");
syncCloseAllProcessor();
- for (PartialPath storageGroup : IoTDB.schemaEngine.getAllStorageGroupPaths()) {
+ for (PartialPath storageGroup : IoTDB.schemaProcessor.getAllStorageGroupPaths()) {
this.deleteAllDataFilesInOneStorageGroup(storageGroup);
}
return true;
@@ -878,7 +879,7 @@ public class StorageEngine implements IService {
}
String device = deviceSet.iterator().next();
PartialPath devicePath = new PartialPath(device);
- PartialPath storageGroupPath = IoTDB.schemaEngine.getBelongedStorageGroup(devicePath);
+ PartialPath storageGroupPath = IoTDB.schemaProcessor.getBelongedStorageGroup(devicePath);
getProcessorDirectly(storageGroupPath).loadNewTsFile(newTsFileResource);
}
@@ -1052,7 +1053,7 @@ public class StorageEngine implements IService {
if (config.isEnableIDTable()) {
processor.getIdTable().getSeriesSchemas(insertPlan);
} else {
- IoTDB.schemaEngine.getSeriesSchemasAndReadLockDevice(insertPlan);
+ IoTDB.schemaProcessor.getSeriesSchemasAndReadLockDevice(insertPlan);
insertPlan.setDeviceID(
DeviceIDFactory.getInstance().getDeviceID(insertPlan.getDevicePath()));
}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionUtils.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionUtils.java
index 10f5bce..6e9cf68 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionUtils.java
@@ -131,7 +131,7 @@ public class CompactionUtils {
measurementSchemas.add(IDTableManager.getInstance().getSeriesSchema(device, measurement));
} else {
measurementSchemas.add(
- IoTDB.schemaEngine.getSeriesSchema(new PartialPath(device, measurement)));
+ IoTDB.schemaProcessor.getSeriesSchema(new PartialPath(device, measurement)));
}
} catch (PathNotExistException e) {
logger.info("A deleted path is skipped: {}", e.getMessage());
@@ -182,7 +182,7 @@ public class CompactionUtils {
measurementSchemas.add(IDTableManager.getInstance().getSeriesSchema(device, measurement));
} else {
measurementSchemas.add(
- IoTDB.schemaEngine.getSeriesSchema(new PartialPath(device, measurement)));
+ IoTDB.schemaProcessor.getSeriesSchema(new PartialPath(device, measurement)));
}
} catch (PathNotExistException e) {
logger.info("A deleted path is skipped: {}", e.getMessage());
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/InnerSpaceCompactionUtils.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/InnerSpaceCompactionUtils.java
index 46ac88f..d1753cb 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/InnerSpaceCompactionUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/InnerSpaceCompactionUtils.java
@@ -125,7 +125,7 @@ public class InnerSpaceCompactionUtils {
measurementSchema =
IDTableManager.getInstance().getSeriesSchema(device, p.getMeasurement());
} else {
- measurementSchema = IoTDB.schemaEngine.getSeriesSchema(p);
+ measurementSchema = IoTDB.schemaProcessor.getSeriesSchema(p);
}
} catch (PathNotExistException e) {
logger.info("A deleted path is skipped: {}", e.getMessage());
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/cq/ContinuousQuerySchemaCheckTask.java b/server/src/main/java/org/apache/iotdb/db/engine/cq/ContinuousQuerySchemaCheckTask.java
index be0970d..961d534 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/cq/ContinuousQuerySchemaCheckTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/cq/ContinuousQuerySchemaCheckTask.java
@@ -73,7 +73,7 @@ public class ContinuousQuerySchemaCheckTask extends ContinuousQueryTask {
queryPlan.getAggregations().get(0), queryPlan.getDataTypes().get(0));
for (PartialPath targetPath : targetPaths) {
try {
- TSDataType targetPathDataType = IoTDB.schemaEngine.getSeriesSchema(targetPath).getType();
+ TSDataType targetPathDataType = IoTDB.schemaProcessor.getSeriesSchema(targetPath).getType();
if (!sourceDataType.equals(targetPathDataType)) {
throw new ContinuousQueryException(
String.format(
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/VirtualStorageGroupProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/VirtualStorageGroupProcessor.java
index 226458d..87d7b4e 100755
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/VirtualStorageGroupProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/VirtualStorageGroupProcessor.java
@@ -1105,7 +1105,7 @@ public class VirtualStorageGroupProcessor {
}
// Update cached last value with high priority
if (mNodes[i] == null) {
- IoTDB.schemaEngine.updateLastCache(
+ IoTDB.schemaProcessor.updateLastCache(
plan.getDevicePath().concatNode(plan.getMeasurements()[i]),
plan.composeLastTimeValuePair(i),
true,
@@ -1113,7 +1113,7 @@ public class VirtualStorageGroupProcessor {
} else {
// in stand alone version, the seriesPath is not needed, just use measurementMNodes[i] to
// update last cache
- IoTDB.schemaEngine.updateLastCache(
+ IoTDB.schemaProcessor.updateLastCache(
mNodes[i], plan.composeLastTimeValuePair(i), true, latestFlushedTime);
}
}
@@ -1155,7 +1155,7 @@ public class VirtualStorageGroupProcessor {
}
// Update cached last value with high priority
if (mNodes[i] == null) {
- IoTDB.schemaEngine.updateLastCache(
+ IoTDB.schemaProcessor.updateLastCache(
plan.getDevicePath().concatNode(plan.getMeasurements()[i]),
plan.composeTimeValuePair(i),
true,
@@ -1163,7 +1163,7 @@ public class VirtualStorageGroupProcessor {
} else {
// in stand alone version, the seriesPath is not needed, just use measurementMNodes[i] to
// update last cache
- IoTDB.schemaEngine.updateLastCache(
+ IoTDB.schemaProcessor.updateLastCache(
mNodes[i], plan.composeTimeValuePair(i), true, latestFlushedTime);
}
}
@@ -1851,7 +1851,7 @@ public class VirtualStorageGroupProcessor {
List<ModificationFile> updatedModFiles = new ArrayList<>();
try {
- Set<PartialPath> devicePaths = IoTDB.schemaEngine.getBelongedDevices(path);
+ Set<PartialPath> devicePaths = IoTDB.schemaProcessor.getBelongedDevices(path);
for (PartialPath device : devicePaths) {
// delete Last cache record if necessary
tryToDeleteLastCache(device, path, startTime, endTime);
@@ -2006,7 +2006,7 @@ public class VirtualStorageGroupProcessor {
return;
}
try {
- IoTDB.schemaEngine.deleteLastCacheByDevice(deviceId, originalPath, startTime, endTime);
+ IoTDB.schemaProcessor.deleteLastCacheByDevice(deviceId, originalPath, startTime, endTime);
} catch (MetadataException e) {
throw new WriteProcessException(e);
}
@@ -2290,7 +2290,7 @@ public class VirtualStorageGroupProcessor {
return;
}
try {
- IoTDB.schemaEngine.deleteLastCacheByDevice(deviceId);
+ IoTDB.schemaProcessor.deleteLastCacheByDevice(deviceId);
} catch (MetadataException e) {
// the path doesn't cache in cluster mode now, ignore
}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/trigger/service/TriggerRegistrationService.java b/server/src/main/java/org/apache/iotdb/db/engine/trigger/service/TriggerRegistrationService.java
index ea4ed22..02bf93c 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/trigger/service/TriggerRegistrationService.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/trigger/service/TriggerRegistrationService.java
@@ -136,7 +136,7 @@ public class TriggerRegistrationService implements IService {
private IMeasurementMNode tryGetMeasurementMNode(CreateTriggerPlan plan)
throws TriggerManagementException {
try {
- return IoTDB.schemaEngine.getMeasurementMNode(plan.getFullPath());
+ return IoTDB.schemaProcessor.getMeasurementMNode(plan.getFullPath());
} catch (MetadataException e) {
throw new TriggerManagementException(e.getMessage(), e);
}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/trigger/sink/local/LocalIoTDBHandler.java b/server/src/main/java/org/apache/iotdb/db/engine/trigger/sink/local/LocalIoTDBHandler.java
index a3f0dde..895f504 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/trigger/sink/local/LocalIoTDBHandler.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/trigger/sink/local/LocalIoTDBHandler.java
@@ -64,15 +64,15 @@ public class LocalIoTDBHandler implements Handler<LocalIoTDBConfiguration, Local
TSDataType dataType = dataTypes[i];
PartialPath path = new PartialPath(device.getFullPath(), measurement);
- if (!IoTDB.schemaEngine.isPathExist(path)) {
- IoTDB.schemaEngine.createTimeseries(
+ if (!IoTDB.schemaProcessor.isPathExist(path)) {
+ IoTDB.schemaProcessor.createTimeseries(
path,
dataType,
getDefaultEncoding(dataType),
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
} else {
- if (!IoTDB.schemaEngine.getSeriesType(path).equals(dataType)) {
+ if (!IoTDB.schemaProcessor.getSeriesType(path).equals(dataType)) {
throw new SinkException(
String.format("The data type of %s you provided was not correct.", path));
}
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/LocalConfigManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/LocalConfigManager.java
index 468e7b0..313c8df 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/LocalConfigManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/LocalConfigManager.java
@@ -33,8 +33,8 @@ import org.apache.iotdb.db.exception.metadata.UndefinedTemplateException;
import org.apache.iotdb.db.metadata.mnode.IStorageGroupMNode;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.metadata.rescon.TimeseriesStatistics;
+import org.apache.iotdb.db.metadata.schemaregion.SchemaEngine;
import org.apache.iotdb.db.metadata.schemaregion.SchemaRegion;
-import org.apache.iotdb.db.metadata.schemaregion.SchemaRegionManager;
import org.apache.iotdb.db.metadata.storagegroup.IStorageGroupSchemaManager;
import org.apache.iotdb.db.metadata.storagegroup.StorageGroupSchemaManager;
import org.apache.iotdb.db.metadata.template.Template;
@@ -84,7 +84,7 @@ public class LocalConfigManager {
private IStorageGroupSchemaManager storageGroupSchemaManager =
StorageGroupSchemaManager.getInstance();
private TemplateManager templateManager = TemplateManager.getInstance();
- private SchemaRegionManager schemaRegionManager = SchemaRegionManager.getInstance();
+ private SchemaEngine schemaEngine = SchemaEngine.getInstance();
private LocalSchemaPartitionTable partitionTable = LocalSchemaPartitionTable.getInstance();
private LocalConfigManager() {
@@ -124,7 +124,7 @@ public class LocalConfigManager {
templateManager.init();
storageGroupSchemaManager.init();
partitionTable.init();
- schemaRegionManager.init();
+ schemaEngine.init();
initSchemaRegion();
@@ -180,10 +180,10 @@ public class LocalConfigManager {
partitionTable.clear();
- for (SchemaRegion schemaRegion : schemaRegionManager.getAllSchemaRegions()) {
+ for (SchemaRegion schemaRegion : schemaEngine.getAllSchemaRegions()) {
schemaRegion.clear();
}
- schemaRegionManager.clear();
+ schemaEngine.clear();
storageGroupSchemaManager.clear();
templateManager.clear();
@@ -193,7 +193,7 @@ public class LocalConfigManager {
timedForceMLogThread = null;
}
} catch (IOException e) {
- logger.error("Error occurred when clearing SchemaEngine:", e);
+ logger.error("Error occurred when clearing LocalConfigManager:", e);
}
initialized = false;
@@ -207,7 +207,7 @@ public class LocalConfigManager {
storageGroupSchemaManager.forceLog();
templateManager.forceLog();
- for (SchemaRegion schemaRegion : schemaRegionManager.getAllSchemaRegions()) {
+ for (SchemaRegion schemaRegion : schemaEngine.getAllSchemaRegions()) {
schemaRegion.forceMlog();
}
}
@@ -440,7 +440,7 @@ public class LocalConfigManager {
}
public Pair<List<PartialPath>, Set<PartialPath>> getNodesListInGivenLevel(
- PartialPath pathPattern, int nodeLevel, SchemaEngine.StorageGroupFilter filter)
+ PartialPath pathPattern, int nodeLevel, LocalSchemaProcessor.StorageGroupFilter filter)
throws MetadataException {
return storageGroupSchemaManager.getNodesListInGivenLevel(pathPattern, nodeLevel, filter);
}
@@ -512,19 +512,19 @@ public class LocalConfigManager {
public SchemaRegion getSchemaRegion(PartialPath storageGroup, SchemaRegionId schemaRegionId)
throws MetadataException {
- return schemaRegionManager.getSchemaRegion(schemaRegionId);
+ return schemaEngine.getSchemaRegion(schemaRegionId);
}
public void deleteSchemaRegion(PartialPath storageGroup, SchemaRegionId schemaRegionId)
throws MetadataException {
partitionTable.removeSchemaRegionId(storageGroup, schemaRegionId);
- schemaRegionManager.deleteSchemaRegion(schemaRegionId);
+ schemaEngine.deleteSchemaRegion(schemaRegionId);
}
private void deleteSchemaRegionsInStorageGroup(
PartialPath storageGroup, Set<SchemaRegionId> schemaRegionIdSet) throws MetadataException {
for (SchemaRegionId schemaRegionId : schemaRegionIdSet) {
- schemaRegionManager.deleteSchemaRegion(schemaRegionId);
+ schemaEngine.deleteSchemaRegion(schemaRegionId);
}
File sgDir = new File(config.getSchemaDir() + File.separator + storageGroup.getFullPath());
@@ -541,7 +541,7 @@ public class LocalConfigManager {
private SchemaRegion localCreateSchemaRegion(
PartialPath storageGroup, SchemaRegionId schemaRegionId) throws MetadataException {
- return schemaRegionManager.createSchemaRegion(
+ return schemaEngine.createSchemaRegion(
storageGroup,
schemaRegionId,
storageGroupSchemaManager.getStorageGroupNodeByStorageGroupPath(storageGroup));
@@ -557,7 +557,7 @@ public class LocalConfigManager {
public SchemaRegion getBelongedSchemaRegion(PartialPath path) throws MetadataException {
PartialPath storageGroup = storageGroupSchemaManager.getBelongedStorageGroup(path);
SchemaRegionId schemaRegionId = partitionTable.getSchemaRegionId(storageGroup, path);
- SchemaRegion schemaRegion = schemaRegionManager.getSchemaRegion(schemaRegionId);
+ SchemaRegion schemaRegion = schemaEngine.getSchemaRegion(schemaRegionId);
if (schemaRegion == null) {
schemaRegion = localCreateSchemaRegion(storageGroup, schemaRegionId);
partitionTable.putSchemaRegionId(storageGroup, schemaRegionId);
@@ -585,7 +585,7 @@ public class LocalConfigManager {
storageGroupSchemaManager.getInvolvedStorageGroups(pathPattern, isPrefixMatch)) {
for (SchemaRegionId schemaRegionId :
partitionTable.getInvolvedSchemaRegionIds(storageGroup, pathPattern, isPrefixMatch)) {
- result.add(schemaRegionManager.getSchemaRegion(schemaRegionId));
+ result.add(schemaEngine.getSchemaRegion(schemaRegionId));
}
}
@@ -597,7 +597,7 @@ public class LocalConfigManager {
List<SchemaRegion> result = new ArrayList<>();
for (SchemaRegionId schemaRegionId :
partitionTable.getSchemaRegionIdsByStorageGroup(storageGroup)) {
- result.add(schemaRegionManager.getSchemaRegion(schemaRegionId));
+ result.add(schemaEngine.getSchemaRegion(schemaRegionId));
}
return result;
}
@@ -619,7 +619,7 @@ public class LocalConfigManager {
Template template = templateManager.getTemplate(plan.getName());
for (SchemaRegionId schemaRegionId : template.getRelatedSchemaRegion()) {
- if (!schemaRegionManager
+ if (!schemaEngine
.getSchemaRegion(schemaRegionId)
.isTemplateAppendable(template, plan.getMeasurements())) {
isTemplateAppendable = false;
@@ -704,14 +704,14 @@ public class LocalConfigManager {
public Set<String> getPathsSetTemplate(String templateName) throws MetadataException {
Set<String> result = new HashSet<>();
if (templateName.equals(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD)) {
- for (SchemaRegion schemaRegion : schemaRegionManager.getAllSchemaRegions()) {
+ for (SchemaRegion schemaRegion : schemaEngine.getAllSchemaRegions()) {
result.addAll(schemaRegion.getPathsSetTemplate(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD));
}
} else {
for (SchemaRegionId schemaRegionId :
templateManager.getTemplate(templateName).getRelatedSchemaRegion()) {
result.addAll(
- schemaRegionManager.getSchemaRegion(schemaRegionId).getPathsSetTemplate(templateName));
+ schemaEngine.getSchemaRegion(schemaRegionId).getPathsSetTemplate(templateName));
}
}
@@ -721,16 +721,14 @@ public class LocalConfigManager {
public Set<String> getPathsUsingTemplate(String templateName) throws MetadataException {
Set<String> result = new HashSet<>();
if (templateName.equals(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD)) {
- for (SchemaRegion schemaRegion : schemaRegionManager.getAllSchemaRegions()) {
+ for (SchemaRegion schemaRegion : schemaEngine.getAllSchemaRegions()) {
result.addAll(schemaRegion.getPathsUsingTemplate(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD));
}
} else {
for (SchemaRegionId schemaRegionId :
templateManager.getTemplate(templateName).getRelatedSchemaRegion()) {
result.addAll(
- schemaRegionManager
- .getSchemaRegion(schemaRegionId)
- .getPathsUsingTemplate(templateName));
+ schemaEngine.getSchemaRegion(schemaRegionId).getPathsUsingTemplate(templateName));
}
}
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/SchemaEngine.java b/server/src/main/java/org/apache/iotdb/db/metadata/LocalSchemaProcessor.java
similarity index 98%
rename from server/src/main/java/org/apache/iotdb/db/metadata/SchemaEngine.java
rename to server/src/main/java/org/apache/iotdb/db/metadata/LocalSchemaProcessor.java
index 6a7a4ba..ee784c6 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/SchemaEngine.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/LocalSchemaProcessor.java
@@ -99,7 +99,7 @@ import static org.apache.iotdb.tsfile.common.constant.TsFileConstant.PATH_SEPARA
* <p>The codes are divided into the following code regions:
*
* <ol>
- * <li>SchemaEngine Singleton
+ * <li>SchemaProcessor Singleton
* <li>Interfaces and Implementation of Operating PhysicalPlans of Metadata
* <li>Interfaces and Implementation for Timeseries operation
* <li>Interfaces and Implementation for StorageGroup and TTL operation
@@ -121,30 +121,30 @@ import static org.apache.iotdb.tsfile.common.constant.TsFileConstant.PATH_SEPARA
* </ol>
*/
@SuppressWarnings("java:S1135") // ignore todos
-public class SchemaEngine {
+public class LocalSchemaProcessor {
- private static final Logger logger = LoggerFactory.getLogger(SchemaEngine.class);
+ private static final Logger logger = LoggerFactory.getLogger(LocalSchemaProcessor.class);
protected static IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
private LocalConfigManager configManager = LocalConfigManager.getInstance();
- // region SchemaEngine Singleton
- private static class SchemaEngineHolder {
+ // region SchemaProcessor Singleton
+ private static class LocalSchemaProcessorHolder {
- private SchemaEngineHolder() {
+ private LocalSchemaProcessorHolder() {
// allowed to do nothing
}
- private static final SchemaEngine INSTANCE = new SchemaEngine();
+ private static final LocalSchemaProcessor INSTANCE = new LocalSchemaProcessor();
}
/** we should not use this function in other place, but only in IoTDB class */
- public static SchemaEngine getInstance() {
- return SchemaEngineHolder.INSTANCE;
+ public static LocalSchemaProcessor getInstance() {
+ return LocalSchemaProcessorHolder.INSTANCE;
}
- protected SchemaEngine() {}
+ protected LocalSchemaProcessor() {}
// endregion
// region methods in this region is only used for local schemaRegion management.
@@ -1128,8 +1128,8 @@ public class SchemaEngine {
/**
* Update the last cache value of time series of given seriesPath.
*
- * <p>SchemaEngine will use the seriesPath to search the node first and then process the lastCache
- * in the MeasurementMNode
+ * <p>SchemaProcessor will use the seriesPath to search the node first and then process the
+ * lastCache in the MeasurementMNode
*
* <p>Invoking scenario: (1) after executing insertPlan (2) after reading last value from file
* during last Query
@@ -1175,7 +1175,7 @@ public class SchemaEngine {
}
/**
- * Get the last cache value of time series of given seriesPath. SchemaEngine will use the
+ * Get the last cache value of time series of given seriesPath. SchemaProcessor will use the
* seriesPath to search the node.
*
* <p>Invoking scenario: last cache read during last Query
@@ -1208,7 +1208,7 @@ public class SchemaEngine {
}
/**
- * Reset the last cache value of time series of given seriesPath. SchemaEngine will use the
+ * Reset the last cache value of time series of given seriesPath. SchemaProcessor will use the
* seriesPath to search the node.
*
* @param seriesPath the PartialPath of full path from root to Measurement
@@ -1371,7 +1371,7 @@ public class SchemaEngine {
}
/**
- * To reduce the String number in memory, use the deviceId from SchemaEngine instead of the
+ * To reduce the String number in memory, use the deviceId from SchemaProcessor instead of the
* deviceId read from disk
*
* @param devicePath read from disk
@@ -1384,7 +1384,7 @@ public class SchemaEngine {
IMNode deviceNode = getDeviceNode(devicePath);
device = deviceNode.getFullPath();
} catch (MetadataException | NullPointerException e) {
- // Cannot get deviceId from SchemaEngine, return the input deviceId
+ // Cannot get deviceId from SchemaProcessor, return the input deviceId
}
return device;
}
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableHashmapImpl.java b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableHashmapImpl.java
index d433cc2..33578f6 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableHashmapImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableHashmapImpl.java
@@ -323,7 +323,7 @@ public class IDTableHashmapImpl implements IDTable {
/**
* check whether a time series is exist if exist, check the type consistency if not exist, call
- * SchemaEngine to create it
+ * SchemaProcessor to create it
*
* @return measurement MNode of the time series or null if type is not match
*/
@@ -342,12 +342,12 @@ public class IDTableHashmapImpl implements IDTable {
System.arraycopy(
plan.getMeasurementMNodes(), 0, insertPlanMNodeBackup, 0, insertPlanMNodeBackup.length);
try {
- IoTDB.schemaEngine.getSeriesSchemasAndReadLockDevice(plan);
+ IoTDB.schemaProcessor.getSeriesSchemasAndReadLockDevice(plan);
} catch (IOException e) {
throw new MetadataException(e);
}
- // if the timeseries is in template, schemaEngine will not create timeseries. so we have to
+ // if the timeseries is in template, SchemaProcessor will not create timeseries. so we have to
// put it
// in id table here
for (IMeasurementMNode measurementMNode : plan.getMeasurementMNodes()) {
@@ -373,9 +373,9 @@ public class IDTableHashmapImpl implements IDTable {
schemaEntry = deviceEntry.getSchemaEntry(measurementName);
}
- // timeseries is using trigger, we should get trigger from schemaEngine
+ // timeseries is using trigger, we should get trigger from SchemaProcessor
if (schemaEntry.isUsingTrigger()) {
- IMeasurementMNode measurementMNode = IoTDB.schemaEngine.getMeasurementMNode(seriesKey);
+ IMeasurementMNode measurementMNode = IoTDB.schemaProcessor.getMeasurementMNode(seriesKey);
return new InsertMeasurementMNode(
measurementName, schemaEntry, measurementMNode.getTriggerExecutor());
}
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableManager.java
index e85e7e4..b93813a 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableManager.java
@@ -82,7 +82,7 @@ public class IDTableManager {
public synchronized IDTable getIDTable(PartialPath devicePath) {
try {
IStorageGroupMNode storageGroupMNode =
- IoTDB.schemaEngine.getStorageGroupNodeByPath(devicePath);
+ IoTDB.schemaProcessor.getStorageGroupNodeByPath(devicePath);
return idTableMap.computeIfAbsent(
storageGroupMNode.getFullPath(),
storageGroupPath ->
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/entry/InsertMeasurementMNode.java b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/entry/InsertMeasurementMNode.java
index f9c3be3..a264f6f 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/entry/InsertMeasurementMNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/entry/InsertMeasurementMNode.java
@@ -37,7 +37,7 @@ import java.util.Map;
/**
* Generated entity implements IMeasurementMNode interface to unify insert logic through id table
- * and schemaEngine
+ * and SchemaProcessor
*/
public class InsertMeasurementMNode implements IMeasurementMNode {
SchemaEntry schemaEntry;
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/lastCache/LastCacheManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/lastCache/LastCacheManager.java
index 7dc0e71..741a701 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/lastCache/LastCacheManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/lastCache/LastCacheManager.java
@@ -50,7 +50,7 @@ public class LastCacheManager {
* get the last cache value of time series of given seriesPath
*
* @param node the measurementMNode holding the lastCache When invoker only has the target
- * seriesPath, the node could be null and SchemaEngine will search the node
+ * seriesPath, the node could be null and SchemaProcessor will search the node
* @return the last cache value
*/
public static TimeValuePair getLastCache(IMeasurementMNode node) {
@@ -68,7 +68,7 @@ public class LastCacheManager {
* update the last cache value of time series of given seriesPath
*
* @param node the measurementMNode holding the lastCache When invoker only has the target
- * seriesPath, the node could be null and SchemaEngine will search the node
+ * seriesPath, the node could be null and SchemaProcessor will search the node
* @param timeValuePair the latest point value
* @param highPriorityUpdate the last value from insertPlan is high priority
* @param latestFlushedTime latest flushed time
@@ -92,7 +92,7 @@ public class LastCacheManager {
* reset the last cache value of time series of given seriesPath
*
* @param node the measurementMNode holding the lastCache When invoker only has the target
- * seriesPath, the node could be null and SchemaEngine will search the node
+ * seriesPath, the node could be null and SchemaProcessor will search the node
*/
public static void resetLastCache(IMeasurementMNode node) {
if (node == null) {
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSG.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSG.java
index 092af11..3c5fc62 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSG.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSG.java
@@ -27,8 +27,8 @@ import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.metadata.PathAlreadyExistException;
import org.apache.iotdb.db.exception.metadata.StorageGroupAlreadySetException;
import org.apache.iotdb.db.exception.metadata.StorageGroupNotSetException;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.MetadataConstant;
-import org.apache.iotdb.db.metadata.SchemaEngine;
import org.apache.iotdb.db.metadata.mnode.IMNode;
import org.apache.iotdb.db.metadata.mnode.IStorageGroupMNode;
import org.apache.iotdb.db.metadata.mnode.InternalMNode;
@@ -426,7 +426,7 @@ public class MTreeAboveSG {
/** Get all paths from root to the given level */
public Pair<List<PartialPath>, Set<PartialPath>> getNodesListInGivenLevel(
- PartialPath pathPattern, int nodeLevel, SchemaEngine.StorageGroupFilter filter)
+ PartialPath pathPattern, int nodeLevel, LocalSchemaProcessor.StorageGroupFilter filter)
throws MetadataException {
MNodeAboveSGCollector<List<PartialPath>> collector =
new MNodeAboveSGCollector<List<PartialPath>>(root, pathPattern) {
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSG.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSG.java
index f7dacde..d6f8d11 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSG.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSG.java
@@ -27,8 +27,8 @@ import org.apache.iotdb.db.exception.metadata.PathAlreadyExistException;
import org.apache.iotdb.db.exception.metadata.PathNotExistException;
import org.apache.iotdb.db.exception.metadata.TemplateImcompatibeException;
import org.apache.iotdb.db.exception.metadata.TemplateIsInUseException;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor.StorageGroupFilter;
import org.apache.iotdb.db.metadata.MetadataConstant;
-import org.apache.iotdb.db.metadata.SchemaEngine.StorageGroupFilter;
import org.apache.iotdb.db.metadata.mnode.IEntityMNode;
import org.apache.iotdb.db.metadata.mnode.IMNode;
import org.apache.iotdb.db.metadata.mnode.IMeasurementMNode;
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/traverser/collector/MNodeCollector.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/traverser/collector/MNodeCollector.java
index cde3cc1..e7ca79e 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/traverser/collector/MNodeCollector.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/traverser/collector/MNodeCollector.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.db.metadata.mtree.traverser.collector;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine.StorageGroupFilter;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor.StorageGroupFilter;
import org.apache.iotdb.db.metadata.mnode.IMNode;
import org.apache.iotdb.db.metadata.path.PartialPath;
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaEngine.java
similarity index 87%
rename from server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionManager.java
rename to server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaEngine.java
index fe5c400..ff1d1ab 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaEngine.java
@@ -29,20 +29,20 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
// manage all the schemaRegion in this dataNode
-public class SchemaRegionManager {
+public class SchemaEngine {
private Map<SchemaRegionId, SchemaRegion> schemaRegionMap;
- private static class SchemaRegionManagerHolder {
- private static final SchemaRegionManager INSTANCE = new SchemaRegionManager();
+ private static class SchemaEngineManagerHolder {
+ private static final SchemaEngine INSTANCE = new SchemaEngine();
- private SchemaRegionManagerHolder() {}
+ private SchemaEngineManagerHolder() {}
}
- private SchemaRegionManager() {}
+ private SchemaEngine() {}
- public static SchemaRegionManager getInstance() {
- return SchemaRegionManagerHolder.INSTANCE;
+ public static SchemaEngine getInstance() {
+ return SchemaEngineManagerHolder.INSTANCE;
}
public void init() {
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegion.java b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegion.java
index ae45aea..b1407ad 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegion.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegion.java
@@ -35,8 +35,8 @@ import org.apache.iotdb.db.exception.metadata.PathAlreadyExistException;
import org.apache.iotdb.db.exception.metadata.PathNotExistException;
import org.apache.iotdb.db.exception.metadata.SchemaDirCreationFailureException;
import org.apache.iotdb.db.exception.metadata.TemplateIsInUseException;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.MetadataConstant;
-import org.apache.iotdb.db.metadata.SchemaEngine;
import org.apache.iotdb.db.metadata.idtable.IDTable;
import org.apache.iotdb.db.metadata.idtable.IDTableManager;
import org.apache.iotdb.db.metadata.logfile.MLogReader;
@@ -824,7 +824,7 @@ public class SchemaRegion {
// region Interfaces for level Node info Query
public List<PartialPath> getNodesListInGivenLevel(
- PartialPath pathPattern, int nodeLevel, SchemaEngine.StorageGroupFilter filter)
+ PartialPath pathPattern, int nodeLevel, LocalSchemaProcessor.StorageGroupFilter filter)
throws MetadataException {
return mtree.getNodesListInGivenLevel(pathPattern, nodeLevel, filter);
}
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/storagegroup/IStorageGroupSchemaManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/storagegroup/IStorageGroupSchemaManager.java
index 5d48f03..0f4d0c1 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/storagegroup/IStorageGroupSchemaManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/storagegroup/IStorageGroupSchemaManager.java
@@ -20,7 +20,7 @@ package org.apache.iotdb.db.metadata.storagegroup;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.metadata.StorageGroupNotSetException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.mnode.IStorageGroupMNode;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.tsfile.utils.Pair;
@@ -173,7 +173,7 @@ public interface IStorageGroupSchemaManager {
PartialPath pathPattern, int level, boolean isPrefixMatch) throws MetadataException;
Pair<List<PartialPath>, Set<PartialPath>> getNodesListInGivenLevel(
- PartialPath pathPattern, int nodeLevel, SchemaEngine.StorageGroupFilter filter)
+ PartialPath pathPattern, int nodeLevel, LocalSchemaProcessor.StorageGroupFilter filter)
throws MetadataException;
/**
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/storagegroup/StorageGroupSchemaManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/storagegroup/StorageGroupSchemaManager.java
index c42843e..1190a07 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/storagegroup/StorageGroupSchemaManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/storagegroup/StorageGroupSchemaManager.java
@@ -23,7 +23,7 @@ import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.metadata.StorageGroupNotSetException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.mnode.IStorageGroupMNode;
import org.apache.iotdb.db.metadata.mtree.MTreeAboveSG;
import org.apache.iotdb.db.metadata.path.PartialPath;
@@ -247,7 +247,7 @@ public class StorageGroupSchemaManager implements IStorageGroupSchemaManager {
@Override
public Pair<List<PartialPath>, Set<PartialPath>> getNodesListInGivenLevel(
- PartialPath pathPattern, int nodeLevel, SchemaEngine.StorageGroupFilter filter)
+ PartialPath pathPattern, int nodeLevel, LocalSchemaProcessor.StorageGroupFilter filter)
throws MetadataException {
return mtree.getNodesListInGivenLevel(pathPattern, nodeLevel, filter);
}
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/upgrade/MetadataUpgrader.java b/server/src/main/java/org/apache/iotdb/db/metadata/upgrade/MetadataUpgrader.java
index d8f0372..2c7c7e8 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/upgrade/MetadataUpgrader.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/upgrade/MetadataUpgrader.java
@@ -21,8 +21,8 @@ package org.apache.iotdb.db.metadata.upgrade;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.metadata.MetadataException;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.MetadataConstant;
-import org.apache.iotdb.db.metadata.SchemaEngine;
import org.apache.iotdb.db.metadata.logfile.MLogReader;
import org.apache.iotdb.db.metadata.mnode.IMNode;
import org.apache.iotdb.db.metadata.mnode.IMeasurementMNode;
@@ -85,7 +85,7 @@ public class MetadataUpgrader {
private File snapshotFile = new File(mtreeSnapshotPath);
private File snapshotTmpFile = new File(mtreeSnapshotTmpPath);
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
/**
* There are at most four files of old versions:
@@ -205,7 +205,7 @@ public class MetadataUpgrader {
try (TagLogFile tagLogFile = new TagLogFile(schemaDirPath, MetadataConstant.TAG_LOG)) {
for (IStorageGroupMNode storageGroupMNode : sgMeasurementMap.keySet()) {
try {
- schemaEngine.setStorageGroup(storageGroupMNode.getPartialPath());
+ schemaProcessor.setStorageGroup(storageGroupMNode.getPartialPath());
for (IMeasurementMNode measurementMNode : sgMeasurementMap.get(storageGroupMNode)) {
schema = measurementMNode.getSchema();
if (measurementMNode.getOffset() != -1) {
@@ -226,7 +226,7 @@ public class MetadataUpgrader {
tags,
attributes,
measurementMNode.getAlias());
- schemaEngine.createTimeseries(createTimeSeriesPlan);
+ schemaProcessor.createTimeseries(createTimeSeriesPlan);
}
} catch (MetadataException e) {
logger.error("Error occurred during recovering metadata from snapshot", e);
@@ -309,23 +309,24 @@ public class MetadataUpgrader {
try {
switch (plan.getOperatorType()) {
case CREATE_TIMESERIES:
- processCreateTimeseries((CreateTimeSeriesPlan) plan, schemaEngine, tagLogFile);
+ processCreateTimeseries((CreateTimeSeriesPlan) plan, schemaProcessor, tagLogFile);
break;
case CHANGE_TAG_OFFSET:
- processChangeTagOffset((ChangeTagOffsetPlan) plan, schemaEngine, tagLogFile);
+ processChangeTagOffset((ChangeTagOffsetPlan) plan, schemaProcessor, tagLogFile);
break;
case SET_STORAGE_GROUP:
processSetStorageGroup(
- (SetStorageGroupPlan) plan, schemaEngine, setTemplatePlanAboveSG);
+ (SetStorageGroupPlan) plan, schemaProcessor, setTemplatePlanAboveSG);
break;
case SET_TEMPLATE:
- processSetTemplate((SetTemplatePlan) plan, schemaEngine, setTemplatePlanAboveSG);
+ processSetTemplate((SetTemplatePlan) plan, schemaProcessor, setTemplatePlanAboveSG);
break;
case UNSET_TEMPLATE:
- processUnSetTemplate((UnsetTemplatePlan) plan, schemaEngine, setTemplatePlanAboveSG);
+ processUnSetTemplate(
+ (UnsetTemplatePlan) plan, schemaProcessor, setTemplatePlanAboveSG);
break;
default:
- schemaEngine.operation(plan);
+ schemaProcessor.operation(plan);
}
} catch (MetadataException e) {
logger.error("Error occurred during redo mlog: ", e);
@@ -337,48 +338,55 @@ public class MetadataUpgrader {
}
private void processCreateTimeseries(
- CreateTimeSeriesPlan createTimeSeriesPlan, SchemaEngine schemaEngine, TagLogFile tagLogFile)
+ CreateTimeSeriesPlan createTimeSeriesPlan,
+ LocalSchemaProcessor schemaProcessor,
+ TagLogFile tagLogFile)
throws MetadataException, IOException {
long offset;
offset = createTimeSeriesPlan.getTagOffset();
createTimeSeriesPlan.setTagOffset(-1);
createTimeSeriesPlan.setTags(null);
createTimeSeriesPlan.setAttributes(null);
- schemaEngine.operation(createTimeSeriesPlan);
+ schemaProcessor.operation(createTimeSeriesPlan);
if (offset != -1) {
- rewriteTagAndAttribute(createTimeSeriesPlan.getPath(), offset, schemaEngine, tagLogFile);
+ rewriteTagAndAttribute(createTimeSeriesPlan.getPath(), offset, schemaProcessor, tagLogFile);
}
}
private void processChangeTagOffset(
- ChangeTagOffsetPlan changeTagOffsetPlan, SchemaEngine schemaEngine, TagLogFile tagLogFile)
+ ChangeTagOffsetPlan changeTagOffsetPlan,
+ LocalSchemaProcessor schemaProcessor,
+ TagLogFile tagLogFile)
throws MetadataException, IOException {
rewriteTagAndAttribute(
- changeTagOffsetPlan.getPath(), changeTagOffsetPlan.getOffset(), schemaEngine, tagLogFile);
+ changeTagOffsetPlan.getPath(),
+ changeTagOffsetPlan.getOffset(),
+ schemaProcessor,
+ tagLogFile);
}
private void rewriteTagAndAttribute(
- PartialPath path, long offset, SchemaEngine schemaEngine, TagLogFile tagLogFile)
+ PartialPath path, long offset, LocalSchemaProcessor schemaProcessor, TagLogFile tagLogFile)
throws IOException, MetadataException {
Pair<Map<String, String>, Map<String, String>> pair =
tagLogFile.read(config.getTagAttributeTotalSize(), offset);
- schemaEngine.addTags(pair.left, path);
- schemaEngine.addAttributes(pair.right, path);
+ schemaProcessor.addTags(pair.left, path);
+ schemaProcessor.addAttributes(pair.right, path);
}
private void processSetStorageGroup(
SetStorageGroupPlan setStorageGroupPlan,
- SchemaEngine schemaEngine,
+ LocalSchemaProcessor schemaProcessor,
Map<String, Map<String, SetTemplatePlan>> setTemplatePlanAboveSG)
throws IOException, MetadataException {
- schemaEngine.operation(setStorageGroupPlan);
+ schemaProcessor.operation(setStorageGroupPlan);
String storageGroupPath = setStorageGroupPlan.getPath().getFullPath();
String templatePath;
for (Map<String, SetTemplatePlan> pathPlanMap : setTemplatePlanAboveSG.values()) {
for (SetTemplatePlan setTemplatePlan : pathPlanMap.values()) {
templatePath = setTemplatePlan.getPrefixPath();
if (storageGroupPath.startsWith(templatePath)) {
- schemaEngine.setSchemaTemplate(
+ schemaProcessor.setSchemaTemplate(
new SetTemplatePlan(setTemplatePlan.getTemplateName(), storageGroupPath));
}
}
@@ -387,11 +395,11 @@ public class MetadataUpgrader {
private void processSetTemplate(
SetTemplatePlan setTemplatePlan,
- SchemaEngine schemaEngine,
+ LocalSchemaProcessor schemaProcessor,
Map<String, Map<String, SetTemplatePlan>> setTemplatePlanAboveSG)
throws MetadataException {
PartialPath path = new PartialPath(setTemplatePlan.getPrefixPath());
- List<PartialPath> storageGroupPathList = schemaEngine.getMatchedStorageGroups(path, true);
+ List<PartialPath> storageGroupPathList = schemaProcessor.getMatchedStorageGroups(path, true);
if (storageGroupPathList.size() > 1 || !path.equals(storageGroupPathList.get(0))) {
String templateName = setTemplatePlan.getTemplateName();
if (!setTemplatePlanAboveSG.containsKey(templateName)) {
@@ -403,25 +411,25 @@ public class MetadataUpgrader {
}
for (PartialPath storageGroupPath : storageGroupPathList) {
- schemaEngine.setSchemaTemplate(
+ schemaProcessor.setSchemaTemplate(
new SetTemplatePlan(setTemplatePlan.getTemplateName(), storageGroupPath.getFullPath()));
}
}
private void processUnSetTemplate(
UnsetTemplatePlan unsetTemplatePlan,
- SchemaEngine schemaEngine,
+ LocalSchemaProcessor schemaProcessor,
Map<String, Map<String, SetTemplatePlan>> setTemplatePlanAboveSG)
throws MetadataException {
PartialPath path = new PartialPath(unsetTemplatePlan.getPrefixPath());
- List<PartialPath> storageGroupPathList = schemaEngine.getMatchedStorageGroups(path, true);
+ List<PartialPath> storageGroupPathList = schemaProcessor.getMatchedStorageGroups(path, true);
if (storageGroupPathList.size() > 1 || !path.equals(storageGroupPathList.get(0))) {
setTemplatePlanAboveSG
.get(unsetTemplatePlan.getTemplateName())
.remove(unsetTemplatePlan.getPrefixPath());
}
for (PartialPath storageGroupPath : storageGroupPathList) {
- schemaEngine.unsetSchemaTemplate(
+ schemaProcessor.unsetSchemaTemplate(
new UnsetTemplatePlan(
storageGroupPath.getFullPath(), unsetTemplatePlan.getTemplateName()));
}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/scheduler/StandaloneScheduler.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/scheduler/StandaloneScheduler.java
index d876561..e09ddc5 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/scheduler/StandaloneScheduler.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/scheduler/StandaloneScheduler.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.db.mpp.execution.scheduler;
import org.apache.iotdb.db.engine.StorageEngine;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.mpp.common.FragmentInstanceId;
import org.apache.iotdb.db.mpp.common.PlanFragmentId;
import org.apache.iotdb.db.mpp.execution.FragmentInfo;
@@ -30,7 +30,7 @@ public class StandaloneScheduler implements IScheduler {
private static final StorageEngine STORAGE_ENGINE = StorageEngine.getInstance();
- private static final SchemaEngine SCHEMA_ENGINE = SchemaEngine.getInstance();
+ private static final LocalSchemaProcessor SCHEMA_ENGINE = LocalSchemaProcessor.getInstance();
@Override
public void start() {}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/sql/rewriter/ConcatPathRewriter.java b/server/src/main/java/org/apache/iotdb/db/mpp/sql/rewriter/ConcatPathRewriter.java
index d1c94e6..7187025 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/sql/rewriter/ConcatPathRewriter.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/sql/rewriter/ConcatPathRewriter.java
@@ -355,7 +355,8 @@ public class ConcatPathRewriter implements IStatementRewriter {
try {
for (PartialPath originalPath : originalPaths) {
List<MeasurementPath> all =
- IoTDB.schemaEngine.getMeasurementPathsWithAlias(originalPath, 0, 0, isPrefixMatch).left;
+ IoTDB.schemaProcessor.getMeasurementPathsWithAlias(originalPath, 0, 0, isPrefixMatch)
+ .left;
if (all.isEmpty()) {
throw new StatementAnalyzeException(
String.format("Unknown time series %s in `where clause`", originalPath));
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/sql/rewriter/WildcardsRemover.java b/server/src/main/java/org/apache/iotdb/db/mpp/sql/rewriter/WildcardsRemover.java
index 894f560..bba7483 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/sql/rewriter/WildcardsRemover.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/sql/rewriter/WildcardsRemover.java
@@ -68,7 +68,7 @@ public class WildcardsRemover {
throws StatementAnalyzeException {
try {
Pair<List<MeasurementPath>, Integer> pair =
- IoTDB.schemaEngine.getMeasurementPathsWithAlias(
+ IoTDB.schemaProcessor.getMeasurementPathsWithAlias(
path, currentLimit, currentOffset, isPrefixMatch);
consumed += pair.right;
currentOffset -= Math.min(currentOffset, pair.right);
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index 0025930..482ae16 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -408,7 +408,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean createTemplate(CreateTemplatePlan createTemplatePlan)
throws QueryProcessException {
try {
- IoTDB.schemaEngine.createSchemaTemplate(createTemplatePlan);
+ IoTDB.schemaProcessor.createSchemaTemplate(createTemplatePlan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -417,7 +417,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean dropTemplate(DropTemplatePlan dropTemplatePlan) throws QueryProcessException {
try {
- IoTDB.schemaEngine.dropSchemaTemplate(dropTemplatePlan);
+ IoTDB.schemaProcessor.dropSchemaTemplate(dropTemplatePlan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -426,7 +426,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean appendTemplate(AppendTemplatePlan plan) throws QueryProcessException {
try {
- IoTDB.schemaEngine.appendSchemaTemplate(plan);
+ IoTDB.schemaProcessor.appendSchemaTemplate(plan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -435,7 +435,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean pruneTemplate(PruneTemplatePlan plan) throws QueryProcessException {
try {
- IoTDB.schemaEngine.pruneSchemaTemplate(plan);
+ IoTDB.schemaProcessor.pruneSchemaTemplate(plan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -444,7 +444,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean setTemplate(SetTemplatePlan setTemplatePlan) throws QueryProcessException {
try {
- IoTDB.schemaEngine.setSchemaTemplate(setTemplatePlan);
+ IoTDB.schemaProcessor.setSchemaTemplate(setTemplatePlan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -454,7 +454,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean activateTemplate(ActivateTemplatePlan activateTemplatePlan)
throws QueryProcessException {
try {
- IoTDB.schemaEngine.setUsingSchemaTemplate(activateTemplatePlan);
+ IoTDB.schemaProcessor.setUsingSchemaTemplate(activateTemplatePlan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -463,7 +463,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean unsetTemplate(UnsetTemplatePlan unsetTemplatePlan) throws QueryProcessException {
try {
- IoTDB.schemaEngine.unsetSchemaTemplate(unsetTemplatePlan);
+ IoTDB.schemaProcessor.unsetSchemaTemplate(unsetTemplatePlan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -770,34 +770,34 @@ public class PlanExecutor implements IPlanExecutor {
}
protected int getDevicesNum(PartialPath path, boolean isPrefixMatch) throws MetadataException {
- return IoTDB.schemaEngine.getDevicesNum(path, isPrefixMatch);
+ return IoTDB.schemaProcessor.getDevicesNum(path, isPrefixMatch);
}
private int getStorageGroupNum(PartialPath path, boolean isPrefixMatch) throws MetadataException {
- return IoTDB.schemaEngine.getStorageGroupNum(path, isPrefixMatch);
+ return IoTDB.schemaProcessor.getStorageGroupNum(path, isPrefixMatch);
}
protected int getPathsNum(PartialPath path, boolean isPrefixMatch) throws MetadataException {
- return IoTDB.schemaEngine.getAllTimeseriesCount(path, isPrefixMatch);
+ return IoTDB.schemaProcessor.getAllTimeseriesCount(path, isPrefixMatch);
}
protected int getNodesNumInGivenLevel(PartialPath path, int level, boolean isPrefixMatch)
throws MetadataException {
- return IoTDB.schemaEngine.getNodesCountInGivenLevel(path, level, isPrefixMatch);
+ return IoTDB.schemaProcessor.getNodesCountInGivenLevel(path, level, isPrefixMatch);
}
protected List<MeasurementPath> getPathsName(PartialPath path) throws MetadataException {
- return IoTDB.schemaEngine.getMeasurementPaths(path);
+ return IoTDB.schemaProcessor.getMeasurementPaths(path);
}
protected List<PartialPath> getNodesList(PartialPath schemaPattern, int level)
throws MetadataException {
- return IoTDB.schemaEngine.getNodesListInGivenLevel(schemaPattern, level);
+ return IoTDB.schemaProcessor.getNodesListInGivenLevel(schemaPattern, level);
}
private Map<PartialPath, Integer> getTimeseriesCountGroupByLevel(CountPlan countPlan)
throws MetadataException {
- return IoTDB.schemaEngine.getMeasurementCountGroupByLevel(
+ return IoTDB.schemaProcessor.getMeasurementCountGroupByLevel(
countPlan.getPath(), countPlan.getLevel(), countPlan.isPrefixMatch());
}
@@ -829,7 +829,7 @@ public class PlanExecutor implements IPlanExecutor {
}
protected Set<String> getPathNextChildren(PartialPath path) throws MetadataException {
- return IoTDB.schemaEngine.getChildNodePathInNextLevel(path);
+ return IoTDB.schemaProcessor.getChildNodePathInNextLevel(path);
}
private QueryDataSet processShowChildNodes(ShowChildNodesPlan showChildNodesPlan)
@@ -851,12 +851,12 @@ public class PlanExecutor implements IPlanExecutor {
}
protected Set<String> getNodeNextChildren(PartialPath path) throws MetadataException {
- return IoTDB.schemaEngine.getChildNodeNameInNextLevel(path);
+ return IoTDB.schemaProcessor.getChildNodeNameInNextLevel(path);
}
protected List<PartialPath> getStorageGroupNames(PartialPath path, boolean isPrefixMatch)
throws MetadataException {
- return IoTDB.schemaEngine.getMatchedStorageGroups(path, isPrefixMatch);
+ return IoTDB.schemaProcessor.getMatchedStorageGroups(path, isPrefixMatch);
}
private QueryDataSet processShowStorageGroup(ShowStorageGroupPlan showStorageGroupPlan)
@@ -920,7 +920,7 @@ public class PlanExecutor implements IPlanExecutor {
}
protected List<IStorageGroupMNode> getAllStorageGroupNodes() {
- return IoTDB.schemaEngine.getAllStorageGroupNodes();
+ return IoTDB.schemaProcessor.getAllStorageGroupNodes();
}
private QueryDataSet processShowTTLQuery(ShowTTLPlan showTTLPlan) {
@@ -1089,7 +1089,7 @@ public class PlanExecutor implements IPlanExecutor {
new ListDataSet(
Collections.singletonList(new PartialPath(COLUMN_SCHEMA_TEMPLATE, false)),
Collections.singletonList(TSDataType.TEXT));
- Set<String> allTemplates = IoTDB.schemaEngine.getAllTemplates();
+ Set<String> allTemplates = IoTDB.schemaProcessor.getAllTemplates();
for (String templateName : allTemplates) {
RowRecord rowRecord = new RowRecord(0); // ignore timestamp
rowRecord.addField(Binary.valueOf(templateName), TSDataType.TEXT);
@@ -1110,7 +1110,7 @@ public class PlanExecutor implements IPlanExecutor {
Arrays.asList(TSDataType.TEXT, TSDataType.TEXT, TSDataType.TEXT, TSDataType.TEXT));
try {
List<Pair<String, IMeasurementSchema>> measurements =
- IoTDB.schemaEngine.getSchemasInTemplate(showPlan.getTemplateName(), "");
+ IoTDB.schemaProcessor.getSchemasInTemplate(showPlan.getTemplateName(), "");
for (Pair<String, IMeasurementSchema> measurement : measurements) {
RowRecord rowRecord = new RowRecord(0); // ignore timestamp
rowRecord.addField(Binary.valueOf(measurement.left), TSDataType.TEXT);
@@ -1136,7 +1136,7 @@ public class PlanExecutor implements IPlanExecutor {
Collections.singletonList(new PartialPath(COLUMN_CHILD_PATHS, false)),
Collections.singletonList(TSDataType.TEXT));
try {
- Set<String> paths = IoTDB.schemaEngine.getPathsUsingTemplate(showPlan.getTemplateName());
+ Set<String> paths = IoTDB.schemaProcessor.getPathsUsingTemplate(showPlan.getTemplateName());
for (String path : paths) {
RowRecord rowRecord = new RowRecord(0); // ignore timestamp
rowRecord.addField(Binary.valueOf(path), TSDataType.TEXT);
@@ -1155,7 +1155,7 @@ public class PlanExecutor implements IPlanExecutor {
Collections.singletonList(new PartialPath(COLUMN_CHILD_PATHS, false)),
Collections.singletonList(TSDataType.TEXT));
try {
- Set<String> paths = IoTDB.schemaEngine.getPathsSetTemplate(showPlan.getTemplateName());
+ Set<String> paths = IoTDB.schemaProcessor.getPathsSetTemplate(showPlan.getTemplateName());
for (String path : paths) {
RowRecord rowRecord = new RowRecord(0); // ignore timestamp
rowRecord.addField(Binary.valueOf(path), TSDataType.TEXT);
@@ -1334,11 +1334,11 @@ public class PlanExecutor implements IPlanExecutor {
for (Map.Entry<String, List<TimeseriesMetadata>> entry : metadataSet.entrySet()) {
String deviceId = entry.getKey();
PartialPath devicePath = new PartialPath(deviceId);
- if (!IoTDB.schemaEngine.isPathExist(devicePath)) {
+ if (!IoTDB.schemaProcessor.isPathExist(devicePath)) {
continue;
}
boolean isAlignedInIoTDB =
- IoTDB.schemaEngine.getDeviceNode(devicePath).getAsEntityMNode().isAligned();
+ IoTDB.schemaProcessor.getDeviceNode(devicePath).getAsEntityMNode().isAligned();
boolean isAlignedInTsFile = false;
for (TimeseriesMetadata metadata : entry.getValue()) {
if ("".equals(metadata.getMeasurementId())) {
@@ -1347,8 +1347,8 @@ public class PlanExecutor implements IPlanExecutor {
}
PartialPath fullPath =
new PartialPath(deviceId + TsFileConstant.PATH_SEPARATOR + metadata.getMeasurementId());
- if (IoTDB.schemaEngine.isPathExist(fullPath)) {
- TSDataType dataType = IoTDB.schemaEngine.getSeriesType(fullPath);
+ if (IoTDB.schemaProcessor.isPathExist(fullPath)) {
+ TSDataType dataType = IoTDB.schemaProcessor.getSeriesType(fullPath);
if (dataType != metadata.getTSDataType()) {
throw new QueryProcessException(
String.format(
@@ -1388,13 +1388,13 @@ public class PlanExecutor implements IPlanExecutor {
PartialPath devicePath = new PartialPath(device);
PartialPath storageGroupPath = MetaUtils.getStorageGroupPathByLevel(devicePath, sgLevel);
try {
- IoTDB.schemaEngine.setStorageGroup(storageGroupPath);
+ IoTDB.schemaProcessor.setStorageGroup(storageGroupPath);
} catch (StorageGroupAlreadySetException alreadySetException) {
if (!alreadySetException.getStorageGroupPath().equals(storageGroupPath.getFullPath())) {
throw alreadySetException;
}
}
- for (PartialPath path : IoTDB.schemaEngine.getMeasurementPaths(devicePath, true)) {
+ for (PartialPath path : IoTDB.schemaProcessor.getMeasurementPaths(devicePath, true)) {
existSeriesSet.add(path.getMeasurement());
existSeriesSet.add(path.getMeasurementAlias());
}
@@ -1443,12 +1443,12 @@ public class PlanExecutor implements IPlanExecutor {
compressors.add(schema.getCompressor());
}
- IoTDB.schemaEngine.createAlignedTimeSeries(
+ IoTDB.schemaProcessor.createAlignedTimeSeries(
devicePath, measurements, dataTypes, encodings, compressors);
} else {
for (int i = 0; i < size; i++) {
IMeasurementSchema schema = needRegisterSchema.get(i);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
needRegisterSeries.get(i),
schema.getType(),
schema.getEncodingType(),
@@ -1493,9 +1493,10 @@ public class PlanExecutor implements IPlanExecutor {
private void operateTTL(SetTTLPlan plan) throws QueryProcessException {
try {
List<PartialPath> storageGroupPaths =
- IoTDB.schemaEngine.getMatchedStorageGroups(plan.getStorageGroup(), plan.isPrefixMatch());
+ IoTDB.schemaProcessor.getMatchedStorageGroups(
+ plan.getStorageGroup(), plan.isPrefixMatch());
for (PartialPath storagePath : storageGroupPaths) {
- IoTDB.schemaEngine.setTTL(storagePath, plan.getDataTTL());
+ IoTDB.schemaProcessor.setTTL(storagePath, plan.getDataTTL());
StorageEngine.getInstance().setTTL(storagePath, plan.getDataTTL());
}
} catch (MetadataException e) {
@@ -1842,7 +1843,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean createTimeSeries(CreateTimeSeriesPlan createTimeSeriesPlan)
throws QueryProcessException {
try {
- IoTDB.schemaEngine.createTimeseries(createTimeSeriesPlan);
+ IoTDB.schemaProcessor.createTimeseries(createTimeSeriesPlan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -1852,7 +1853,7 @@ public class PlanExecutor implements IPlanExecutor {
private boolean createAlignedTimeSeries(CreateAlignedTimeSeriesPlan createAlignedTimeSeriesPlan)
throws QueryProcessException {
try {
- IoTDB.schemaEngine.createAlignedTimeSeries(createAlignedTimeSeriesPlan);
+ IoTDB.schemaProcessor.createAlignedTimeSeries(createAlignedTimeSeriesPlan);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -1911,7 +1912,7 @@ public class PlanExecutor implements IPlanExecutor {
deleteTimeSeriesPlan.getPartitionFilter());
}
String failed =
- IoTDB.schemaEngine.deleteTimeseries(path, deleteTimeSeriesPlan.isPrefixMatch());
+ IoTDB.schemaProcessor.deleteTimeseries(path, deleteTimeSeriesPlan.isPrefixMatch());
if (failed != null) {
deleteTimeSeriesPlan
.getResults()
@@ -1938,22 +1939,22 @@ public class PlanExecutor implements IPlanExecutor {
case RENAME:
String beforeName = alterMap.keySet().iterator().next();
String currentName = alterMap.get(beforeName);
- IoTDB.schemaEngine.renameTagOrAttributeKey(beforeName, currentName, path);
+ IoTDB.schemaProcessor.renameTagOrAttributeKey(beforeName, currentName, path);
break;
case SET:
- IoTDB.schemaEngine.setTagsOrAttributesValue(alterMap, path);
+ IoTDB.schemaProcessor.setTagsOrAttributesValue(alterMap, path);
break;
case DROP:
- IoTDB.schemaEngine.dropTagsOrAttributes(alterMap.keySet(), path);
+ IoTDB.schemaProcessor.dropTagsOrAttributes(alterMap.keySet(), path);
break;
case ADD_TAGS:
- IoTDB.schemaEngine.addTags(alterMap, path);
+ IoTDB.schemaProcessor.addTags(alterMap, path);
break;
case ADD_ATTRIBUTES:
- IoTDB.schemaEngine.addAttributes(alterMap, path);
+ IoTDB.schemaProcessor.addAttributes(alterMap, path);
break;
case UPSERT:
- IoTDB.schemaEngine.upsertTagsAndAttributes(
+ IoTDB.schemaProcessor.upsertTagsAndAttributes(
alterTimeSeriesPlan.getAlias(),
alterTimeSeriesPlan.getTagsMap(),
alterTimeSeriesPlan.getAttributesMap(),
@@ -1976,7 +1977,7 @@ public class PlanExecutor implements IPlanExecutor {
AUDIT_LOGGER.info("set storage group to {}", setStorageGroupPlan.getPaths());
PartialPath path = setStorageGroupPlan.getPath();
try {
- IoTDB.schemaEngine.setStorageGroup(path);
+ IoTDB.schemaProcessor.setStorageGroup(path);
} catch (MetadataException e) {
throw new QueryProcessException(e);
}
@@ -1990,7 +1991,7 @@ public class PlanExecutor implements IPlanExecutor {
try {
for (PartialPath storageGroupPath : deleteStorageGroupPlan.getPaths()) {
List<PartialPath> allRelatedStorageGroupPath =
- IoTDB.schemaEngine.getMatchedStorageGroups(
+ IoTDB.schemaProcessor.getMatchedStorageGroups(
storageGroupPath, deleteStorageGroupPlan.isPrefixMatch());
if (allRelatedStorageGroupPath.isEmpty()) {
throw new PathNotExistException(storageGroupPath.getFullPath(), true);
@@ -2000,7 +2001,7 @@ public class PlanExecutor implements IPlanExecutor {
deletePathList.add(path);
}
}
- IoTDB.schemaEngine.deleteStorageGroups(deletePathList);
+ IoTDB.schemaProcessor.deleteStorageGroups(deletePathList);
operateClearCache();
} catch (MetadataException e) {
throw new QueryProcessException(e);
@@ -2270,7 +2271,7 @@ public class PlanExecutor implements IPlanExecutor {
return noExistSg;
}
for (PartialPath storageGroup : storageGroups) {
- if (!IoTDB.schemaEngine.isStorageGroup(storageGroup)) {
+ if (!IoTDB.schemaProcessor.isStorageGroup(storageGroup)) {
noExistSg.add(storageGroup);
}
}
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/QueryOperator.java b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/QueryOperator.java
index 2eafc30..a11bfa9 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/QueryOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/QueryOperator.java
@@ -510,11 +510,11 @@ public class QueryOperator extends Operator {
}
protected Set<PartialPath> getMatchedDevices(PartialPath path) throws MetadataException {
- return IoTDB.schemaEngine.getMatchedDevices(path, isPrefixMatchPath);
+ return IoTDB.schemaProcessor.getMatchedDevices(path, isPrefixMatchPath);
}
protected List<MeasurementPath> getMatchedTimeseries(PartialPath path) throws MetadataException {
- return IoTDB.schemaEngine.getMeasurementPaths(path, isPrefixMatchPath);
+ return IoTDB.schemaProcessor.getMeasurementPaths(path, isPrefixMatchPath);
}
public boolean isEnableTracing() {
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
index f4865bf..14061f0 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
@@ -45,7 +45,7 @@ public abstract class InsertPlan extends PhysicalPlan {
protected String[] measurements;
// get from client
protected TSDataType[] dataTypes;
- // get from SchemaEngine
+ // get from SchemaProcessor
protected IMeasurementMNode[] measurementMNodes;
/**
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/QueryPlan.java b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/QueryPlan.java
index bb44259..a38cb14 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/QueryPlan.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/QueryPlan.java
@@ -120,7 +120,8 @@ public abstract class QueryPlan extends PhysicalPlan {
for (int i = 0; i < resultColumns.size(); ++i) {
if (isJdbcQuery) {
// Separate sgName from the name of resultColumn to reduce the network IO
- String sgName = IoTDB.schemaEngine.getBelongedStorageGroup(getPaths().get(i)).getFullPath();
+ String sgName =
+ IoTDB.schemaProcessor.getBelongedStorageGroup(getPaths().get(i)).getFullPath();
respSgColumns.add(sgName);
if (resultColumns.get(i).getAlias() == null) {
respColumns.add(
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java b/server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
index 083358b..383618f 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
@@ -370,7 +370,8 @@ public class ConcatPathOptimizer implements ILogicalOptimizer {
try {
for (PartialPath originalPath : originalPaths) {
List<MeasurementPath> all =
- IoTDB.schemaEngine.getMeasurementPathsWithAlias(originalPath, 0, 0, isPrefixMatch).left;
+ IoTDB.schemaProcessor.getMeasurementPathsWithAlias(originalPath, 0, 0, isPrefixMatch)
+ .left;
if (all.isEmpty()) {
throw new LogicalOptimizeException(
String.format("Unknown time series %s in `where clause`", originalPath));
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java b/server/src/main/java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java
index dd2171e..330d7de 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java
@@ -44,7 +44,7 @@ public class WildcardsRemover {
private int currentLimit =
IoTDBDescriptor.getInstance().getConfig().getMaxQueryDeduplicatedPathNum() + 1;
- /** Records the path number that the SchemaEngine totally returned. */
+ /** Records the path number that the SchemaProcessor totally returned. */
private int consumed = 0;
/**
@@ -71,7 +71,7 @@ public class WildcardsRemover {
throws LogicalOptimizeException {
try {
Pair<List<MeasurementPath>, Integer> pair =
- IoTDB.schemaEngine.getMeasurementPathsWithAlias(
+ IoTDB.schemaProcessor.getMeasurementPathsWithAlias(
path, currentLimit, currentOffset, isPrefixMatch);
consumed += pair.right;
currentOffset -= Math.min(currentOffset, pair.right);
diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowDevicesDataSet.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowDevicesDataSet.java
index e6be00f..8352926 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowDevicesDataSet.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowDevicesDataSet.java
@@ -69,7 +69,7 @@ public class ShowDevicesDataSet extends ShowDataSet {
@Override
public List<RowRecord> getQueryDataSet() throws MetadataException {
List<ShowDevicesResult> devicesList =
- IoTDB.schemaEngine.getMatchedDevices((ShowDevicesPlan) plan);
+ IoTDB.schemaProcessor.getMatchedDevices((ShowDevicesPlan) plan);
List<RowRecord> records = new ArrayList<>();
for (ShowDevicesResult result : devicesList) {
RowRecord record = new RowRecord(0);
diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowTimeseriesDataSet.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowTimeseriesDataSet.java
index b6e177e..c61506f 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowTimeseriesDataSet.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/ShowTimeseriesDataSet.java
@@ -80,7 +80,7 @@ public class ShowTimeseriesDataSet extends ShowDataSet {
@Override
public List<RowRecord> getQueryDataSet() throws MetadataException {
List<ShowTimeSeriesResult> timeseriesList =
- IoTDB.schemaEngine.showTimeseries((ShowTimeSeriesPlan) plan, context);
+ IoTDB.schemaProcessor.showTimeseries((ShowTimeSeriesPlan) plan, context);
List<RowRecord> records = new ArrayList<>();
for (ShowTimeSeriesResult result : timeseriesList) {
RowRecord record = new RowRecord(0);
diff --git a/server/src/main/java/org/apache/iotdb/db/query/executor/LastQueryExecutor.java b/server/src/main/java/org/apache/iotdb/db/query/executor/LastQueryExecutor.java
index 0fffeec..c5dd1e2 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/executor/LastQueryExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/executor/LastQueryExecutor.java
@@ -168,7 +168,7 @@ public class LastQueryExecutor {
if (ID_TABLE_ENABLED) {
cacheAccessors.add(new IDTableLastCacheAccessor(path));
} else {
- cacheAccessors.add(new SchemaEngineLastCacheAccessor(path));
+ cacheAccessors.add(new SchemaProcessorLastCacheAccessor(path));
}
}
@@ -309,22 +309,22 @@ public class LastQueryExecutor {
void write(TimeValuePair pair);
}
- private static class SchemaEngineLastCacheAccessor implements LastCacheAccessor {
+ private static class SchemaProcessorLastCacheAccessor implements LastCacheAccessor {
private final MeasurementPath path;
private IMeasurementMNode node;
- SchemaEngineLastCacheAccessor(PartialPath seriesPath) {
+ SchemaProcessorLastCacheAccessor(PartialPath seriesPath) {
this.path = (MeasurementPath) seriesPath;
}
public TimeValuePair read() {
try {
- node = IoTDB.schemaEngine.getMeasurementMNode(path);
+ node = IoTDB.schemaProcessor.getMeasurementMNode(path);
} catch (MetadataException e) {
// cluster mode may not get remote node
TimeValuePair timeValuePair;
- timeValuePair = IoTDB.schemaEngine.getLastCache(path);
+ timeValuePair = IoTDB.schemaProcessor.getLastCache(path);
if (timeValuePair != null) {
return timeValuePair;
}
@@ -334,14 +334,14 @@ public class LastQueryExecutor {
return null;
}
- return IoTDB.schemaEngine.getLastCache(node);
+ return IoTDB.schemaProcessor.getLastCache(node);
}
public void write(TimeValuePair pair) {
if (node == null) {
- IoTDB.schemaEngine.updateLastCache(path, pair, false, Long.MIN_VALUE);
+ IoTDB.schemaProcessor.updateLastCache(path, pair, false, Long.MIN_VALUE);
} else {
- IoTDB.schemaEngine.updateLastCache(node, pair, false, Long.MIN_VALUE);
+ IoTDB.schemaProcessor.updateLastCache(node, pair, false, Long.MIN_VALUE);
}
}
}
diff --git a/server/src/main/java/org/apache/iotdb/db/service/IoTDB.java b/server/src/main/java/org/apache/iotdb/db/service/IoTDB.java
index 1c7121e..d320491 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/IoTDB.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/IoTDB.java
@@ -37,7 +37,7 @@ import org.apache.iotdb.db.engine.flush.FlushManager;
import org.apache.iotdb.db.engine.trigger.service.TriggerRegistrationService;
import org.apache.iotdb.db.exception.query.QueryProcessException;
import org.apache.iotdb.db.metadata.LocalConfigManager;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.protocol.influxdb.meta.InfluxDBMetaManager;
import org.apache.iotdb.db.protocol.rest.RestService;
import org.apache.iotdb.db.query.udf.service.TemporaryQueryDataFileService;
@@ -62,7 +62,7 @@ public class IoTDB implements IoTDBMBean {
private final String mbeanName =
String.format("%s:%s=%s", IoTDBConstant.IOTDB_PACKAGE, IoTDBConstant.JMX_TYPE, "IoTDB");
private static final RegisterManager registerManager = new RegisterManager();
- public static SchemaEngine schemaEngine = SchemaEngine.getInstance();
+ public static LocalSchemaProcessor schemaProcessor = LocalSchemaProcessor.getInstance();
public static LocalConfigManager configManager = LocalConfigManager.getInstance();
public static ServiceProvider serviceProvider;
private static boolean clusterMode = false;
@@ -83,8 +83,8 @@ public class IoTDB implements IoTDBMBean {
daemon.active();
}
- public static void setSchemaEngine(SchemaEngine schemaEngine) {
- IoTDB.schemaEngine = schemaEngine;
+ public static void setSchemaProcessor(LocalSchemaProcessor schemaProcessor) {
+ IoTDB.schemaProcessor = schemaProcessor;
}
public static void setServiceProvider(ServiceProvider serviceProvider) {
diff --git a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java
index 04b58a3..b4cbd67 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/TSServiceImpl.java
@@ -384,7 +384,7 @@ public class TSServiceImpl implements TSIService.Iface {
try {
switch (req.getType()) {
case "METADATA_IN_JSON":
- resp.setMetadataInJson(IoTDB.schemaEngine.getMetadataInString());
+ resp.setMetadataInJson(IoTDB.schemaProcessor.getMetadataInString());
status = RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
break;
case "COLUMN":
@@ -415,11 +415,11 @@ public class TSServiceImpl implements TSIService.Iface {
}
protected List<MeasurementPath> getPaths(PartialPath path) throws MetadataException {
- return IoTDB.schemaEngine.getMeasurementPaths(path);
+ return IoTDB.schemaProcessor.getMeasurementPaths(path);
}
protected TSDataType getSeriesTypeByPath(PartialPath path) throws MetadataException {
- return IoTDB.schemaEngine.getSeriesType(path);
+ return IoTDB.schemaProcessor.getSeriesType(path);
}
private boolean executeInsertRowsPlan(InsertRowsPlan insertRowsPlan, List<TSStatus> result) {
@@ -2026,36 +2026,36 @@ public class TSServiceImpl implements TSIService.Iface {
switch (TemplateQueryType.values()[req.getQueryType()]) {
case COUNT_MEASUREMENTS:
resp.setQueryType(TemplateQueryType.COUNT_MEASUREMENTS.ordinal());
- resp.setCount(IoTDB.schemaEngine.countMeasurementsInTemplate(req.name));
+ resp.setCount(IoTDB.schemaProcessor.countMeasurementsInTemplate(req.name));
break;
case IS_MEASUREMENT:
path = req.getMeasurement();
resp.setQueryType(TemplateQueryType.IS_MEASUREMENT.ordinal());
- resp.setResult(IoTDB.schemaEngine.isMeasurementInTemplate(req.name, path));
+ resp.setResult(IoTDB.schemaProcessor.isMeasurementInTemplate(req.name, path));
break;
case PATH_EXIST:
path = req.getMeasurement();
resp.setQueryType(TemplateQueryType.PATH_EXIST.ordinal());
- resp.setResult(IoTDB.schemaEngine.isPathExistsInTemplate(req.name, path));
+ resp.setResult(IoTDB.schemaProcessor.isPathExistsInTemplate(req.name, path));
break;
case SHOW_MEASUREMENTS:
path = req.getMeasurement();
resp.setQueryType(TemplateQueryType.SHOW_MEASUREMENTS.ordinal());
- resp.setMeasurements(IoTDB.schemaEngine.getMeasurementsInTemplate(req.name, path));
+ resp.setMeasurements(IoTDB.schemaProcessor.getMeasurementsInTemplate(req.name, path));
break;
case SHOW_TEMPLATES:
resp.setQueryType(TemplateQueryType.SHOW_TEMPLATES.ordinal());
- resp.setMeasurements(new ArrayList<>(IoTDB.schemaEngine.getAllTemplates()));
+ resp.setMeasurements(new ArrayList<>(IoTDB.schemaProcessor.getAllTemplates()));
break;
case SHOW_SET_TEMPLATES:
path = req.getName();
resp.setQueryType(TemplateQueryType.SHOW_SET_TEMPLATES.ordinal());
- resp.setMeasurements(new ArrayList<>(IoTDB.schemaEngine.getPathsSetTemplate(path)));
+ resp.setMeasurements(new ArrayList<>(IoTDB.schemaProcessor.getPathsSetTemplate(path)));
break;
case SHOW_USING_TEMPLATES:
path = req.getName();
resp.setQueryType(TemplateQueryType.SHOW_USING_TEMPLATES.ordinal());
- resp.setMeasurements(new ArrayList<>(IoTDB.schemaEngine.getPathsUsingTemplate(path)));
+ resp.setMeasurements(new ArrayList<>(IoTDB.schemaProcessor.getPathsUsingTemplate(path)));
break;
}
resp.setStatus(RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS, "Execute successfully"));
diff --git a/server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java
index 06861383..975a123 100644
--- a/server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java
@@ -302,7 +302,7 @@ public class SyncServiceImpl implements SyncService.Iface {
if (plan.getOperatorType() != Operator.OperatorType.CREATE_CONTINUOUS_QUERY
&& plan.getOperatorType() != Operator.OperatorType.DROP_CONTINUOUS_QUERY
&& plan.getOperatorType() != Operator.OperatorType.CHANGE_TAG_OFFSET) {
- IoTDB.schemaEngine.operation(plan);
+ IoTDB.schemaProcessor.operation(plan);
}
} catch (Exception e) {
logger.error(
diff --git a/server/src/main/java/org/apache/iotdb/db/tools/virtualsg/DeviceMappingViewer.java b/server/src/main/java/org/apache/iotdb/db/tools/virtualsg/DeviceMappingViewer.java
index 6b0108f..31f632a 100644
--- a/server/src/main/java/org/apache/iotdb/db/tools/virtualsg/DeviceMappingViewer.java
+++ b/server/src/main/java/org/apache/iotdb/db/tools/virtualsg/DeviceMappingViewer.java
@@ -21,7 +21,7 @@ package org.apache.iotdb.db.tools.virtualsg;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.engine.storagegroup.virtualSg.HashVirtualPartitioner;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.service.IoTDB;
@@ -41,10 +41,10 @@ public class DeviceMappingViewer {
HashVirtualPartitioner partitioner = HashVirtualPartitioner.getInstance();
IoTDB.configManager.init();
- SchemaEngine schemaEngine = SchemaEngine.getInstance();
+ LocalSchemaProcessor schemaProcessor = LocalSchemaProcessor.getInstance();
Set<PartialPath> partialPathSet =
- schemaEngine.getMatchedDevices(new PartialPath("root.**"), false);
+ schemaProcessor.getMatchedDevices(new PartialPath("root.**"), false);
if (partialPathSet.isEmpty() && args.length == 1) {
System.out.println("no mlog in given system schema dir: " + args[0] + " please have a check");
diff --git a/server/src/main/java/org/apache/iotdb/db/utils/SchemaTestUtils.java b/server/src/main/java/org/apache/iotdb/db/utils/SchemaTestUtils.java
index fd5f71f..60fd7b5 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/SchemaTestUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/SchemaTestUtils.java
@@ -32,7 +32,7 @@ public class SchemaTestUtils {
public static MeasurementPath getMeasurementPath(String pathPatternString)
throws MetadataException {
PartialPath pathPattern = new PartialPath(pathPatternString);
- List<MeasurementPath> measurementPaths = IoTDB.schemaEngine.getMeasurementPaths(pathPattern);
+ List<MeasurementPath> measurementPaths = IoTDB.schemaProcessor.getMeasurementPaths(pathPattern);
assertFalse(measurementPaths.isEmpty());
return measurementPaths.get(0);
}
diff --git a/server/src/main/java/org/apache/iotdb/db/utils/SchemaUtils.java b/server/src/main/java/org/apache/iotdb/db/utils/SchemaUtils.java
index ef6110d..b75bb0f 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/SchemaUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/SchemaUtils.java
@@ -98,7 +98,7 @@ public class SchemaUtils {
TSDataType dataType = schema.getType();
TSEncoding encoding = schema.getEncodingType();
CompressionType compressionType = schema.getCompressor();
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path, dataType, encoding, compressionType, Collections.emptyMap());
} catch (PathAlreadyExistException ignored) {
// ignore added timeseries
@@ -126,7 +126,7 @@ public class SchemaUtils {
IMeasurementMNode measurementMNode =
MeasurementMNode.getMeasurementMNode(null, path.getMeasurement(), measurementSchema, null);
- IoTDB.schemaEngine.cacheMeta(path, measurementMNode, true);
+ IoTDB.schemaProcessor.cacheMeta(path, measurementMNode, true);
}
public static List<TSDataType> getSeriesTypesByPaths(Collection<? extends PartialPath> paths) {
diff --git a/server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java b/server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java
index 8790e06..a75fa9e 100644
--- a/server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java
+++ b/server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java
@@ -146,7 +146,7 @@ public class LogReplayer {
private void replayDelete(DeletePlan deletePlan) throws IOException, MetadataException {
List<PartialPath> paths = deletePlan.getPaths();
for (PartialPath path : paths) {
- for (PartialPath device : IoTDB.schemaEngine.getBelongedDevices(path)) {
+ for (PartialPath device : IoTDB.schemaProcessor.getBelongedDevices(path)) {
recoverMemTable.delete(
path, device, deletePlan.getDeleteStartTime(), deletePlan.getDeleteEndTime());
}
@@ -196,7 +196,7 @@ public class LogReplayer {
if (IoTDBDescriptor.getInstance().getConfig().isEnableIDTable()) {
virtualStorageGroupProcessor.getIdTable().getSeriesSchemas(plan);
} else {
- IoTDB.schemaEngine.getSeriesSchemasAndReadLockDevice(plan);
+ IoTDB.schemaProcessor.getSeriesSchemasAndReadLockDevice(plan);
plan.setDeviceID(DeviceIDFactory.getInstance().getDeviceID(plan.getDevicePath()));
}
} catch (IOException | MetadataException e) {
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/MetadataManagerHelper.java b/server/src/test/java/org/apache/iotdb/db/engine/MetadataManagerHelper.java
index ef4c431..b3e1d73 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/MetadataManagerHelper.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/MetadataManagerHelper.java
@@ -18,7 +18,7 @@
*/
package org.apache.iotdb.db.engine;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.service.IoTDB;
import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
@@ -32,119 +32,119 @@ public class MetadataManagerHelper {
public static void initMetadata() {
IoTDB.configManager.init();
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle.d0"));
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle.d1"));
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle.d2"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle.d0"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle.d1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle.d2"));
CompressionType compressionType = TSFileDescriptor.getInstance().getConfig().getCompressor();
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s1"),
TSDataType.valueOf("INT64"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s2"),
TSDataType.valueOf("FLOAT"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s3"),
TSDataType.valueOf("DOUBLE"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s4"),
TSDataType.valueOf("BOOLEAN"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s5"),
TSDataType.valueOf("TEXT"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.valueOf("INT64"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s2"),
TSDataType.valueOf("FLOAT"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s3"),
TSDataType.valueOf("DOUBLE"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s4"),
TSDataType.valueOf("BOOLEAN"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s5"),
TSDataType.valueOf("TEXT"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s1"),
TSDataType.valueOf("INT64"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s2"),
TSDataType.valueOf("FLOAT"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s3"),
TSDataType.valueOf("DOUBLE"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s4"),
TSDataType.valueOf("BOOLEAN"),
TSEncoding.PLAIN,
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s5"),
TSDataType.valueOf("TEXT"),
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/cache/ChunkCacheTest.java b/server/src/test/java/org/apache/iotdb/db/engine/cache/ChunkCacheTest.java
index 4e80fb9..4c29925 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/cache/ChunkCacheTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/cache/ChunkCacheTest.java
@@ -146,11 +146,11 @@ public class ChunkCacheTest {
for (int i = 0; i < deviceNum; i++) {
deviceIds[i] = TEST_SG + PATH_SEPARATOR + "device" + i;
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(TEST_SG));
for (String device : deviceIds) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
PartialPath devicePath = new PartialPath(device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
devicePath.concatNode(measurementSchema.getMeasurementId()),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/AbstractCompactionTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/AbstractCompactionTest.java
index 0140662..53fb7e5 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/AbstractCompactionTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/AbstractCompactionTest.java
@@ -227,14 +227,14 @@ public class AbstractCompactionTest {
dataTypes.add(TSDataType.INT64);
encodings.add(TSEncoding.PLAIN);
compressionTypes.add(CompressionType.UNCOMPRESSED);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(COMPACTION_TEST_SG + PATH_SEPARATOR + "d" + i, "s" + j),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
Collections.emptyMap());
}
- IoTDB.schemaEngine.createAlignedTimeSeries(
+ IoTDB.schemaProcessor.createAlignedTimeSeries(
new PartialPath(COMPACTION_TEST_SG + PATH_SEPARATOR + "d" + (i + 10000)),
measurements,
dataTypes,
@@ -242,7 +242,7 @@ public class AbstractCompactionTest {
compressionTypes);
} else {
for (int j = 0; j < measurementNum; j++) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(COMPACTION_TEST_SG + PATH_SEPARATOR + "d" + i, "s" + j),
TSDataType.INT64,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/CompactionSchedulerTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/CompactionSchedulerTest.java
index 75d0d8b..50abf2d 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/CompactionSchedulerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/CompactionSchedulerTest.java
@@ -155,7 +155,7 @@ public class CompactionSchedulerTest {
.setTargetCompactionFileSize(2L * 1024L * 1024L * 1024L);
String sgName = COMPACTION_TEST_SG + "test1";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -166,7 +166,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -290,7 +290,7 @@ public class CompactionSchedulerTest {
.setCrossCompactionMemoryBudget(2 * 1024 * 1024L * 1024L);
String sgName = COMPACTION_TEST_SG + "test2";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -301,7 +301,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -412,7 +412,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(100);
String sgName = COMPACTION_TEST_SG + "test3";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -423,7 +423,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -523,7 +523,7 @@ public class CompactionSchedulerTest {
.setTargetCompactionFileSize(2L * 1024L * 1024L * 1024L);
String sgName = COMPACTION_TEST_SG + "test4";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -534,7 +534,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -618,7 +618,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(100);
String sgName = COMPACTION_TEST_SG + "test5";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -629,7 +629,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -745,7 +745,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(100);
String sgName = COMPACTION_TEST_SG + "test6";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -756,7 +756,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -862,7 +862,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(100);
String sgName = COMPACTION_TEST_SG + "test7";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -873,7 +873,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -975,7 +975,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(100);
String sgName = COMPACTION_TEST_SG + "test8";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -986,7 +986,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -1074,7 +1074,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
String sgName = COMPACTION_TEST_SG + "test9";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -1085,7 +1085,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -1189,7 +1189,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
String sgName = COMPACTION_TEST_SG + "test10";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -1200,7 +1200,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -1308,7 +1308,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
String sgName = COMPACTION_TEST_SG + "test11";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -1319,7 +1319,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -1424,7 +1424,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
String sgName = COMPACTION_TEST_SG + "test12";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -1435,7 +1435,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -1543,7 +1543,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
String sgName = COMPACTION_TEST_SG + "test13";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -1554,7 +1554,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -1664,7 +1664,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
String sgName = COMPACTION_TEST_SG + "test14";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -1675,7 +1675,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
@@ -1793,7 +1793,7 @@ public class CompactionSchedulerTest {
IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
String sgName = COMPACTION_TEST_SG + "test16";
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sgName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sgName));
} catch (Exception e) {
logger.error("exception occurs", e);
}
@@ -1804,7 +1804,7 @@ public class CompactionSchedulerTest {
for (String device : fullPaths) {
fullPath.add(sgName + device);
PartialPath path = new PartialPath(sgName + device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/TestUtilsForAlignedSeries.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/TestUtilsForAlignedSeries.java
index d617f30..5a795a3 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/TestUtilsForAlignedSeries.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/TestUtilsForAlignedSeries.java
@@ -42,13 +42,13 @@ public class TestUtilsForAlignedSeries {
public static void registerTimeSeries(
String storageGroup, String[] devices, IMeasurementSchema[] schemas, boolean[] isAligned)
throws MetadataException {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(storageGroup));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(storageGroup));
for (int i = 0; i < devices.length; ++i) {
boolean aligned = isAligned[i];
String device = devices[i];
if (!aligned) {
for (IMeasurementSchema schema : schemas) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(device, schema.getMeasurementId()),
schema.getType(),
schema.getEncodingType(),
@@ -66,7 +66,7 @@ public class TestUtilsForAlignedSeries {
compressionTypes[j] = schemas[j].getCompressor();
measurements[j] = schemas[j].getMeasurementId();
}
- IoTDB.schemaEngine.createAlignedTimeSeries(
+ IoTDB.schemaProcessor.createAlignedTimeSeries(
new PartialPath(device),
Arrays.asList(measurements),
Arrays.asList(dataTypes),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/cross/CrossSpaceCompactionTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/cross/CrossSpaceCompactionTest.java
index 09a1bc8..a413419 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/cross/CrossSpaceCompactionTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/cross/CrossSpaceCompactionTest.java
@@ -98,10 +98,10 @@ public class CrossSpaceCompactionTest {
@Before
public void setUp() throws MetadataException {
IoTDB.configManager.init();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
for (String fullPath : fullPaths) {
PartialPath path = new PartialPath(fullPath);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/cross/MergeTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/cross/MergeTest.java
index 1cd5989..8d83b9a 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/cross/MergeTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/cross/MergeTest.java
@@ -102,11 +102,11 @@ abstract class MergeTest {
for (int i = 0; i < deviceNum; i++) {
deviceIds[i] = MERGE_TEST_SG + PATH_SEPARATOR + "device" + i;
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(MERGE_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(MERGE_TEST_SG));
for (String device : deviceIds) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
PartialPath devicePath = new PartialPath(device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
devicePath.concatNode(measurementSchema.getMeasurementId()),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/AbstractInnerSpaceCompactionTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/AbstractInnerSpaceCompactionTest.java
index 6dfc8ca..f17875c 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/AbstractInnerSpaceCompactionTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/AbstractInnerSpaceCompactionTest.java
@@ -147,11 +147,11 @@ public abstract class AbstractInnerSpaceCompactionTest {
for (int i = 0; i < deviceNum; i++) {
deviceIds[i] = COMPACTION_TEST_SG + PATH_SEPARATOR + "device" + i;
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
for (String device : deviceIds) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
PartialPath devicePath = new PartialPath(device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
devicePath.concatNode(measurementSchema.getMeasurementId()),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerCompactionMoreDataTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerCompactionMoreDataTest.java
index 220599a..17f4f3c 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerCompactionMoreDataTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerCompactionMoreDataTest.java
@@ -79,11 +79,11 @@ public class InnerCompactionMoreDataTest extends InnerCompactionTest {
for (int i = 0; i < deviceNum; i++) {
deviceIds[i] = COMPACTION_TEST_SG + PATH_SEPARATOR + "device" + i;
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
for (String device : deviceIds) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
PartialPath devicePath = new PartialPath(device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
devicePath.concatNode(measurementSchema.getMeasurementId()),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerCompactionTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerCompactionTest.java
index e01185a..0b699af 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerCompactionTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerCompactionTest.java
@@ -107,11 +107,11 @@ public abstract class InnerCompactionTest {
for (int i = 0; i < deviceNum; i++) {
deviceIds[i] = COMPACTION_TEST_SG + PATH_SEPARATOR + "device" + i;
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
for (String device : deviceIds) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
PartialPath devicePath = new PartialPath(device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
devicePath.concatNode(measurementSchema.getMeasurementId()),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerSeqCompactionTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerSeqCompactionTest.java
index e622963..95f2ae0 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerSeqCompactionTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerSeqCompactionTest.java
@@ -88,10 +88,10 @@ public class InnerSeqCompactionTest {
prevMaxDegreeOfIndexNode = TSFileDescriptor.getInstance().getConfig().getMaxDegreeOfIndexNode();
TSFileDescriptor.getInstance().getConfig().setMaxDegreeOfIndexNode(2);
IoTDB.configManager.init();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
for (String fullPath : fullPaths) {
PartialPath path = new PartialPath(fullPath);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerSpaceCompactionUtilsNoAlignedTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerSpaceCompactionUtilsNoAlignedTest.java
index 30feab1..e63f530 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerSpaceCompactionUtilsNoAlignedTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerSpaceCompactionUtilsNoAlignedTest.java
@@ -141,10 +141,10 @@ public class InnerSpaceCompactionUtilsNoAlignedTest {
for (int i = 0; i < devices.length; ++i) {
devicePath[i] = new PartialPath(storageGroup + "." + devices[i]);
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(storageGroup));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(storageGroup));
for (PartialPath device : devicePath) {
for (MeasurementSchema schema : schemas) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
device.concatNode(schema.getMeasurementId()),
schema.getType(),
schema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerUnseqCompactionTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerUnseqCompactionTest.java
index 2a4ade9..42419d9 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerUnseqCompactionTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/InnerUnseqCompactionTest.java
@@ -99,10 +99,10 @@ public class InnerUnseqCompactionTest {
@Before
public void setUp() throws MetadataException {
IoTDB.configManager.init();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
for (String fullPath : fullPaths) {
PartialPath path = new PartialPath(fullPath);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
TSDataType.INT64,
TSEncoding.valueOf(TSFileDescriptor.getInstance().getConfig().getValueEncoder()),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/sizetiered/SizeTieredCompactionTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/sizetiered/SizeTieredCompactionTest.java
index 19f63a5..65b3d29 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/sizetiered/SizeTieredCompactionTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/inner/sizetiered/SizeTieredCompactionTest.java
@@ -102,11 +102,11 @@ public class SizeTieredCompactionTest {
for (int i = 0; i < deviceNum; i++) {
deviceIds[i] = COMPACTION_TEST_SG + PATH_SEPARATOR + "device" + i;
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
for (String device : deviceIds) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
PartialPath devicePath = new PartialPath(device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
devicePath.concatNode(measurementSchema.getMeasurementId()),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/compaction/recover/SizeTieredCompactionRecoverTest.java b/server/src/test/java/org/apache/iotdb/db/engine/compaction/recover/SizeTieredCompactionRecoverTest.java
index 84a38de..d1744ce 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/compaction/recover/SizeTieredCompactionRecoverTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/compaction/recover/SizeTieredCompactionRecoverTest.java
@@ -159,11 +159,11 @@ public class SizeTieredCompactionRecoverTest {
CompressionType.UNCOMPRESSED);
deviceIds[i] = new PartialPath(fullPaths[i].substring(0, 27));
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(COMPACTION_TEST_SG));
for (int i = 0; i < fullPaths.length; ++i) {
MeasurementSchema schema = schemas[i];
PartialPath deviceId = deviceIds[i];
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
deviceId.concatNode(schema.getMeasurementId()),
schema.getType(),
schema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/modification/DeletionFileNodeTest.java b/server/src/test/java/org/apache/iotdb/db/engine/modification/DeletionFileNodeTest.java
index 204ced8..04d2bc2 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/modification/DeletionFileNodeTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/modification/DeletionFileNodeTest.java
@@ -82,9 +82,9 @@ public class DeletionFileNodeTest {
public void setup() throws MetadataException {
EnvironmentUtils.envSetUp();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(processorName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(processorName));
for (int i = 0; i < 10; i++) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(processorName + TsFileConstant.PATH_SEPARATOR + measurements[i]),
dataType,
encoding,
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/modification/DeletionQueryTest.java b/server/src/test/java/org/apache/iotdb/db/engine/modification/DeletionQueryTest.java
index b85c408..db00ccb 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/modification/DeletionQueryTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/modification/DeletionQueryTest.java
@@ -68,9 +68,9 @@ public class DeletionQueryTest {
@Before
public void setup() throws MetadataException {
EnvironmentUtils.envSetUp();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(processorName));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(processorName));
for (int i = 0; i < 10; i++) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(processorName + TsFileConstant.PATH_SEPARATOR + measurements[i]),
dataType,
encoding,
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/FileNodeManagerBenchmark.java b/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/FileNodeManagerBenchmark.java
index 152244a..45837e6 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/FileNodeManagerBenchmark.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/FileNodeManagerBenchmark.java
@@ -21,7 +21,7 @@ package org.apache.iotdb.db.engine.storagegroup;
import org.apache.iotdb.db.engine.StorageEngine;
import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
import org.apache.iotdb.db.service.IoTDB;
@@ -66,11 +66,11 @@ public class FileNodeManagerBenchmark {
}
private static void prepare() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.setStorageGroup(new PartialPath(prefix));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.setStorageGroup(new PartialPath(prefix));
for (String device : devices) {
for (String measurement : measurements) {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath(device + "." + measurement),
TSDataType.INT64,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/TTLTest.java b/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/TTLTest.java
index 5410c42..a87b895 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/TTLTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/storagegroup/TTLTest.java
@@ -102,15 +102,15 @@ public class TTLTest {
}
private void createSchemas() throws MetadataException, StorageGroupProcessorException {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sg1));
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(sg2));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sg1));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(sg2));
virtualStorageGroupProcessor =
new VirtualStorageGroupProcessor(
IoTDBDescriptor.getInstance().getConfig().getSystemDir(),
sg1,
new DirectFlushPolicy(),
sg1);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(g1s1),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -124,19 +124,20 @@ public class TTLTest {
boolean caught = false;
try {
- IoTDB.schemaEngine.setTTL(new PartialPath(sg1 + ".notExist"), ttl);
+ IoTDB.schemaProcessor.setTTL(new PartialPath(sg1 + ".notExist"), ttl);
} catch (MetadataException e) {
caught = true;
}
assertTrue(caught);
// normally set ttl
- IoTDB.schemaEngine.setTTL(new PartialPath(sg1), ttl);
- IStorageGroupMNode mNode = IoTDB.schemaEngine.getStorageGroupNodeByPath(new PartialPath(sg1));
+ IoTDB.schemaProcessor.setTTL(new PartialPath(sg1), ttl);
+ IStorageGroupMNode mNode =
+ IoTDB.schemaProcessor.getStorageGroupNodeByPath(new PartialPath(sg1));
assertEquals(ttl, mNode.getDataTTL());
// default ttl
- mNode = IoTDB.schemaEngine.getStorageGroupNodeByPath(new PartialPath(sg2));
+ mNode = IoTDB.schemaProcessor.getStorageGroupNodeByPath(new PartialPath(sg2));
assertEquals(Long.MAX_VALUE, mNode.getDataTTL());
}
@@ -408,7 +409,7 @@ public class TTLTest {
public void testShowTTL()
throws IOException, QueryProcessException, QueryFilterOptimizationException,
StorageEngineException, MetadataException, InterruptedException {
- IoTDB.schemaEngine.setTTL(new PartialPath(sg1), ttl);
+ IoTDB.schemaProcessor.setTTL(new PartialPath(sg1), ttl);
ShowTTLPlan plan = new ShowTTLPlan(Collections.emptyList());
PlanExecutor executor = new PlanExecutor();
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineAdvancedTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/SchemaAdvancedTest.java
similarity index 76%
rename from server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineAdvancedTest.java
rename to server/src/test/java/org/apache/iotdb/db/metadata/SchemaAdvancedTest.java
index b66e72e..6c7d8b5 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineAdvancedTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/SchemaAdvancedTest.java
@@ -43,87 +43,87 @@ import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
-public class SchemaEngineAdvancedTest {
+public class SchemaAdvancedTest {
- private static SchemaEngine schemaEngine = null;
+ private static LocalSchemaProcessor schemaProcessor = null;
@Before
public void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- schemaEngine = IoTDB.schemaEngine;
+ schemaProcessor = IoTDB.schemaProcessor;
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle.d0"));
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle.d1"));
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle.d2"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle.d0"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle.d1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle.d2"));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s0"),
TSDataType.INT32,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s1"),
TSDataType.INT64,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s2"),
TSDataType.FLOAT,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s3"),
TSDataType.DOUBLE,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s4"),
TSDataType.BOOLEAN,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d0.s5"),
TSDataType.TEXT,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s0"),
TSDataType.INT32,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.INT64,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s2"),
TSDataType.FLOAT,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s3"),
TSDataType.DOUBLE,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s4"),
TSDataType.BOOLEAN,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s5"),
TSDataType.TEXT,
TSEncoding.PLAIN,
@@ -141,7 +141,7 @@ public class SchemaEngineAdvancedTest {
try {
// test file name
- List<PartialPath> fileNames = schemaEngine.getAllStorageGroupPaths();
+ List<PartialPath> fileNames = schemaProcessor.getAllStorageGroupPaths();
assertEquals(3, fileNames.size());
if (fileNames.get(0).equals(new PartialPath("root.vehicle.d0"))) {
assertEquals(new PartialPath("root.vehicle.d1"), fileNames.get(1));
@@ -151,19 +151,19 @@ public class SchemaEngineAdvancedTest {
// test filename by seriesPath
assertEquals(
new PartialPath("root.vehicle.d0"),
- schemaEngine.getBelongedStorageGroup(new PartialPath("root.vehicle.d0.s1")));
+ schemaProcessor.getBelongedStorageGroup(new PartialPath("root.vehicle.d0.s1")));
List<MeasurementPath> pathList =
- schemaEngine.getMeasurementPaths(new PartialPath("root.vehicle.d1.**"));
+ schemaProcessor.getMeasurementPaths(new PartialPath("root.vehicle.d1.**"));
assertEquals(6, pathList.size());
- pathList = schemaEngine.getMeasurementPaths(new PartialPath("root.vehicle.d0.**"));
+ pathList = schemaProcessor.getMeasurementPaths(new PartialPath("root.vehicle.d0.**"));
assertEquals(6, pathList.size());
- pathList = schemaEngine.getMeasurementPaths(new PartialPath("root.vehicle.d*.**"));
+ pathList = schemaProcessor.getMeasurementPaths(new PartialPath("root.vehicle.d*.**"));
assertEquals(12, pathList.size());
- pathList = schemaEngine.getMeasurementPaths(new PartialPath("root.ve*.**"));
+ pathList = schemaProcessor.getMeasurementPaths(new PartialPath("root.ve*.**"));
assertEquals(12, pathList.size());
- pathList = schemaEngine.getMeasurementPaths(new PartialPath("root.vehicle*.d*.s1"));
+ pathList = schemaProcessor.getMeasurementPaths(new PartialPath("root.vehicle*.d*.s1"));
assertEquals(2, pathList.size());
- pathList = schemaEngine.getMeasurementPaths(new PartialPath("root.vehicle.d2.**"));
+ pathList = schemaProcessor.getMeasurementPaths(new PartialPath("root.vehicle.d2.**"));
assertEquals(0, pathList.size());
} catch (MetadataException e) {
e.printStackTrace();
@@ -173,41 +173,41 @@ public class SchemaEngineAdvancedTest {
@Test
public void testCache() throws MetadataException {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s0"),
TSDataType.DOUBLE,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s1"),
TSDataType.BOOLEAN,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s2.g0"),
TSDataType.TEXT,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s3"),
TSDataType.TEXT,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- IMNode node = schemaEngine.getDeviceNode(new PartialPath("root.vehicle.d0"));
+ IMNode node = schemaProcessor.getDeviceNode(new PartialPath("root.vehicle.d0"));
Assert.assertEquals(
TSDataType.INT32, node.getChild("s0").getAsMeasurementMNode().getSchema().getType());
- Assert.assertFalse(schemaEngine.isPathExist(new PartialPath("root.vehicle.d100")));
+ Assert.assertFalse(schemaProcessor.isPathExist(new PartialPath("root.vehicle.d100")));
}
@Test
public void testCachedLastTimeValue() throws MetadataException {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s0"),
TSDataType.DOUBLE,
TSEncoding.RLE,
@@ -218,11 +218,11 @@ public class SchemaEngineAdvancedTest {
TimeValuePair tv2 = new TimeValuePair(2000, TsPrimitiveType.getByType(TSDataType.DOUBLE, 3.0));
TimeValuePair tv3 = new TimeValuePair(1500, TsPrimitiveType.getByType(TSDataType.DOUBLE, 2.5));
PartialPath path = new PartialPath("root.vehicle.d2.s0");
- IMeasurementMNode node = schemaEngine.getMeasurementMNode(path);
+ IMeasurementMNode node = schemaProcessor.getMeasurementMNode(path);
LastCacheManager.updateLastCache(node, tv1, true, Long.MIN_VALUE);
LastCacheManager.updateLastCache(node, tv2, true, Long.MIN_VALUE);
- Assert.assertEquals(tv2.getTimestamp(), schemaEngine.getLastCache(node).getTimestamp());
+ Assert.assertEquals(tv2.getTimestamp(), schemaProcessor.getLastCache(node).getTimestamp());
LastCacheManager.updateLastCache(node, tv3, true, Long.MIN_VALUE);
- Assert.assertEquals(tv2.getTimestamp(), schemaEngine.getLastCache(node).getTimestamp());
+ Assert.assertEquals(tv2.getTimestamp(), schemaProcessor.getLastCache(node).getTimestamp());
}
}
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineBasicTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/SchemaBasicTest.java
similarity index 69%
rename from server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineBasicTest.java
rename to server/src/test/java/org/apache/iotdb/db/metadata/SchemaBasicTest.java
index 38e2e37..f868424 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineBasicTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/SchemaBasicTest.java
@@ -78,7 +78,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-public class SchemaEngineBasicTest {
+public class SchemaBasicTest {
private CompressionType compressionType;
@@ -95,30 +95,30 @@ public class SchemaEngineBasicTest {
@Test
public void testAddPathAndExist() throws IllegalPathException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- assertTrue(schemaEngine.isPathExist(new PartialPath("root")));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop")));
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop.d1"));
- schemaEngine.setStorageGroup(new PartialPath("root.1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop.d1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.1"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.1")));
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
} catch (MetadataException e) {
Assert.assertEquals(
"some children of root.laptop have already been set to storage group", e.getMessage());
}
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
@@ -128,67 +128,67 @@ public class SchemaEngineBasicTest {
e.printStackTrace();
fail(e.getMessage());
}
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.s0")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.s1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.s0")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.s1")));
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.1_2"),
TSDataType.INT32,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.\"1.2.3\""),
TSDataType.INT32,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.1.2.3"),
TSDataType.INT32,
TSEncoding.RLE,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.s1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.1_2")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.\"1.2.3\"")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.1.2")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.1.2.3")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.s1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.1_2")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.\"1.2.3\"")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.1.2")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.1.2.3")));
} catch (MetadataException e1) {
e1.printStackTrace();
fail(e1.getMessage());
}
try {
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.s1"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.s1"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.s1")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.s1")));
try {
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.s0"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.s0"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.s0")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.s0")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root")));
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
@@ -200,7 +200,7 @@ public class SchemaEngineBasicTest {
}
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
@@ -211,24 +211,24 @@ public class SchemaEngineBasicTest {
fail(e1.getMessage());
}
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d2")));
- assertFalse(schemaEngine.checkStorageGroupByPath(new PartialPath("root.laptop.d2")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d2")));
+ assertFalse(schemaProcessor.checkStorageGroupByPath(new PartialPath("root.laptop.d2")));
try {
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.s0"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.s0"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
try {
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.s1"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.s1"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop1"));
} catch (MetadataException e) {
Assert.assertEquals(
String.format(
@@ -238,32 +238,32 @@ public class SchemaEngineBasicTest {
}
try {
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.1_2"));
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.\"1.2.3\""));
- schemaEngine.deleteTimeseries(new PartialPath("root.1.2.3"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.1_2"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.\"1.2.3\""));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.1.2.3"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.1_2")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.\"1.2.3\"")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.1.2.3")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.1.2")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.1")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.1_2")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.\"1.2.3\"")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.1.2.3")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.1.2")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.1")));
try {
- schemaEngine.deleteStorageGroups(Collections.singletonList(new PartialPath("root.1")));
+ schemaProcessor.deleteStorageGroups(Collections.singletonList(new PartialPath("root.1")));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.1")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.1")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.template")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.template.d1")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.template")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.template.d1")));
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.template.d2"),
TSDataType.INT32,
TSEncoding.RLE,
@@ -275,31 +275,31 @@ public class SchemaEngineBasicTest {
}
try {
- schemaEngine.createSchemaTemplate(getCreateTemplatePlan());
- schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.template"));
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.createSchemaTemplate(getCreateTemplatePlan());
+ schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.template"));
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.template.d1")));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.template.d1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.template.d1.s11")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.template.d2.s11")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.template.d1.vector")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.template.d1.vector.s0")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.template.d1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.template.d1.s11")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.template.d2.s11")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.template.d1.vector")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.template.d1.vector.s0")));
}
/**
* Test if the PathNotExistException can be correctly thrown when the path to be deleted does not
- * exist. See {@link SchemaEngine#deleteTimeseries(PartialPath)}.
+ * exist. See {@link LocalSchemaProcessor#deleteTimeseries(PartialPath)}.
*/
@Test
public void testDeleteNonExistentTimeseries() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.deleteTimeseries(new PartialPath("root.non.existent"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.non.existent"));
fail();
} catch (PathNotExistException e) {
assertEquals("Path [root.non.existent] does not exist", e.getMessage());
@@ -312,22 +312,22 @@ public class SchemaEngineBasicTest {
@SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning
@Test
public void testCreateAlignedTimeseries() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createAlignedTimeSeries(
+ schemaProcessor.createAlignedTimeSeries(
new PartialPath("root.laptop.d1.aligned_device"),
Arrays.asList("s1", "s2", "s3"),
Arrays.asList(
@@ -342,33 +342,33 @@ public class SchemaEngineBasicTest {
fail(e.getMessage());
}
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.s0")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s2")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s3")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.s0")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s2")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s3")));
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.aligned_device.*"));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.s0")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s1")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s2")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s3")));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.aligned_device.*"));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.s0")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s1")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s2")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s3")));
try {
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.s0"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.s0"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.s0")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.s0")));
try {
- schemaEngine.createAlignedTimeSeries(
+ schemaProcessor.createAlignedTimeSeries(
new PartialPath("root.laptop.d1.aligned_device"),
Arrays.asList("s0", "s2", "s4"),
Arrays.asList(
@@ -383,70 +383,70 @@ public class SchemaEngineBasicTest {
fail(e.getMessage());
}
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s0")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s2")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s4")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s0")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s2")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s4")));
}
@Test
@SuppressWarnings("squid:S5783")
public void testGetAllTimeseriesCount() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d0"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s2.t1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s3"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s2"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.**")), 6);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.**")), 6);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.*")), 1);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.*.*")), 4);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.*.**")), 5);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.*.*.t1")), 1);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.*.s1")), 2);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.d1.**")), 3);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.d1.*")), 2);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.d2.s1")), 1);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.d2.**")), 2);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop")), 0);
- assertEquals(schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.d3.s1")), 0);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.**")), 6);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.**")), 6);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.*")), 1);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.*.*")), 4);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.*.**")), 5);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.*.*.t1")), 1);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.*.s1")), 2);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.d1.**")), 3);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.d1.*")), 2);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.d2.s1")), 1);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.d2.**")), 2);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop")), 0);
+ assertEquals(schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.d3.s1")), 0);
} catch (MetadataException e) {
e.printStackTrace();
@@ -457,23 +457,23 @@ public class SchemaEngineBasicTest {
@Test
public void testSetStorageGroupAndExist() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root1.laptop.d2")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root1.laptop.d2")));
- schemaEngine.setStorageGroup(new PartialPath("root.laptop.d1"));
- assertTrue(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d1")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d2")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d1.s1")));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop.d1"));
+ assertTrue(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d1")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d2")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d1.s1")));
- schemaEngine.setStorageGroup(new PartialPath("root.laptop.d2"));
- assertTrue(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d1")));
- assertTrue(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d2")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d3")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop")));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop.d2"));
+ assertTrue(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d1")));
+ assertTrue(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d2")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d3")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop")));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
@@ -483,28 +483,28 @@ public class SchemaEngineBasicTest {
@Test
public void testRecover() throws Exception {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop.d1"));
- schemaEngine.setStorageGroup(new PartialPath("root.laptop.d2"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop.d1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop.d2"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- assertTrue(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d1")));
- assertTrue(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d2")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d3")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop")));
+ assertTrue(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d1")));
+ assertTrue(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d2")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d3")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop")));
Set<String> devices =
new TreeSet<String>() {
{
@@ -515,34 +515,34 @@ public class SchemaEngineBasicTest {
// prefix with *
assertEquals(
devices,
- schemaEngine.getMatchedDevices(new PartialPath("root.**"), false).stream()
+ schemaProcessor.getMatchedDevices(new PartialPath("root.**"), false).stream()
.map(PartialPath::getFullPath)
.collect(Collectors.toSet()));
- schemaEngine.deleteStorageGroups(
+ schemaProcessor.deleteStorageGroups(
Collections.singletonList(new PartialPath("root.laptop.d2")));
- assertTrue(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d1")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d2")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d3")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop")));
+ assertTrue(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d1")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d2")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d3")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop")));
devices.remove("root.laptop.d2");
// prefix with *
assertEquals(
devices,
- schemaEngine.getMatchedDevices(new PartialPath("root.**"), false).stream()
+ schemaProcessor.getMatchedDevices(new PartialPath("root.**"), false).stream()
.map(PartialPath::getFullPath)
.collect(Collectors.toSet()));
EnvironmentUtils.restartDaemon();
- assertTrue(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d1")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d2")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop.d3")));
- assertFalse(schemaEngine.isStorageGroup(new PartialPath("root.laptop")));
+ assertTrue(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d1")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d2")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop.d3")));
+ assertFalse(schemaProcessor.isStorageGroup(new PartialPath("root.laptop")));
// prefix with *
assertEquals(
devices,
- schemaEngine.getMatchedDevices(new PartialPath("root.**"), false).stream()
+ schemaProcessor.getMatchedDevices(new PartialPath("root.**"), false).stream()
.map(PartialPath::getFullPath)
.collect(Collectors.toSet()));
@@ -555,17 +555,17 @@ public class SchemaEngineBasicTest {
@Test
public void testGetAllFileNamesByPath() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop.d1"));
- schemaEngine.setStorageGroup(new PartialPath("root.laptop.d2"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop.d1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop.d2"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
@@ -576,12 +576,14 @@ public class SchemaEngineBasicTest {
list.add(new PartialPath("root.laptop.d1"));
assertEquals(
- list, schemaEngine.getBelongedStorageGroups(new PartialPath("root.laptop.d1.s1")));
- assertEquals(list, schemaEngine.getBelongedStorageGroups(new PartialPath("root.laptop.d1")));
+ list, schemaProcessor.getBelongedStorageGroups(new PartialPath("root.laptop.d1.s1")));
+ assertEquals(
+ list, schemaProcessor.getBelongedStorageGroups(new PartialPath("root.laptop.d1")));
list.add(new PartialPath("root.laptop.d2"));
- assertEquals(list, schemaEngine.getBelongedStorageGroups(new PartialPath("root.laptop.**")));
- assertEquals(list, schemaEngine.getBelongedStorageGroups(new PartialPath("root.**")));
+ assertEquals(
+ list, schemaProcessor.getBelongedStorageGroups(new PartialPath("root.laptop.**")));
+ assertEquals(list, schemaProcessor.getBelongedStorageGroups(new PartialPath("root.**")));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
@@ -590,46 +592,57 @@ public class SchemaEngineBasicTest {
@Test
public void testCheckStorageExistOfPath() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- assertTrue(schemaEngine.getMeasurementPaths(new PartialPath("root")).isEmpty());
- assertTrue(schemaEngine.getBelongedStorageGroups(new PartialPath("root")).isEmpty());
- assertTrue(schemaEngine.getBelongedStorageGroups(new PartialPath("root.vehicle")).isEmpty());
+ assertTrue(schemaProcessor.getMeasurementPaths(new PartialPath("root")).isEmpty());
+ assertTrue(schemaProcessor.getBelongedStorageGroups(new PartialPath("root")).isEmpty());
+ assertTrue(
+ schemaProcessor.getBelongedStorageGroups(new PartialPath("root.vehicle")).isEmpty());
assertTrue(
- schemaEngine.getBelongedStorageGroups(new PartialPath("root.vehicle.device")).isEmpty());
+ schemaProcessor
+ .getBelongedStorageGroups(new PartialPath("root.vehicle.device"))
+ .isEmpty());
assertTrue(
- schemaEngine
+ schemaProcessor
.getBelongedStorageGroups(new PartialPath("root.vehicle.device.sensor"))
.isEmpty());
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
- assertFalse(schemaEngine.getBelongedStorageGroups(new PartialPath("root.vehicle")).isEmpty());
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
+ assertFalse(
+ schemaProcessor.getBelongedStorageGroups(new PartialPath("root.vehicle")).isEmpty());
assertFalse(
- schemaEngine.getBelongedStorageGroups(new PartialPath("root.vehicle.device")).isEmpty());
+ schemaProcessor
+ .getBelongedStorageGroups(new PartialPath("root.vehicle.device"))
+ .isEmpty());
assertFalse(
- schemaEngine
+ schemaProcessor
.getBelongedStorageGroups(new PartialPath("root.vehicle.device.sensor"))
.isEmpty());
- assertTrue(schemaEngine.getBelongedStorageGroups(new PartialPath("root.vehicle1")).isEmpty());
assertTrue(
- schemaEngine.getBelongedStorageGroups(new PartialPath("root.vehicle1.device")).isEmpty());
+ schemaProcessor.getBelongedStorageGroups(new PartialPath("root.vehicle1")).isEmpty());
+ assertTrue(
+ schemaProcessor
+ .getBelongedStorageGroups(new PartialPath("root.vehicle1.device"))
+ .isEmpty());
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle1.device"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle1.device"));
assertTrue(
- schemaEngine
+ schemaProcessor
.getBelongedStorageGroups(new PartialPath("root.vehicle1.device1"))
.isEmpty());
assertTrue(
- schemaEngine
+ schemaProcessor
.getBelongedStorageGroups(new PartialPath("root.vehicle1.device2"))
.isEmpty());
assertTrue(
- schemaEngine
+ schemaProcessor
.getBelongedStorageGroups(new PartialPath("root.vehicle1.device3"))
.isEmpty());
assertFalse(
- schemaEngine.getBelongedStorageGroups(new PartialPath("root.vehicle1.device")).isEmpty());
+ schemaProcessor
+ .getBelongedStorageGroups(new PartialPath("root.vehicle1.device"))
+ .isEmpty());
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
@@ -638,22 +651,22 @@ public class SchemaEngineBasicTest {
@Test
public void testShowChildNodesWithGivenPrefix() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s2"),
TSDataType.INT32,
TSEncoding.PLAIN,
@@ -663,11 +676,11 @@ public class SchemaEngineBasicTest {
Set<String> nodes2 = new HashSet<>(Arrays.asList("laptop"));
Set<String> nodes3 = new HashSet<>(Arrays.asList("d1", "d2"));
Set<String> nexLevelNodes1 =
- schemaEngine.getChildNodeNameInNextLevel(new PartialPath("root.laptop.d1"));
+ schemaProcessor.getChildNodeNameInNextLevel(new PartialPath("root.laptop.d1"));
Set<String> nexLevelNodes2 =
- schemaEngine.getChildNodeNameInNextLevel(new PartialPath("root"));
+ schemaProcessor.getChildNodeNameInNextLevel(new PartialPath("root"));
Set<String> nexLevelNodes3 =
- schemaEngine.getChildNodeNameInNextLevel(new PartialPath("root.laptop"));
+ schemaProcessor.getChildNodeNameInNextLevel(new PartialPath("root.laptop"));
// usual condition
assertEquals(nodes, nexLevelNodes1);
assertEquals(nodes2, nexLevelNodes2);
@@ -714,11 +727,11 @@ public class SchemaEngineBasicTest {
@Test
public void testSetStorageGroupWithIllegalName() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
PartialPath path1 = new PartialPath("root.laptop\n");
try {
- schemaEngine.setStorageGroup(path1);
+ schemaProcessor.setStorageGroup(path1);
fail();
} catch (MetadataException e) {
}
@@ -728,7 +741,7 @@ public class SchemaEngineBasicTest {
try {
PartialPath path2 = new PartialPath("root.laptop\t");
try {
- schemaEngine.setStorageGroup(path2);
+ schemaProcessor.setStorageGroup(path2);
fail();
} catch (MetadataException e) {
}
@@ -739,11 +752,11 @@ public class SchemaEngineBasicTest {
@Test
public void testCreateTimeseriesWithIllegalName() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
PartialPath path1 = new PartialPath("root.laptop.d1\n.s1");
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
path1, TSDataType.INT32, TSEncoding.PLAIN, CompressionType.SNAPPY, null);
fail();
} catch (MetadataException e) {
@@ -754,7 +767,7 @@ public class SchemaEngineBasicTest {
try {
PartialPath path2 = new PartialPath("root.laptop.d1\t.s1");
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
path2, TSDataType.INT32, TSEncoding.PLAIN, CompressionType.SNAPPY, null);
fail();
} catch (MetadataException e) {
@@ -766,17 +779,17 @@ public class SchemaEngineBasicTest {
@Test
public void testGetDevicesWithGivenPrefix() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
@@ -788,11 +801,11 @@ public class SchemaEngineBasicTest {
// usual condition
assertEquals(
devices,
- schemaEngine.getMatchedDevices(new PartialPath("root.laptop.**"), false).stream()
+ schemaProcessor.getMatchedDevices(new PartialPath("root.laptop.**"), false).stream()
.map(PartialPath::getFullPath)
.collect(Collectors.toSet()));
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
@@ -802,7 +815,7 @@ public class SchemaEngineBasicTest {
// prefix with *
assertEquals(
devices,
- schemaEngine.getMatchedDevices(new PartialPath("root.**"), false).stream()
+ schemaProcessor.getMatchedDevices(new PartialPath("root.**"), false).stream()
.map(PartialPath::getFullPath)
.collect(Collectors.toSet()));
} catch (MetadataException e) {
@@ -813,7 +826,7 @@ public class SchemaEngineBasicTest {
@Test
public void testGetChildNodePathInNextLevel() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
String[] res =
new String[] {
"[root.laptop, root.vehicle]",
@@ -828,64 +841,64 @@ public class SchemaEngineBasicTest {
};
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.b1.d1.s0"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.b1.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.b1.d2.s0"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.b2.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.b2.d1.s3"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.b2.d2.s2"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.b1.d0.s0"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.b1.d2.s2"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.b1.d3.s3"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.b2.d0.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
@@ -893,30 +906,33 @@ public class SchemaEngineBasicTest {
null);
assertEquals(
- res[0], schemaEngine.getChildNodePathInNextLevel(new PartialPath("root")).toString());
+ res[0], schemaProcessor.getChildNodePathInNextLevel(new PartialPath("root")).toString());
assertEquals(
res[1],
- schemaEngine.getChildNodePathInNextLevel(new PartialPath("root.laptop")).toString());
+ schemaProcessor.getChildNodePathInNextLevel(new PartialPath("root.laptop")).toString());
assertEquals(
res[2],
- schemaEngine.getChildNodePathInNextLevel(new PartialPath("root.laptop.b1")).toString());
+ schemaProcessor
+ .getChildNodePathInNextLevel(new PartialPath("root.laptop.b1"))
+ .toString());
assertEquals(
- res[3], schemaEngine.getChildNodePathInNextLevel(new PartialPath("root.*")).toString());
+ res[3],
+ schemaProcessor.getChildNodePathInNextLevel(new PartialPath("root.*")).toString());
assertEquals(
res[4],
- schemaEngine.getChildNodePathInNextLevel(new PartialPath("root.*.b1")).toString());
+ schemaProcessor.getChildNodePathInNextLevel(new PartialPath("root.*.b1")).toString());
assertEquals(
res[5],
- schemaEngine.getChildNodePathInNextLevel(new PartialPath("root.l*.b1")).toString());
+ schemaProcessor.getChildNodePathInNextLevel(new PartialPath("root.l*.b1")).toString());
assertEquals(
res[6],
- schemaEngine.getChildNodePathInNextLevel(new PartialPath("root.v*.*")).toString());
+ schemaProcessor.getChildNodePathInNextLevel(new PartialPath("root.v*.*")).toString());
assertEquals(
res[7],
- schemaEngine.getChildNodePathInNextLevel(new PartialPath("root.l*.b*.*")).toString());
+ schemaProcessor.getChildNodePathInNextLevel(new PartialPath("root.l*.b*.*")).toString());
assertEquals(
res[8],
- schemaEngine.getChildNodePathInNextLevel(new PartialPath("root.laptopp")).toString());
+ schemaProcessor.getChildNodePathInNextLevel(new PartialPath("root.laptopp")).toString());
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
@@ -927,16 +943,17 @@ public class SchemaEngineBasicTest {
public void testTemplate() throws MetadataException {
CreateTemplatePlan plan = getCreateTemplatePlan();
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.createSchemaTemplate(plan);
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.createSchemaTemplate(plan);
// set device template
SetTemplatePlan setTemplatePlan = new SetTemplatePlan("template1", "root.sg1.d1");
- schemaEngine.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
- schemaEngine.setUsingSchemaTemplate(new ActivateTemplatePlan(new PartialPath("root.sg1.d1")));
- IMNode node = schemaEngine.getDeviceNode(new PartialPath("root.sg1.d1"));
+ schemaProcessor.setUsingSchemaTemplate(
+ new ActivateTemplatePlan(new PartialPath("root.sg1.d1")));
+ IMNode node = schemaProcessor.getDeviceNode(new PartialPath("root.sg1.d1"));
MeasurementSchema s11 =
new MeasurementSchema("s11", TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);
@@ -948,23 +965,25 @@ public class SchemaEngineBasicTest {
"root.sg1.d1.vector" + TsFileConstant.PATH_SEPARATOR + schema.getMeasurementId());
}
for (MeasurementPath measurementPath :
- schemaEngine.getMeasurementPaths(new PartialPath("root.sg1.**"))) {
+ schemaProcessor.getMeasurementPaths(new PartialPath("root.sg1.**"))) {
allSchema.remove(measurementPath.toString());
}
allSchema.remove("root.sg1.d1.vector.s11");
assertTrue(allSchema.isEmpty());
- IMeasurementMNode mNode = schemaEngine.getMeasurementMNode(new PartialPath("root.sg1.d1.s11"));
+ IMeasurementMNode mNode =
+ schemaProcessor.getMeasurementMNode(new PartialPath("root.sg1.d1.s11"));
IMeasurementMNode mNode2 =
- schemaEngine.getMeasurementMNode(new PartialPath("root.sg1.d1.vector.s2"));
+ schemaProcessor.getMeasurementMNode(new PartialPath("root.sg1.d1.vector.s2"));
assertNotNull(mNode);
assertEquals(mNode.getSchema(), s11);
assertNotNull(mNode2);
assertEquals(
- mNode2.getSchema(), schemaEngine.getTemplate("template1").getSchemaMap().get("vector.s2"));
+ mNode2.getSchema(),
+ schemaProcessor.getTemplate("template1").getSchemaMap().get("vector.s2"));
try {
- schemaEngine.getMeasurementMNode(new PartialPath("root.sg1.d1.s100"));
+ schemaProcessor.getMeasurementMNode(new PartialPath("root.sg1.d1.s100"));
fail();
} catch (PathNotExistException e) {
assertEquals("Path [root.sg1.d1.s100] does not exist", e.getMessage());
@@ -998,7 +1017,7 @@ public class SchemaEngineBasicTest {
plan =
new CreateTemplatePlan(
"treeTemplate", measurementList, dataTypeList, encodingList, compressionTypes);
- IoTDB.schemaEngine.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
} catch (MetadataException e) {
assertEquals("encoding RLE does not support TEXT", e.getMessage());
}
@@ -1008,8 +1027,8 @@ public class SchemaEngineBasicTest {
new CreateTemplatePlan(
"treeTemplate", measurementList, dataTypeList, encodingList, compressionTypes);
- IoTDB.schemaEngine.createSchemaTemplate(planb);
- Template template = IoTDB.schemaEngine.getTemplate("treeTemplate");
+ IoTDB.schemaProcessor.createSchemaTemplate(planb);
+ Template template = IoTDB.schemaProcessor.getTemplate("treeTemplate");
assertEquals("[d1.s1, GPS.x, GPS.y, s2]", template.getAllMeasurementsPaths().toString());
List<String> appendMeasurements = Arrays.asList("a1", "a2");
@@ -1026,7 +1045,7 @@ public class SchemaEngineBasicTest {
appendEncodings,
appendCompressor);
try {
- IoTDB.schemaEngine.appendSchemaTemplate(plana);
+ IoTDB.schemaProcessor.appendSchemaTemplate(plana);
} catch (MetadataException e) {
assertEquals("encoding RLE does not support TEXT", e.getMessage());
}
@@ -1040,7 +1059,7 @@ public class SchemaEngineBasicTest {
appendDataTypes,
appendEncodings,
appendCompressor);
- IoTDB.schemaEngine.appendSchemaTemplate(planab);
+ IoTDB.schemaProcessor.appendSchemaTemplate(planab);
assertEquals(
"[a1, a2, d1.s1, GPS.x, GPS.y, s2]", template.getAllMeasurementsPaths().toString());
}
@@ -1049,11 +1068,11 @@ public class SchemaEngineBasicTest {
public void testTemplateInnerTree() {
CreateTemplatePlan plan = getTreeTemplatePlan();
Template template;
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.createSchemaTemplate(plan);
- template = schemaEngine.getTemplate("treeTemplate");
+ schemaProcessor.createSchemaTemplate(plan);
+ template = schemaProcessor.getTemplate("treeTemplate");
assertEquals(4, template.getMeasurementsCount());
assertEquals("d1", template.getPathNodeInTemplate("d1").getName());
assertNull(template.getPathNodeInTemplate("notExists"));
@@ -1209,27 +1228,27 @@ public class SchemaEngineBasicTest {
compressionTypes);
SetTemplatePlan setTemplatePlan = new SetTemplatePlan("template1", "root.sg.1");
UnsetTemplatePlan unsetTemplatePlan = new UnsetTemplatePlan("root.sg.1", "template1");
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.createSchemaTemplate(createTemplatePlan);
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.createSchemaTemplate(createTemplatePlan);
// path does not exist test
try {
- schemaEngine.unsetSchemaTemplate(unsetTemplatePlan);
+ schemaProcessor.unsetSchemaTemplate(unsetTemplatePlan);
fail("No exception thrown.");
} catch (Exception e) {
assertEquals("Path [root.sg.1] does not exist", e.getMessage());
}
- schemaEngine.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
// template unset test
- schemaEngine.unsetSchemaTemplate(unsetTemplatePlan);
- schemaEngine.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.unsetSchemaTemplate(unsetTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
// no template on path test
- schemaEngine.unsetSchemaTemplate(unsetTemplatePlan);
+ schemaProcessor.unsetSchemaTemplate(unsetTemplatePlan);
try {
- schemaEngine.unsetSchemaTemplate(unsetTemplatePlan);
+ schemaProcessor.unsetSchemaTemplate(unsetTemplatePlan);
fail("No exception thrown.");
} catch (Exception e) {
assertEquals("NO template on root.sg.1", e.getMessage());
@@ -1239,15 +1258,15 @@ public class SchemaEngineBasicTest {
@Test
public void testTemplateAndTimeSeriesCompatibility() throws MetadataException {
CreateTemplatePlan plan = getCreateTemplatePlan();
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.createSchemaTemplate(plan);
- schemaEngine.createSchemaTemplate(getTreeTemplatePlan());
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.createSchemaTemplate(plan);
+ schemaProcessor.createSchemaTemplate(getTreeTemplatePlan());
// set device template
SetTemplatePlan setTemplatePlan = new SetTemplatePlan("template1", "root.sg1.d1");
- schemaEngine.setSchemaTemplate(setTemplatePlan);
- schemaEngine.setSchemaTemplate(new SetTemplatePlan("treeTemplate", "root.tree.sg0"));
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setSchemaTemplate(new SetTemplatePlan("treeTemplate", "root.tree.sg0"));
CreateTimeSeriesPlan createTimeSeriesPlan =
new CreateTimeSeriesPlan(
@@ -1260,7 +1279,7 @@ public class SchemaEngineBasicTest {
null,
null);
- schemaEngine.createTimeseries(createTimeSeriesPlan);
+ schemaProcessor.createTimeseries(createTimeSeriesPlan);
CreateTimeSeriesPlan createTimeSeriesPlan2 =
new CreateTimeSeriesPlan(
@@ -1274,7 +1293,7 @@ public class SchemaEngineBasicTest {
null);
try {
- schemaEngine.createTimeseries(createTimeSeriesPlan2);
+ schemaProcessor.createTimeseries(createTimeSeriesPlan2);
fail();
} catch (Exception e) {
assertEquals("Path [root.sg1.d1.s11] already exists in [template1]", e.getMessage());
@@ -1292,7 +1311,7 @@ public class SchemaEngineBasicTest {
null);
try {
- schemaEngine.createTimeseries(createTimeSeriesPlan3);
+ schemaProcessor.createTimeseries(createTimeSeriesPlan3);
fail();
} catch (Exception e) {
assertEquals(
@@ -1310,15 +1329,15 @@ public class SchemaEngineBasicTest {
null,
null);
- schemaEngine.createTimeseries(createTimeSeriesPlan4);
+ schemaProcessor.createTimeseries(createTimeSeriesPlan4);
}
@Test
public void testTemplateAndNodePathCompatibility() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
CreateTemplatePlan plan = getCreateTemplatePlan();
- schemaEngine.createSchemaTemplate(plan);
- schemaEngine.createSchemaTemplate(getTreeTemplatePlan());
+ schemaProcessor.createSchemaTemplate(plan);
+ schemaProcessor.createSchemaTemplate(getTreeTemplatePlan());
// set device template
SetTemplatePlan setTemplatePlan = new SetTemplatePlan("template1", "root.sg1.d1");
@@ -1336,9 +1355,9 @@ public class SchemaEngineBasicTest {
null,
null);
- schemaEngine.createTimeseries(createTimeSeriesPlan);
+ schemaProcessor.createTimeseries(createTimeSeriesPlan);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new CreateTimeSeriesPlan(
new PartialPath("root.tree.sg0.s1"),
TSDataType.INT32,
@@ -1349,7 +1368,7 @@ public class SchemaEngineBasicTest {
null,
null));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new CreateTimeSeriesPlan(
new PartialPath("root.tree.sg1.dn.sn"),
TSDataType.INT32,
@@ -1360,7 +1379,7 @@ public class SchemaEngineBasicTest {
null,
null));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new CreateTimeSeriesPlan(
new PartialPath("root.tree.sg2.dn.sn"),
TSDataType.INT32,
@@ -1371,7 +1390,7 @@ public class SchemaEngineBasicTest {
null,
null));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new CreateTimeSeriesPlan(
new PartialPath("root.tree.sg3.dn.sn"),
TSDataType.INT32,
@@ -1394,12 +1413,12 @@ public class SchemaEngineBasicTest {
SetTemplatePlan planEx1 = new SetTemplatePlan("treeTemplate", "root.tree.sg1");
SetTemplatePlan planEx2 = new SetTemplatePlan("treeTemplate", "root.tree.sg2");
SetTemplatePlan planEx3 = new SetTemplatePlan("treeTemplate", "root.tree.sg3");
- schemaEngine.setSchemaTemplate(planEx1);
- schemaEngine.setSchemaTemplate(planEx2);
- schemaEngine.setSchemaTemplate(planEx3);
+ schemaProcessor.setSchemaTemplate(planEx1);
+ schemaProcessor.setSchemaTemplate(planEx2);
+ schemaProcessor.setSchemaTemplate(planEx3);
try {
- schemaEngine.unsetSchemaTemplate(new UnsetTemplatePlan("root.tree.*", "treeTemplate"));
+ schemaProcessor.unsetSchemaTemplate(new UnsetTemplatePlan("root.tree.*", "treeTemplate"));
fail();
} catch (IllegalPathException e) {
assertEquals(
@@ -1407,10 +1426,10 @@ public class SchemaEngineBasicTest {
e.getMessage());
}
- schemaEngine.setSchemaTemplate(setSchemaTemplatePlan2);
- schemaEngine.unsetSchemaTemplate(new UnsetTemplatePlan("root.tree.sg0", "treeTemplate"));
+ schemaProcessor.setSchemaTemplate(setSchemaTemplatePlan2);
+ schemaProcessor.unsetSchemaTemplate(new UnsetTemplatePlan("root.tree.sg0", "treeTemplate"));
try {
- schemaEngine.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
fail();
} catch (MetadataException e) {
assertEquals(
@@ -1418,7 +1437,7 @@ public class SchemaEngineBasicTest {
e.getMessage());
}
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new CreateTimeSeriesPlan(
new PartialPath("root.tree.sg0.GPS.speed"),
TSDataType.INT32,
@@ -1430,7 +1449,7 @@ public class SchemaEngineBasicTest {
null));
try {
- schemaEngine.setSchemaTemplate(setSchemaTemplatePlan2);
+ schemaProcessor.setSchemaTemplate(setSchemaTemplatePlan2);
fail();
} catch (MetadataException e) {
assertEquals(
@@ -1438,7 +1457,7 @@ public class SchemaEngineBasicTest {
e.getMessage());
}
- schemaEngine.deleteTimeseries(new PartialPath("root.sg1.d1.s11"));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.sg1.d1.s11"));
}
@Test
@@ -1516,38 +1535,38 @@ public class SchemaEngineBasicTest {
SetTemplatePlan setPlan5 = new SetTemplatePlan("template2", "root.sg1.d1");
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
- schemaEngine.createSchemaTemplate(plan1);
- schemaEngine.createSchemaTemplate(plan2);
+ schemaProcessor.createSchemaTemplate(plan1);
+ schemaProcessor.createSchemaTemplate(plan2);
- schemaEngine.setStorageGroup(new PartialPath("root.sg1"));
- schemaEngine.setStorageGroup(new PartialPath("root.sg2"));
- schemaEngine.setStorageGroup(new PartialPath("root.sg3"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg2"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg3"));
try {
- schemaEngine.setSchemaTemplate(setPlan1);
- schemaEngine.setSchemaTemplate(setPlan2);
+ schemaProcessor.setSchemaTemplate(setPlan1);
+ schemaProcessor.setSchemaTemplate(setPlan2);
} catch (MetadataException e) {
fail();
}
try {
- schemaEngine.setSchemaTemplate(setPlan3);
+ schemaProcessor.setSchemaTemplate(setPlan3);
fail();
} catch (MetadataException e) {
assertEquals("Template already exists on root.sg1", e.getMessage());
}
try {
- schemaEngine.setSchemaTemplate(setPlan4);
+ schemaProcessor.setSchemaTemplate(setPlan4);
fail();
} catch (MetadataException e) {
assertEquals("Template already exists on root.sg2.d1", e.getMessage());
}
try {
- schemaEngine.setSchemaTemplate(setPlan5);
+ schemaProcessor.setSchemaTemplate(setPlan5);
fail();
} catch (MetadataException e) {
assertEquals("Template already exists on root.sg1", e.getMessage());
@@ -1556,9 +1575,9 @@ public class SchemaEngineBasicTest {
@Test
public void testShowTimeseries() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
@@ -1570,7 +1589,7 @@ public class SchemaEngineBasicTest {
new ShowTimeSeriesPlan(
new PartialPath("root.laptop.d1.s0"), false, null, null, 0, 0, false);
List<ShowTimeSeriesResult> result =
- schemaEngine.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
assertEquals(1, result.size());
assertEquals("root.laptop.d1.s0", result.get(0).getName());
} catch (MetadataException e) {
@@ -1626,20 +1645,20 @@ public class SchemaEngineBasicTest {
encodingList,
compressionTypes);
CreateTemplatePlan treePlan = getTreeTemplatePlan();
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.createSchemaTemplate(plan);
- schemaEngine.createSchemaTemplate(treePlan);
+ schemaProcessor.createSchemaTemplate(plan);
+ schemaProcessor.createSchemaTemplate(treePlan);
// set device template
SetTemplatePlan setSchemaTemplatePlan = new SetTemplatePlan("template1", "root.laptop.d1");
SetTemplatePlan setSchemaTemplatePlan1 = new SetTemplatePlan("treeTemplate", "root.tree.d0");
- schemaEngine.setSchemaTemplate(setSchemaTemplatePlan);
- schemaEngine.setSchemaTemplate(setSchemaTemplatePlan1);
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setSchemaTemplate(setSchemaTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setSchemaTemplatePlan1);
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.laptop.d1")));
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.tree.d0")));
// show timeseries root.tree.d0
@@ -1647,7 +1666,7 @@ public class SchemaEngineBasicTest {
new ShowTimeSeriesPlan(
new PartialPath("root.tree.d0.**"), false, null, null, 0, 0, false);
List<ShowTimeSeriesResult> treeShowResult =
- schemaEngine.showTimeseries(showTreeTSPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
+ schemaProcessor.showTimeseries(showTreeTSPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
assertEquals(4, treeShowResult.size());
Set<String> checkSet = new HashSet<>();
checkSet.add("root.tree.d0.d1.s1");
@@ -1664,7 +1683,7 @@ public class SchemaEngineBasicTest {
new ShowTimeSeriesPlan(
new PartialPath("root.laptop.d1.s0"), false, null, null, 0, 0, false);
List<ShowTimeSeriesResult> result =
- schemaEngine.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
assertEquals(1, result.size());
assertEquals("root.laptop.d1.s0", result.get(0).getName());
@@ -1672,7 +1691,8 @@ public class SchemaEngineBasicTest {
showTimeSeriesPlan =
new ShowTimeSeriesPlan(
new PartialPath("root.laptop.d1.vector.s1"), false, null, null, 0, 0, false);
- result = schemaEngine.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
+ result =
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
assertEquals(1, result.size());
assertEquals("root.laptop.d1.vector.s1", result.get(0).getName());
@@ -1680,7 +1700,8 @@ public class SchemaEngineBasicTest {
// show timeseries root.laptop.d1.(s1,s2,s3)
showTimeSeriesPlan =
new ShowTimeSeriesPlan(new PartialPath("root.laptop.**"), false, null, null, 0, 0, false);
- result = schemaEngine.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
+ result =
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
assertEquals(4, result.size());
Set<String> set = new HashSet<>();
for (int i = 1; i < result.size(); i++) {
@@ -1703,7 +1724,7 @@ public class SchemaEngineBasicTest {
ShowTimeSeriesPlan showTimeSeriesPlan =
new ShowTimeSeriesPlan(
new PartialPath("root.laptop.d1.(s0,s1)"), false, null, null, 0, 0, false);
- schemaEngine.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
} catch (MetadataException e) {
assertEquals(
"Cannot get node of children in different aligned timeseries (Path: (s0,s1))",
@@ -1713,19 +1734,20 @@ public class SchemaEngineBasicTest {
@Test
public void minimumTestForWildcardInTemplate() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
CreateTemplatePlan treePlan = getTreeTemplatePlan();
- schemaEngine.createSchemaTemplate(treePlan);
+ schemaProcessor.createSchemaTemplate(treePlan);
// set device template
SetTemplatePlan setSchemaTemplatePlan1 = new SetTemplatePlan("treeTemplate", "root.tree.d0");
- schemaEngine.setSchemaTemplate(setSchemaTemplatePlan1);
- schemaEngine.setUsingSchemaTemplate(new ActivateTemplatePlan(new PartialPath("root.tree.d0")));
+ schemaProcessor.setSchemaTemplate(setSchemaTemplatePlan1);
+ schemaProcessor.setUsingSchemaTemplate(
+ new ActivateTemplatePlan(new PartialPath("root.tree.d0")));
ShowTimeSeriesPlan showTimeSeriesPlan =
new ShowTimeSeriesPlan(new PartialPath("root.tree.**.s1"), false, null, null, 0, 0, false);
List<ShowTimeSeriesResult> result =
- schemaEngine.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, EnvironmentUtils.TEST_QUERY_CONTEXT);
assertEquals(1, result.size());
}
@@ -1760,19 +1782,19 @@ public class SchemaEngineBasicTest {
dataTypeList,
encodingList,
compressionTypes);
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.createSchemaTemplate(plan);
- schemaEngine.createSchemaTemplate(getTreeTemplatePlan());
+ schemaProcessor.createSchemaTemplate(plan);
+ schemaProcessor.createSchemaTemplate(getTreeTemplatePlan());
// set device template
SetTemplatePlan setSchemaTemplatePlan = new SetTemplatePlan("template1", "root.laptop.d1");
- schemaEngine.setSchemaTemplate(setSchemaTemplatePlan);
- schemaEngine.setSchemaTemplate(new SetTemplatePlan("treeTemplate", "root.tree.d0"));
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setSchemaTemplate(setSchemaTemplatePlan);
+ schemaProcessor.setSchemaTemplate(new SetTemplatePlan("treeTemplate", "root.tree.d0"));
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.laptop.d1")));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.computer.d1.s2"),
TSDataType.INT32,
TSEncoding.PLAIN,
@@ -1780,30 +1802,31 @@ public class SchemaEngineBasicTest {
null);
SetTemplatePlan setTemplatePlan = new SetTemplatePlan("template1", "root.computer");
- schemaEngine.setSchemaTemplate(setTemplatePlan);
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.computer.d1")));
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.tree.d0")));
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.tree.d0.v0")));
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.tree.d0.v1")));
Assert.assertEquals(
- 2, schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.d1.**")));
+ 2, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.d1.**")));
Assert.assertEquals(
- 1, schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.d1.s1")));
+ 1, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.d1.s1")));
Assert.assertEquals(
- 1, schemaEngine.getAllTimeseriesCount(new PartialPath("root.computer.d1.s1")));
+ 1, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.computer.d1.s1")));
Assert.assertEquals(
- 1, schemaEngine.getAllTimeseriesCount(new PartialPath("root.computer.d1.s2")));
+ 1, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.computer.d1.s2")));
Assert.assertEquals(
- 3, schemaEngine.getAllTimeseriesCount(new PartialPath("root.computer.d1.**")));
+ 3, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.computer.d1.**")));
Assert.assertEquals(
- 3, schemaEngine.getAllTimeseriesCount(new PartialPath("root.computer.**")));
- Assert.assertEquals(12, schemaEngine.getAllTimeseriesCount(new PartialPath("root.tree.**")));
- Assert.assertEquals(17, schemaEngine.getAllTimeseriesCount(new PartialPath("root.**")));
+ 3, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.computer.**")));
+ Assert.assertEquals(
+ 12, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.tree.**")));
+ Assert.assertEquals(17, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.**")));
} catch (MetadataException e) {
e.printStackTrace();
@@ -1842,64 +1865,64 @@ public class SchemaEngineBasicTest {
dataTypeList,
encodingList,
compressionTypes);
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.createSchemaTemplate(plan);
- schemaEngine.createSchemaTemplate(getTreeTemplatePlan());
+ schemaProcessor.createSchemaTemplate(plan);
+ schemaProcessor.createSchemaTemplate(getTreeTemplatePlan());
// set device template
SetTemplatePlan setSchemaTemplatePlan = new SetTemplatePlan("template1", "root.laptop.d1");
- schemaEngine.setSchemaTemplate(setSchemaTemplatePlan);
- schemaEngine.setSchemaTemplate(new SetTemplatePlan("treeTemplate", "root.tree.d0"));
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setSchemaTemplate(setSchemaTemplatePlan);
+ schemaProcessor.setSchemaTemplate(new SetTemplatePlan("treeTemplate", "root.tree.d0"));
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.laptop.d1")));
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.tree.d0")));
try {
- schemaEngine.setUsingSchemaTemplate(
+ schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.non.existed.path")));
fail();
} catch (MetadataException e) {
assertEquals("Path [root.non.existed.path] has not been set any template.", e.getMessage());
}
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- Assert.assertEquals(1, schemaEngine.getDevicesNum(new PartialPath("root.laptop.d1")));
- Assert.assertEquals(1, schemaEngine.getDevicesNum(new PartialPath("root.laptop.d2")));
- Assert.assertEquals(2, schemaEngine.getDevicesNum(new PartialPath("root.laptop.*")));
- Assert.assertEquals(2, schemaEngine.getDevicesNum(new PartialPath("root.laptop.**")));
- Assert.assertEquals(3, schemaEngine.getDevicesNum(new PartialPath("root.tree.**")));
- Assert.assertEquals(5, schemaEngine.getDevicesNum(new PartialPath("root.**")));
+ Assert.assertEquals(1, schemaProcessor.getDevicesNum(new PartialPath("root.laptop.d1")));
+ Assert.assertEquals(1, schemaProcessor.getDevicesNum(new PartialPath("root.laptop.d2")));
+ Assert.assertEquals(2, schemaProcessor.getDevicesNum(new PartialPath("root.laptop.*")));
+ Assert.assertEquals(2, schemaProcessor.getDevicesNum(new PartialPath("root.laptop.**")));
+ Assert.assertEquals(3, schemaProcessor.getDevicesNum(new PartialPath("root.tree.**")));
+ Assert.assertEquals(5, schemaProcessor.getDevicesNum(new PartialPath("root.**")));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.a.s3"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.a.s3"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- Assert.assertEquals(4, schemaEngine.getDevicesNum(new PartialPath("root.laptop.**")));
+ Assert.assertEquals(4, schemaProcessor.getDevicesNum(new PartialPath("root.laptop.**")));
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d2.s1"));
- Assert.assertEquals(3, schemaEngine.getDevicesNum(new PartialPath("root.laptop.**")));
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d2.a.s3"));
- Assert.assertEquals(2, schemaEngine.getDevicesNum(new PartialPath("root.laptop.**")));
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d1.a.s3"));
- Assert.assertEquals(1, schemaEngine.getDevicesNum(new PartialPath("root.laptop.**")));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d2.s1"));
+ Assert.assertEquals(3, schemaProcessor.getDevicesNum(new PartialPath("root.laptop.**")));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d2.a.s3"));
+ Assert.assertEquals(2, schemaProcessor.getDevicesNum(new PartialPath("root.laptop.**")));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d1.a.s3"));
+ Assert.assertEquals(1, schemaProcessor.getDevicesNum(new PartialPath("root.laptop.**")));
} catch (MetadataException e) {
e.printStackTrace();
@@ -1909,54 +1932,55 @@ public class SchemaEngineBasicTest {
@Test
public void testTotalSeriesNumber() throws Exception {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d0"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s2.t1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s3"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s2"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- assertEquals(6, schemaEngine.getTotalSeriesNumber());
+ assertEquals(6, schemaProcessor.getTotalSeriesNumber());
EnvironmentUtils.restartDaemon();
- assertEquals(6, schemaEngine.getTotalSeriesNumber());
- schemaEngine.deleteTimeseries(new PartialPath("root.laptop.d2.s1"));
- assertEquals(5, schemaEngine.getTotalSeriesNumber());
- schemaEngine.deleteStorageGroups(Collections.singletonList(new PartialPath("root.laptop")));
- assertEquals(0, schemaEngine.getTotalSeriesNumber());
+ assertEquals(6, schemaProcessor.getTotalSeriesNumber());
+ schemaProcessor.deleteTimeseries(new PartialPath("root.laptop.d2.s1"));
+ assertEquals(5, schemaProcessor.getTotalSeriesNumber());
+ schemaProcessor.deleteStorageGroups(
+ Collections.singletonList(new PartialPath("root.laptop")));
+ assertEquals(0, schemaProcessor.getTotalSeriesNumber());
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
@@ -1965,27 +1989,27 @@ public class SchemaEngineBasicTest {
@Test
public void testStorageGroupNameWithHyphen() throws IllegalPathException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- assertTrue(schemaEngine.isPathExist(new PartialPath("root")));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.group-with-hyphen")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.group-with-hyphen")));
try {
- schemaEngine.setStorageGroup(new PartialPath("root.group-with-hyphen"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.group-with-hyphen"));
} catch (MetadataException e) {
e.printStackTrace();
fail(e.getMessage());
}
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.group-with-hyphen")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.group-with-hyphen")));
}
@Test
public void testCreateAlignedTimeseriesAndInsertWithMismatchDataType() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createAlignedTimeSeries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createAlignedTimeSeries(
new PartialPath("root.laptop.d1.aligned_device"),
Arrays.asList("s1", "s2", "s3"),
Arrays.asList(
@@ -2018,8 +2042,9 @@ public class SchemaEngineBasicTest {
new IMeasurementMNode[insertRowPlan.getMeasurements().length]);
// call getSeriesSchemasAndReadLockDevice
- IMNode node = schemaEngine.getSeriesSchemasAndReadLockDevice(insertRowPlan);
- assertEquals(3, schemaEngine.getAllTimeseriesCount(node.getPartialPath().concatNode("**")));
+ IMNode node = schemaProcessor.getSeriesSchemasAndReadLockDevice(insertRowPlan);
+ assertEquals(
+ 3, schemaProcessor.getAllTimeseriesCount(node.getPartialPath().concatNode("**")));
} catch (Exception e) {
e.printStackTrace();
@@ -2029,10 +2054,10 @@ public class SchemaEngineBasicTest {
@Test
public void testCreateAlignedTimeseriesAndInsertWithNotAlignedData() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createAlignedTimeSeries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createAlignedTimeSeries(
new PartialPath("root.laptop.d1.aligned_device"),
Arrays.asList("s1", "s2", "s3"),
Arrays.asList(
@@ -2047,7 +2072,7 @@ public class SchemaEngineBasicTest {
}
try {
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new CreateTimeSeriesPlan(
new PartialPath("root.laptop.d1.aligned_device.s4"),
TSDataType.valueOf("FLOAT"),
@@ -2087,7 +2112,7 @@ public class SchemaEngineBasicTest {
new IMeasurementMNode[insertRowPlan.getMeasurements().length]);
// call getSeriesSchemasAndReadLockDevice
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertRowPlan);
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertRowPlan);
fail();
} catch (Exception e) {
Assert.assertEquals(
@@ -2098,10 +2123,10 @@ public class SchemaEngineBasicTest {
@Test
public void testCreateTimeseriesAndInsertWithMismatchDataType() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
@@ -2122,8 +2147,9 @@ public class SchemaEngineBasicTest {
new IMeasurementMNode[insertRowPlan.getMeasurements().length]);
// call getSeriesSchemasAndReadLockDevice
- IMNode node = schemaEngine.getSeriesSchemasAndReadLockDevice(insertRowPlan);
- assertEquals(1, schemaEngine.getAllTimeseriesCount(node.getPartialPath().concatNode("**")));
+ IMNode node = schemaProcessor.getSeriesSchemasAndReadLockDevice(insertRowPlan);
+ assertEquals(
+ 1, schemaProcessor.getAllTimeseriesCount(node.getPartialPath().concatNode("**")));
assertNull(insertRowPlan.getMeasurementMNodes()[0]);
assertEquals(1, insertRowPlan.getFailedMeasurementNumber());
@@ -2135,16 +2161,16 @@ public class SchemaEngineBasicTest {
@Test
public void testCreateTimeseriesAndInsertWithAlignedData() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.aligned_device.s1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.aligned_device.s2"),
TSDataType.valueOf("INT64"),
TSEncoding.valueOf("RLE"),
@@ -2155,7 +2181,7 @@ public class SchemaEngineBasicTest {
}
try {
- schemaEngine.createAlignedTimeSeries(
+ schemaProcessor.createAlignedTimeSeries(
new PartialPath("root.laptop.d1.aligned_device"),
Arrays.asList("s3", "s4", "s5"),
Arrays.asList(
@@ -2193,7 +2219,7 @@ public class SchemaEngineBasicTest {
new IMeasurementMNode[insertRowPlan.getMeasurements().length]);
// call getSeriesSchemasAndReadLockDevice
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertRowPlan);
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertRowPlan);
fail();
} catch (Exception e) {
Assert.assertEquals(
@@ -2204,14 +2230,14 @@ public class SchemaEngineBasicTest {
@Test
public void testCreateAlignedTimeseriesWithIllegalNames() throws Exception {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
PartialPath deviceId = new PartialPath("root.laptop.d1");
String[] measurementIds = {"a.b", "time", "timestamp", "TIME", "TIMESTAMP"};
for (String measurementId : measurementIds) {
PartialPath path = deviceId.concatNode(measurementId);
try {
- schemaEngine.createAlignedTimeSeries(
+ schemaProcessor.createAlignedTimeSeries(
path,
Arrays.asList("s1", "s2", "s3"),
Arrays.asList(
@@ -2234,7 +2260,7 @@ public class SchemaEngineBasicTest {
PartialPath path = deviceId.concatNode("t1");
for (String measurementId : measurementIds) {
try {
- schemaEngine.createAlignedTimeSeries(
+ schemaProcessor.createAlignedTimeSeries(
path,
Arrays.asList(measurementId, "s2", "s3"),
Arrays.asList(
@@ -2253,8 +2279,8 @@ public class SchemaEngineBasicTest {
@Test
public void testCreateAlignedTimeseriesWithAliasAndTags() throws Exception {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
PartialPath devicePath = new PartialPath("root.laptop.device");
List<String> measurements = Arrays.asList("s1", "s2", "s3", "s4", "s5");
List<TSDataType> tsDataTypes =
@@ -2297,16 +2323,16 @@ public class SchemaEngineBasicTest {
aliasList,
tagList,
null);
- schemaEngine.createAlignedTimeSeries(createAlignedTimeSeriesPlan);
+ schemaProcessor.createAlignedTimeSeries(createAlignedTimeSeriesPlan);
Assert.assertEquals(
- 5, schemaEngine.getAllTimeseriesCount(new PartialPath("root.laptop.device.*")));
- Assert.assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.device.alias2")));
+ 5, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.laptop.device.*")));
+ Assert.assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.device.alias2")));
ShowTimeSeriesPlan showTimeSeriesPlan =
new ShowTimeSeriesPlan(new PartialPath("root.**"), false, "key", "value", 0, 0, false);
List<ShowTimeSeriesResult> showTimeSeriesResults =
- schemaEngine.showTimeseries(showTimeSeriesPlan, null);
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, null);
Assert.assertEquals(2, showTimeSeriesResults.size());
showTimeSeriesResults =
showTimeSeriesResults.stream()
@@ -2323,7 +2349,7 @@ public class SchemaEngineBasicTest {
@Test
public void testAutoCreateAlignedTimeseriesWhileInsert() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
long time = 1L;
@@ -2344,22 +2370,22 @@ public class SchemaEngineBasicTest {
insertRowPlan.setMeasurementMNodes(
new IMeasurementMNode[insertRowPlan.getMeasurements().length]);
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertRowPlan);
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertRowPlan);
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s1")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s2")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s1")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s2")));
insertRowPlan.setMeasurements(new String[] {"s3", "s4"});
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertRowPlan);
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s3")));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s4")));
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertRowPlan);
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s3")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s4")));
insertRowPlan.setMeasurements(new String[] {"s2", "s5"});
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertRowPlan);
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s5")));
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertRowPlan);
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.laptop.d1.aligned_device.s5")));
insertRowPlan.setMeasurements(new String[] {"s2", "s3"});
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertRowPlan);
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertRowPlan);
} catch (MetadataException | IOException e) {
fail();
@@ -2368,7 +2394,7 @@ public class SchemaEngineBasicTest {
@Test
public void testGetStorageGroupNodeByPath() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
PartialPath partialPath = null;
try {
@@ -2378,7 +2404,7 @@ public class SchemaEngineBasicTest {
}
try {
- schemaEngine.setStorageGroup(partialPath);
+ schemaProcessor.setStorageGroup(partialPath);
} catch (MetadataException e) {
fail(e.getMessage());
}
@@ -2390,7 +2416,7 @@ public class SchemaEngineBasicTest {
}
try {
- schemaEngine.getStorageGroupNodeByPath(partialPath);
+ schemaProcessor.getStorageGroupNodeByPath(partialPath);
} catch (StorageGroupNotSetException e) {
Assert.assertEquals(
"Storage group is not set for current seriesPath: [root.ln.sg2.device1.sensor1]",
@@ -2405,29 +2431,29 @@ public class SchemaEngineBasicTest {
@Test
public void testMeasurementIdWhileInsert() throws Exception {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
PartialPath deviceId = new PartialPath("root.sg.d");
InsertPlan insertPlan;
insertPlan = getInsertPlan("\"a+b\"");
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertPlan);
- assertTrue(schemaEngine.isPathExist(deviceId.concatNode("\"a+b\"")));
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertPlan);
+ assertTrue(schemaProcessor.isPathExist(deviceId.concatNode("\"a+b\"")));
insertPlan = getInsertPlan("\"a.b\"");
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertPlan);
- assertTrue(schemaEngine.isPathExist(deviceId.concatNode("\"a.b\"")));
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertPlan);
+ assertTrue(schemaProcessor.isPathExist(deviceId.concatNode("\"a.b\"")));
insertPlan = getInsertPlan("\"a“(Φ)”b\"");
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertPlan);
- assertTrue(schemaEngine.isPathExist(deviceId.concatNode("\"a“(Φ)”b\"")));
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertPlan);
+ assertTrue(schemaProcessor.isPathExist(deviceId.concatNode("\"a“(Φ)”b\"")));
String[] illegalMeasurementIds = {"a.b", "time", "timestamp", "TIME", "TIMESTAMP"};
for (String measurementId : illegalMeasurementIds) {
insertPlan = getInsertPlan(measurementId);
try {
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertPlan);
- assertFalse(schemaEngine.isPathExist(deviceId.concatNode(measurementId)));
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertPlan);
+ assertFalse(schemaProcessor.isPathExist(deviceId.concatNode(measurementId)));
} catch (MetadataException e) {
e.printStackTrace();
}
@@ -2447,12 +2473,12 @@ public class SchemaEngineBasicTest {
@Test
public void testTemplateSchemaNameCheckWhileCreate() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
String[] illegalSchemaNames = {"a+b", "time", "timestamp", "TIME", "TIMESTAMP"};
for (String schemaName : illegalSchemaNames) {
CreateTemplatePlan plan = getCreateTemplatePlan(schemaName);
try {
- schemaEngine.createSchemaTemplate(plan);
+ schemaProcessor.createSchemaTemplate(plan);
} catch (MetadataException e) {
Assert.assertEquals(String.format("%s is an illegal name.", schemaName), e.getMessage());
}
@@ -2481,10 +2507,10 @@ public class SchemaEngineBasicTest {
@Test
public void testDeviceNodeAfterAutoCreateTimeseriesFailure() throws Exception {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
PartialPath sg1 = new PartialPath("root.a.sg");
- schemaEngine.setStorageGroup(sg1);
+ schemaProcessor.setStorageGroup(sg1);
PartialPath deviceId = new PartialPath("root.a.d");
String[] measurementList = {"s"};
@@ -2495,51 +2521,51 @@ public class SchemaEngineBasicTest {
insertPlan.getDataTypes()[0] = TSDataType.INT32;
try {
- schemaEngine.getSeriesSchemasAndReadLockDevice(insertPlan);
+ schemaProcessor.getSeriesSchemasAndReadLockDevice(insertPlan);
fail();
} catch (MetadataException e) {
Assert.assertEquals(
"some children of root.a have already been set to storage group", e.getMessage());
- Assert.assertFalse(schemaEngine.isPathExist(new PartialPath("root.a.d")));
+ Assert.assertFalse(schemaProcessor.isPathExist(new PartialPath("root.a.d")));
}
}
@Test
public void testTimeseriesDeletionWithEntityUsingTemplate() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.setStorageGroup(new PartialPath("root.sg"));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg"));
CreateTemplatePlan plan = getCreateTemplatePlan("s1");
- schemaEngine.createSchemaTemplate(plan);
+ schemaProcessor.createSchemaTemplate(plan);
SetTemplatePlan setPlan = new SetTemplatePlan("template1", "root.sg.d1");
- schemaEngine.setSchemaTemplate(setPlan);
- schemaEngine.createTimeseries(
+ schemaProcessor.setSchemaTemplate(setPlan);
+ schemaProcessor.createTimeseries(
new PartialPath("root.sg.d1.s2"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.setUsingSchemaTemplate(new ActivateTemplatePlan(new PartialPath("root.sg.d1")));
- schemaEngine.deleteTimeseries(new PartialPath("root.sg.d1.s2"));
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.sg.d1")));
+ schemaProcessor.setUsingSchemaTemplate(new ActivateTemplatePlan(new PartialPath("root.sg.d1")));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.sg.d1.s2"));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.sg.d1")));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.sg.d2.s2"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.deleteTimeseries(new PartialPath("root.sg.d2.s2"));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.sg.d2")));
+ schemaProcessor.deleteTimeseries(new PartialPath("root.sg.d2.s2"));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.sg.d2")));
}
@Test
public void testTagIndexRecovery() throws Exception {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
PartialPath path = new PartialPath("root.sg.d.s");
Map<String, String> tags = new HashMap<>();
tags.put("description", "oldValue");
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new CreateTimeSeriesPlan(
path,
TSDataType.valueOf("INT32"),
@@ -2554,19 +2580,19 @@ public class SchemaEngineBasicTest {
new ShowTimeSeriesPlan(
new PartialPath("root.sg.d.s"), true, "description", "Value", 0, 0, false);
List<ShowTimeSeriesResult> results =
- schemaEngine.showTimeseries(showTimeSeriesPlan, new QueryContext());
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, new QueryContext());
assertEquals(1, results.size());
Map<String, String> resultTag = results.get(0).getTag();
assertEquals("oldValue", resultTag.get("description"));
tags.put("description", "newValue");
- schemaEngine.upsertTagsAndAttributes(null, tags, null, path);
+ schemaProcessor.upsertTagsAndAttributes(null, tags, null, path);
showTimeSeriesPlan =
new ShowTimeSeriesPlan(
new PartialPath("root.sg.d.s"), true, "description", "Value", 0, 0, false);
- results = schemaEngine.showTimeseries(showTimeSeriesPlan, new QueryContext());
+ results = schemaProcessor.showTimeseries(showTimeSeriesPlan, new QueryContext());
assertEquals(1, results.size());
resultTag = results.get(0).getTag();
@@ -2577,14 +2603,14 @@ public class SchemaEngineBasicTest {
showTimeSeriesPlan =
new ShowTimeSeriesPlan(
new PartialPath("root.sg.d.s"), true, "description", "oldValue", 0, 0, false);
- results = schemaEngine.showTimeseries(showTimeSeriesPlan, new QueryContext());
+ results = schemaProcessor.showTimeseries(showTimeSeriesPlan, new QueryContext());
assertEquals(0, results.size());
showTimeSeriesPlan =
new ShowTimeSeriesPlan(
new PartialPath("root.sg.d.s"), true, "description", "Value", 0, 0, false);
- results = schemaEngine.showTimeseries(showTimeSeriesPlan, new QueryContext());
+ results = schemaProcessor.showTimeseries(showTimeSeriesPlan, new QueryContext());
assertEquals(1, results.size());
resultTag = results.get(0).getTag();
@@ -2593,7 +2619,7 @@ public class SchemaEngineBasicTest {
@Test
public void testTagCreationViaMLogPlanDuringMetadataSync() throws Exception {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
PartialPath path = new PartialPath("root.sg.d.s");
Map<String, String> tags = new HashMap<>();
@@ -2611,16 +2637,16 @@ public class SchemaEngineBasicTest {
// mock that the plan has already been executed on sender and receiver will redo this plan
plan.setTagOffset(10);
- schemaEngine.operation(plan);
+ schemaProcessor.operation(plan);
ShowTimeSeriesPlan showTimeSeriesPlan =
new ShowTimeSeriesPlan(new PartialPath("root.sg.d.s"), true, "type", "test", 0, 0, false);
List<ShowTimeSeriesResult> results =
- schemaEngine.showTimeseries(showTimeSeriesPlan, new QueryContext());
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, new QueryContext());
assertEquals(1, results.size());
Map<String, String> resultTag = results.get(0).getTag();
assertEquals("test", resultTag.get("type"));
- assertEquals(0, schemaEngine.getMeasurementMNode(path).getOffset());
+ assertEquals(0, schemaProcessor.getMeasurementMNode(path).getOffset());
}
}
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineImproveTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/SchemaImproveTest.java
similarity index 83%
rename from server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineImproveTest.java
rename to server/src/test/java/org/apache/iotdb/db/metadata/SchemaImproveTest.java
index bb01d71..6cb3c6c 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/SchemaEngineImproveTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/SchemaImproveTest.java
@@ -44,24 +44,24 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-public class SchemaEngineImproveTest {
+public class SchemaImproveTest {
- private static Logger logger = LoggerFactory.getLogger(SchemaEngineImproveTest.class);
+ private static Logger logger = LoggerFactory.getLogger(SchemaImproveTest.class);
private static final int TIMESERIES_NUM = 1000;
private static final int DEVICE_NUM = 10;
- private static SchemaEngine schemaEngine = null;
+ private static LocalSchemaProcessor schemaProcessor = null;
@Before
public void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- schemaEngine = IoTDB.schemaEngine;
- schemaEngine.setStorageGroup(new PartialPath("root.t1.v2"));
+ schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.setStorageGroup(new PartialPath("root.t1.v2"));
for (int j = 0; j < DEVICE_NUM; j++) {
for (int i = 0; i < TIMESERIES_NUM; i++) {
String p = "root.t1.v2.d" + j + ".s" + i;
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath(p),
TSDataType.TEXT,
TSEncoding.PLAIN,
@@ -73,16 +73,16 @@ public class SchemaEngineImproveTest {
@Test
public void checkSetUp() throws IllegalPathException {
- schemaEngine = IoTDB.schemaEngine;
+ schemaProcessor = IoTDB.schemaProcessor;
- assertTrue(schemaEngine.isPathExist(new PartialPath("root.t1.v2.d3.s5")));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.t1.v2.d9.s" + TIMESERIES_NUM)));
- assertFalse(schemaEngine.isPathExist(new PartialPath("root.t10")));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath("root.t1.v2.d3.s5")));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.t1.v2.d9.s" + TIMESERIES_NUM)));
+ assertFalse(schemaProcessor.isPathExist(new PartialPath("root.t10")));
}
@Test
public void analyseTimeCost() throws MetadataException {
- schemaEngine = IoTDB.schemaEngine;
+ schemaProcessor = IoTDB.schemaProcessor;
long string_combine, path_exist, list_init, check_filelevel, get_seriestype;
string_combine = path_exist = list_init = check_filelevel = get_seriestype = 0;
@@ -93,7 +93,7 @@ public class SchemaEngineImproveTest {
long startTime = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
- assertTrue(schemaEngine.isPathExist(new PartialPath(path)));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath(path)));
}
long endTime = System.currentTimeMillis();
path_exist += endTime - startTime;
@@ -104,7 +104,7 @@ public class SchemaEngineImproveTest {
startTime = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
- TSDataType dataType = schemaEngine.getSeriesType(new PartialPath(path));
+ TSDataType dataType = schemaProcessor.getSeriesType(new PartialPath(path));
assertEquals(TSDataType.TEXT, dataType);
}
endTime = System.currentTimeMillis();
@@ -121,8 +121,8 @@ public class SchemaEngineImproveTest {
throws MetadataException {
for (String measurement : measurementList) {
String path = deviceId + TsFileConstant.PATH_SEPARATOR + measurement;
- assertTrue(schemaEngine.isPathExist(new PartialPath(path)));
- TSDataType dataType = schemaEngine.getSeriesType(new PartialPath(path));
+ assertTrue(schemaProcessor.isPathExist(new PartialPath(path)));
+ TSDataType dataType = schemaProcessor.getSeriesType(new PartialPath(path));
assertEquals(TSDataType.TEXT, dataType);
}
}
@@ -131,13 +131,13 @@ public class SchemaEngineImproveTest {
throws MetadataException {
for (String measurement : measurementList) {
String path = deviceId + TsFileConstant.PATH_SEPARATOR + measurement;
- TSDataType dataType = schemaEngine.getSeriesType(new PartialPath(path));
+ TSDataType dataType = schemaProcessor.getSeriesType(new PartialPath(path));
assertEquals(TSDataType.TEXT, dataType);
}
}
private void doCacheTest(String deviceId, List<String> measurementList) throws MetadataException {
- IMNode node = schemaEngine.getDeviceNode(new PartialPath(deviceId));
+ IMNode node = schemaProcessor.getDeviceNode(new PartialPath(deviceId));
for (String s : measurementList) {
assertTrue(node.hasChild(s));
IMeasurementMNode measurementNode = node.getChild(s).getAsMeasurementMNode();
@@ -148,7 +148,7 @@ public class SchemaEngineImproveTest {
@Test
public void improveTest() throws MetadataException {
- schemaEngine = IoTDB.schemaEngine;
+ schemaProcessor = IoTDB.schemaProcessor;
String[] deviceIdList = new String[DEVICE_NUM];
for (int i = 0; i < DEVICE_NUM; i++) {
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/TemplateTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/TemplateTest.java
index 1755f54..e118eaf 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/TemplateTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/TemplateTest.java
@@ -78,16 +78,17 @@ public class TemplateTest {
public void testTemplate() throws MetadataException {
CreateTemplatePlan plan = getCreateTemplatePlan();
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.createSchemaTemplate(plan);
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.createSchemaTemplate(plan);
// set device template
SetTemplatePlan setTemplatePlan = new SetTemplatePlan("template1", "root.sg1.d1");
- schemaEngine.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
- schemaEngine.setUsingSchemaTemplate(new ActivateTemplatePlan(new PartialPath("root.sg1.d1")));
- IMNode node = schemaEngine.getDeviceNode(new PartialPath("root.sg1.d1"));
+ schemaProcessor.setUsingSchemaTemplate(
+ new ActivateTemplatePlan(new PartialPath("root.sg1.d1")));
+ IMNode node = schemaProcessor.getDeviceNode(new PartialPath("root.sg1.d1"));
MeasurementSchema s11 =
new MeasurementSchema("s11", TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);
@@ -95,23 +96,25 @@ public class TemplateTest {
Set<IMeasurementSchema> allSchema =
new HashSet<>(node.getSchemaTemplate().getSchemaMap().values());
- schemaEngine.getAllMeasurementByDevicePath(new PartialPath("root.sg1.d1")).stream()
+ schemaProcessor.getAllMeasurementByDevicePath(new PartialPath("root.sg1.d1")).stream()
.map(MeasurementPath::getMeasurementSchema)
.forEach(allSchema::remove);
assertTrue(allSchema.isEmpty());
- IMeasurementMNode mNode = schemaEngine.getMeasurementMNode(new PartialPath("root.sg1.d1.s11"));
+ IMeasurementMNode mNode =
+ schemaProcessor.getMeasurementMNode(new PartialPath("root.sg1.d1.s11"));
IMeasurementMNode mNode2 =
- schemaEngine.getMeasurementMNode(new PartialPath("root.sg1.d1.vector.s2"));
+ schemaProcessor.getMeasurementMNode(new PartialPath("root.sg1.d1.vector.s2"));
assertNotNull(mNode);
assertEquals(mNode.getSchema(), s11);
assertNotNull(mNode2);
assertEquals(
- mNode2.getSchema(), schemaEngine.getTemplate("template1").getSchemaMap().get("vector.s2"));
+ mNode2.getSchema(),
+ schemaProcessor.getTemplate("template1").getSchemaMap().get("vector.s2"));
try {
- schemaEngine.getMeasurementMNode(new PartialPath("root.sg1.d1.s100"));
+ schemaProcessor.getMeasurementMNode(new PartialPath("root.sg1.d1.s100"));
fail();
} catch (PathNotExistException e) {
assertEquals("Path [root.sg1.d1.s100] does not exist", e.getMessage());
@@ -122,11 +125,11 @@ public class TemplateTest {
public void testTemplateInnerTree() {
CreateTemplatePlan plan = getTreeTemplatePlan();
Template template;
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.createSchemaTemplate(plan);
- template = schemaEngine.getTemplate("treeTemplate");
+ schemaProcessor.createSchemaTemplate(plan);
+ template = schemaProcessor.getTemplate("treeTemplate");
assertEquals(4, template.getMeasurementsCount());
assertEquals("d1", template.getPathNodeInTemplate("d1").getName());
assertEquals(null, template.getPathNodeInTemplate("notExists"));
@@ -300,35 +303,36 @@ public class TemplateTest {
*/
@Test
public void testShowTemplates() throws MetadataException, QueryProcessException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- assertEquals(0, schemaEngine.getAllTemplates().size());
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ assertEquals(0, schemaProcessor.getAllTemplates().size());
CreateTemplatePlan plan1 = getTreeTemplatePlan();
CreateTemplatePlan plan2 = getCreateTemplatePlan();
- schemaEngine.createSchemaTemplate(plan1);
- schemaEngine.createSchemaTemplate(plan2);
+ schemaProcessor.createSchemaTemplate(plan1);
+ schemaProcessor.createSchemaTemplate(plan2);
- assertEquals("[template1, treeTemplate]", schemaEngine.getAllTemplates().toString());
+ assertEquals("[template1, treeTemplate]", schemaProcessor.getAllTemplates().toString());
for (int i = 0; i < 3; i++) {
SetTemplatePlan setTemplatePlan =
new SetTemplatePlan("template1", String.format("root.sg%d.d%d", i, i + 1));
- schemaEngine.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
}
assertEquals(
new HashSet<>(Arrays.asList("root.sg1.d2", "root.sg0.d1", "root.sg2.d3")),
- schemaEngine.getPathsSetTemplate("*"));
- assertEquals(new HashSet<>(Arrays.asList()), schemaEngine.getPathsSetTemplate("treeTemplate"));
+ schemaProcessor.getPathsSetTemplate("*"));
+ assertEquals(
+ new HashSet<>(Arrays.asList()), schemaProcessor.getPathsSetTemplate("treeTemplate"));
for (int i = 0; i < 3; i++) {
SetTemplatePlan setTemplatePlan =
new SetTemplatePlan("treeTemplate", String.format("root.tsg%d.d%d", i + 9, i + 10));
- schemaEngine.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
}
assertEquals(
new HashSet<>(Arrays.asList("root.tsg10.d11", "root.tsg11.d12", "root.tsg9.d10")),
- schemaEngine.getPathsSetTemplate("treeTemplate"));
+ schemaProcessor.getPathsSetTemplate("treeTemplate"));
assertEquals(
new HashSet<>(
Arrays.asList(
@@ -338,7 +342,7 @@ public class TemplateTest {
"root.sg1.d2",
"root.sg0.d1",
"root.sg2.d3")),
- schemaEngine.getPathsSetTemplate("*"));
+ schemaProcessor.getPathsSetTemplate("*"));
PlanExecutor exe1 = new PlanExecutor();
exe1.insert(getInsertRowPlan("root.sg0.d1", "s11"));
@@ -347,17 +351,17 @@ public class TemplateTest {
assertEquals(
new HashSet<>(Arrays.asList("root.tsg10.d11", "root.sg1.d2", "root.sg0.d1")),
- schemaEngine.getPathsUsingTemplate("*"));
+ schemaProcessor.getPathsUsingTemplate("*"));
try {
- schemaEngine.createSchemaTemplate(plan1);
+ schemaProcessor.createSchemaTemplate(plan1);
fail();
} catch (MetadataException e) {
assertEquals("Duplicated template name: treeTemplate", e.getMessage());
}
try {
- schemaEngine.dropSchemaTemplate(new DropTemplatePlan("treeTemplate"));
+ schemaProcessor.dropSchemaTemplate(new DropTemplatePlan("treeTemplate"));
fail();
} catch (MetadataException e) {
assertEquals(
@@ -367,39 +371,39 @@ public class TemplateTest {
@Test
public void testShowAllSchemas() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
CreateTemplatePlan plan1 = getTreeTemplatePlan();
CreateTemplatePlan plan2 = getCreateTemplatePlan();
- schemaEngine.createSchemaTemplate(plan1);
- schemaEngine.createSchemaTemplate(plan2);
- assertEquals(4, schemaEngine.getSchemasInTemplate("treeTemplate", "").size());
- assertEquals(2, schemaEngine.getSchemasInTemplate("treeTemplate", "GPS").size());
- assertEquals(11, schemaEngine.getSchemasInTemplate("template1", "").size());
- assertEquals(10, schemaEngine.getSchemasInTemplate("template1", "vector").size());
+ schemaProcessor.createSchemaTemplate(plan1);
+ schemaProcessor.createSchemaTemplate(plan2);
+ assertEquals(4, schemaProcessor.getSchemasInTemplate("treeTemplate", "").size());
+ assertEquals(2, schemaProcessor.getSchemasInTemplate("treeTemplate", "GPS").size());
+ assertEquals(11, schemaProcessor.getSchemasInTemplate("template1", "").size());
+ assertEquals(10, schemaProcessor.getSchemasInTemplate("template1", "vector").size());
}
@Test
public void testDropTemplate() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
CreateTemplatePlan plan1 = getTreeTemplatePlan();
CreateTemplatePlan plan2 = getCreateTemplatePlan();
- schemaEngine.createSchemaTemplate(plan1);
- schemaEngine.createSchemaTemplate(plan2);
+ schemaProcessor.createSchemaTemplate(plan1);
+ schemaProcessor.createSchemaTemplate(plan2);
- assertEquals("[template1, treeTemplate]", schemaEngine.getAllTemplates().toString());
+ assertEquals("[template1, treeTemplate]", schemaProcessor.getAllTemplates().toString());
try {
- schemaEngine.createSchemaTemplate(plan2);
+ schemaProcessor.createSchemaTemplate(plan2);
fail();
} catch (MetadataException e) {
assertEquals("Duplicated template name: template1", e.getMessage());
}
SetTemplatePlan setTemplatePlan = new SetTemplatePlan("template1", "root.sg.d0");
- schemaEngine.setSchemaTemplate(setTemplatePlan);
+ schemaProcessor.setSchemaTemplate(setTemplatePlan);
try {
- schemaEngine.dropSchemaTemplate(new DropTemplatePlan("template1"));
+ schemaProcessor.dropSchemaTemplate(new DropTemplatePlan("template1"));
fail();
} catch (MetadataException e) {
assertEquals(
@@ -407,47 +411,47 @@ public class TemplateTest {
}
UnsetTemplatePlan unsetPlan = new UnsetTemplatePlan("root.sg.d0", "template1");
- schemaEngine.unsetSchemaTemplate(unsetPlan);
-
- schemaEngine.dropSchemaTemplate(new DropTemplatePlan("template1"));
- assertEquals("[treeTemplate]", schemaEngine.getAllTemplates().toString());
- schemaEngine.createSchemaTemplate(plan2);
- assertEquals("[template1, treeTemplate]", schemaEngine.getAllTemplates().toString());
- schemaEngine.dropSchemaTemplate(new DropTemplatePlan("template1"));
- schemaEngine.dropSchemaTemplate(new DropTemplatePlan("treeTemplate"));
+ schemaProcessor.unsetSchemaTemplate(unsetPlan);
+
+ schemaProcessor.dropSchemaTemplate(new DropTemplatePlan("template1"));
+ assertEquals("[treeTemplate]", schemaProcessor.getAllTemplates().toString());
+ schemaProcessor.createSchemaTemplate(plan2);
+ assertEquals("[template1, treeTemplate]", schemaProcessor.getAllTemplates().toString());
+ schemaProcessor.dropSchemaTemplate(new DropTemplatePlan("template1"));
+ schemaProcessor.dropSchemaTemplate(new DropTemplatePlan("treeTemplate"));
}
@Test
public void testTemplateAlignment() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.createTimeseries(
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d0"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s2"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.ss.t1"),
TSDataType.INT32,
TSEncoding.PLAIN,
CompressionType.GZIP,
null);
- schemaEngine.createSchemaTemplate(getDirectAlignedTemplate());
+ schemaProcessor.createSchemaTemplate(getDirectAlignedTemplate());
try {
- schemaEngine.setSchemaTemplate(new SetTemplatePlan("templateDA", "root.laptop.d1"));
+ schemaProcessor.setSchemaTemplate(new SetTemplatePlan("templateDA", "root.laptop.d1"));
fail();
} catch (Exception e) {
assertEquals(
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/idtable/IDTableTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/idtable/IDTableTest.java
index e404d71..294f87c 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/idtable/IDTableTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/idtable/IDTableTest.java
@@ -25,7 +25,7 @@ import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.exception.metadata.DataTypeMismatchException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.query.QueryProcessException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.lastCache.container.ILastCacheContainer;
import org.apache.iotdb.db.metadata.mnode.IMeasurementMNode;
import org.apache.iotdb.db.metadata.path.PartialPath;
@@ -94,10 +94,10 @@ public class IDTableTest {
@Test
public void testCreateAlignedTimeseriesAndInsert() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
CreateAlignedTimeSeriesPlan plan =
new CreateAlignedTimeSeriesPlan(
new PartialPath("root.laptop.d1.aligned_device"),
@@ -113,7 +113,7 @@ public class IDTableTest {
null,
null);
- schemaEngine.createAlignedTimeSeries(plan);
+ schemaProcessor.createAlignedTimeSeries(plan);
IDTable idTable = IDTableManager.getInstance().getIDTable(new PartialPath("root.laptop"));
@@ -175,10 +175,10 @@ public class IDTableTest {
@Test
public void testCreateAlignedTimeseriesAndInsertNotAlignedData() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
CreateAlignedTimeSeriesPlan plan =
new CreateAlignedTimeSeriesPlan(
new PartialPath("root.laptop.d1.aligned_device"),
@@ -194,7 +194,7 @@ public class IDTableTest {
null,
null);
- schemaEngine.createAlignedTimeSeries(plan);
+ schemaProcessor.createAlignedTimeSeries(plan);
IDTable idTable = IDTableManager.getInstance().getIDTable(new PartialPath("root.laptop"));
@@ -240,10 +240,10 @@ public class IDTableTest {
@Test
public void testCreateTimeseriesAndInsert() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s0"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
@@ -295,16 +295,16 @@ public class IDTableTest {
@Test
public void testCreateTimeseriesAndInsertWithAlignedData() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.non_aligned_device.s1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.non_aligned_device.s2"),
TSDataType.valueOf("INT64"),
TSEncoding.valueOf("RLE"),
@@ -348,7 +348,7 @@ public class IDTableTest {
@Test
public void testInsertAndAutoCreate() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
// construct an insertRowPlan with mismatched data type
long time = 1L;
@@ -374,13 +374,15 @@ public class IDTableTest {
idTable.getSeriesSchemas(insertRowPlan);
- // check schemaEngine
+ // check SchemaProcessor
IMeasurementMNode s1Node =
- schemaEngine.getMeasurementMNode(new PartialPath("root.laptop.d1.non_aligned_device.s1"));
+ schemaProcessor.getMeasurementMNode(
+ new PartialPath("root.laptop.d1.non_aligned_device.s1"));
assertEquals("s1", s1Node.getName());
assertEquals(TSDataType.INT32, s1Node.getSchema().getType());
IMeasurementMNode s2Node =
- schemaEngine.getMeasurementMNode(new PartialPath("root.laptop.d1.non_aligned_device.s2"));
+ schemaProcessor.getMeasurementMNode(
+ new PartialPath("root.laptop.d1.non_aligned_device.s2"));
assertEquals("s2", s2Node.getName());
assertEquals(TSDataType.INT64, s2Node.getSchema().getType());
@@ -432,7 +434,7 @@ public class IDTableTest {
@Test
public void testAlignedInsertAndAutoCreate() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor processor = IoTDB.schemaProcessor;
try {
// construct an insertRowPlan with mismatched data type
long time = 1L;
@@ -458,13 +460,13 @@ public class IDTableTest {
idTable.getSeriesSchemas(insertRowPlan);
- // check schemaEngine
+ // check SchemaProcessor
IMeasurementMNode s1Node =
- schemaEngine.getMeasurementMNode(new PartialPath("root.laptop.d1.aligned_device.s1"));
+ processor.getMeasurementMNode(new PartialPath("root.laptop.d1.aligned_device.s1"));
assertEquals("s1", s1Node.getName());
assertEquals(TSDataType.INT32, s1Node.getSchema().getType());
IMeasurementMNode s2Node =
- schemaEngine.getMeasurementMNode(new PartialPath("root.laptop.d1.aligned_device.s2"));
+ processor.getMeasurementMNode(new PartialPath("root.laptop.d1.aligned_device.s2"));
assertEquals("s2", s2Node.getName());
assertEquals(TSDataType.INT64, s2Node.getSchema().getType());
assertTrue(s2Node.getParent().isAligned());
@@ -517,18 +519,18 @@ public class IDTableTest {
@Test
public void testTriggerAndInsert() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
long time = 1L;
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.non_aligned_device.s1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.non_aligned_device.s2"),
TSDataType.valueOf("INT64"),
TSEncoding.valueOf("RLE"),
@@ -565,15 +567,17 @@ public class IDTableTest {
idTable.getSeriesSchemas(insertRowPlan);
- // check schemaEngine
+ // check SchemaProcessor
IMeasurementMNode s1Node =
- schemaEngine.getMeasurementMNode(new PartialPath("root.laptop.d1.non_aligned_device.s1"));
+ schemaProcessor.getMeasurementMNode(
+ new PartialPath("root.laptop.d1.non_aligned_device.s1"));
assertEquals("s1", s1Node.getName());
assertEquals(TSDataType.INT32, s1Node.getSchema().getType());
assertNotNull(s1Node.getTriggerExecutor());
IMeasurementMNode s2Node =
- schemaEngine.getMeasurementMNode(new PartialPath("root.laptop.d1.non_aligned_device.s2"));
+ schemaProcessor.getMeasurementMNode(
+ new PartialPath("root.laptop.d1.non_aligned_device.s2"));
assertEquals("s2", s2Node.getName());
assertEquals(TSDataType.INT64, s2Node.getSchema().getType());
assertNull(s2Node.getTriggerExecutor());
@@ -594,18 +598,18 @@ public class IDTableTest {
@Test
public void testFlushTimeAndLastCache() {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
try {
long time = 1L;
- schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.non_aligned_device.s1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.non_aligned_device.s2"),
TSDataType.valueOf("INT64"),
TSEncoding.valueOf("RLE"),
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/idtable/InsertWithIDTableTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/idtable/InsertWithIDTableTest.java
index ddf835a..a5a3d84 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/idtable/InsertWithIDTableTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/idtable/InsertWithIDTableTest.java
@@ -176,8 +176,8 @@ public class InsertWithIDTableTest {
encodingList,
compressionTypes);
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(false);
@@ -269,8 +269,8 @@ public class InsertWithIDTableTest {
new CreateTemplatePlan(
"template1", measurementList, dataTypesList, encodingList, compressionTypes);
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1.GPS"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1.GPS"));
IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(false);
@@ -499,8 +499,8 @@ public class InsertWithIDTableTest {
QueryFilterOptimizationException, StorageEngineException, IOException {
CreateTemplatePlan plan = getCreateTemplatePlan();
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
InsertTabletPlan tabletPlan = getAlignedInsertTabletPlan();
PlanExecutor executor = new PlanExecutor();
@@ -542,8 +542,8 @@ public class InsertWithIDTableTest {
QueryFilterOptimizationException, StorageEngineException, IOException {
CreateTemplatePlan plan = getCreateTemplatePlan();
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
InsertTabletPlan tabletPlan = getAlignedInsertTabletPlan();
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSGTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSGTest.java
index d425266..f3fa7a0 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSGTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSGTest.java
@@ -20,7 +20,7 @@ package org.apache.iotdb.db.metadata.mtree;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.apache.iotdb.tsfile.utils.Pair;
@@ -265,7 +265,8 @@ public class MTreeAboveSGTest {
root.setStorageGroup(new PartialPath("root.sg1"));
root.setStorageGroup(new PartialPath("root.sg2"));
- SchemaEngine.StorageGroupFilter filter = storageGroup -> storageGroup.equals("root.sg1");
+ LocalSchemaProcessor.StorageGroupFilter filter =
+ storageGroup -> storageGroup.equals("root.sg1");
Pair<List<PartialPath>, Set<PartialPath>> result =
root.getNodesListInGivenLevel(new PartialPath("root.**"), 3, null);
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGTest.java
index b4d4187..e0dad13 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGTest.java
@@ -22,7 +22,7 @@ import org.apache.iotdb.db.exception.metadata.AliasAlreadyExistException;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.metadata.PathAlreadyExistException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.mnode.IMNode;
import org.apache.iotdb.db.metadata.mnode.MeasurementMNode;
import org.apache.iotdb.db.metadata.path.MeasurementPath;
@@ -618,7 +618,7 @@ public class MTreeBelowSGTest {
@Test
public void testGetNodeListInLevel() throws MetadataException {
- SchemaEngine.StorageGroupFilter filter = sg -> sg.equals("root.sg1");
+ LocalSchemaProcessor.StorageGroupFilter filter = sg -> sg.equals("root.sg1");
MTreeBelowSG storageGroup = getStorageGroup(new PartialPath("root.sg1"));
storageGroup.createTimeseries(
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/upgrade/MetadataUpgradeTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/upgrade/MetadataUpgradeTest.java
index 5fb057c..8acff5e 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/upgrade/MetadataUpgradeTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/upgrade/MetadataUpgradeTest.java
@@ -21,8 +21,8 @@ package org.apache.iotdb.db.metadata.upgrade;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.MetadataConstant;
-import org.apache.iotdb.db.metadata.SchemaEngine;
import org.apache.iotdb.db.metadata.logfile.MLogWriter;
import org.apache.iotdb.db.metadata.mnode.EntityMNode;
import org.apache.iotdb.db.metadata.mnode.IEntityMNode;
@@ -94,14 +94,15 @@ public class MetadataUpgradeTest {
MetadataUpgrader.upgrade();
IoTDB.configManager.init();
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- Assert.assertEquals(8, schemaEngine.getStorageGroupNum(new PartialPath("root.**"), false));
- Assert.assertEquals(10, schemaEngine.getAllTimeseriesCount(new PartialPath("root.**")));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ Assert.assertEquals(8, schemaProcessor.getStorageGroupNum(new PartialPath("root.**"), false));
+ Assert.assertEquals(10, schemaProcessor.getAllTimeseriesCount(new PartialPath("root.**")));
ShowTimeSeriesPlan showTimeSeriesPlan =
new ShowTimeSeriesPlan(
new PartialPath("root.**"), false, "t-k-0", "t-k-0-v-0", 0, 0, false);
- List<ShowTimeSeriesResult> resultList = schemaEngine.showTimeseries(showTimeSeriesPlan, null);
+ List<ShowTimeSeriesResult> resultList =
+ schemaProcessor.showTimeseries(showTimeSeriesPlan, null);
Assert.assertEquals(1, resultList.size());
ShowTimeSeriesResult result = resultList.get(0);
Assert.assertEquals("root.test.sg1.d1.s1", result.getName());
@@ -109,7 +110,7 @@ public class MetadataUpgradeTest {
showTimeSeriesPlan =
new ShowTimeSeriesPlan(
new PartialPath("root.**"), false, "t-k-1", "t-k-1-v-1", 0, 0, false);
- resultList = schemaEngine.showTimeseries(showTimeSeriesPlan, null);
+ resultList = schemaProcessor.showTimeseries(showTimeSeriesPlan, null);
resultList =
resultList.stream()
.sorted(Comparator.comparing(ShowTimeSeriesResult::getName))
@@ -120,11 +121,12 @@ public class MetadataUpgradeTest {
result = resultList.get(1);
Assert.assertEquals("root.test.sg2.d1.s1", result.getName());
- Assert.assertEquals(4, schemaEngine.getPathsSetTemplate("template").size());
- Assert.assertEquals(0, schemaEngine.getPathsSetTemplate("unsetTemplate").size());
+ Assert.assertEquals(4, schemaProcessor.getPathsSetTemplate("template").size());
+ Assert.assertEquals(0, schemaProcessor.getPathsSetTemplate("unsetTemplate").size());
Assert.assertEquals(
- "root.test.sg3.d3", new ArrayList<>(schemaEngine.getPathsUsingTemplate("template")).get(0));
+ "root.test.sg3.d3",
+ new ArrayList<>(schemaProcessor.getPathsUsingTemplate("template")).get(0));
}
private void prepareMLog() throws Exception {
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/PlannerTest.java b/server/src/test/java/org/apache/iotdb/db/qp/PlannerTest.java
index efc3682..64b8303 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/PlannerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/PlannerTest.java
@@ -25,7 +25,7 @@ import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.query.QueryProcessException;
import org.apache.iotdb.db.exception.sql.SQLParserException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.qp.executor.PlanExecutor;
import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
@@ -60,7 +60,7 @@ public class PlannerTest {
private CompressionType compressionType =
TSFileDescriptor.getInstance().getConfig().getCompressor();
- private SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ private LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
private Planner processor = new Planner();
static {
@@ -70,75 +70,75 @@ public class PlannerTest {
@Before
public void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
- schemaEngine.setStorageGroup(new PartialPath("root.vehicle1"));
- schemaEngine.createTimeseries(
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.vehicle1"));
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.device1.sensor1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.device1.sensor2"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.device1.sensor3"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.device2.sensor1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.device2.sensor2"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.device2.sensor3"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle1.device1.sensor1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle1.device1.sensor2"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle1.device1.sensor3"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle1.device2.sensor1"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle1.device2.sensor2"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
compressionType,
Collections.emptyMap());
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.vehicle1.device2.sensor3"),
TSDataType.valueOf("INT32"),
TSEncoding.valueOf("RLE"),
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/physical/ConcatOptimizerTest.java b/server/src/test/java/org/apache/iotdb/db/qp/physical/ConcatOptimizerTest.java
index 8c543cf..f946573 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/physical/ConcatOptimizerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/physical/ConcatOptimizerTest.java
@@ -53,38 +53,38 @@ public class ConcatOptimizerTest {
public void before() throws MetadataException {
processor = new Planner();
IoTDB.configManager.init();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.laptop"));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.laptop"));
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s1"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d1.s2"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s1"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d2.s2"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d3.s1"),
TSDataType.INT64,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.laptop.d3.s2"),
TSDataType.INT64,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/physical/InsertRowPlanTest.java b/server/src/test/java/org/apache/iotdb/db/qp/physical/InsertRowPlanTest.java
index 608d031..9c53dc6 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/physical/InsertRowPlanTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/physical/InsertRowPlanTest.java
@@ -141,8 +141,8 @@ public class InsertRowPlanTest {
new CreateTemplatePlan(
"templateN", measurementList, dataTypesList, encodingList, compressionTypes);
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("templateN", "root.isp.d1"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("templateN", "root.isp.d1"));
IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(false);
@@ -230,8 +230,8 @@ public class InsertRowPlanTest {
encodingList,
compressionTypes);
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(false);
@@ -322,8 +322,8 @@ public class InsertRowPlanTest {
new CreateTemplatePlan(
"template1", measurementList, dataTypesList, encodingList, compressionTypes);
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(false);
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/physical/InsertTabletPlanTest.java b/server/src/test/java/org/apache/iotdb/db/qp/physical/InsertTabletPlanTest.java
index d999a66..b42b42c 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/physical/InsertTabletPlanTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/physical/InsertTabletPlanTest.java
@@ -294,8 +294,8 @@ public class InsertTabletPlanTest {
QueryFilterOptimizationException, StorageEngineException, IOException {
CreateTemplatePlan plan = getCreateTemplatePlan();
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
InsertTabletPlan tabletPlan = getAlignedInsertTabletPlan();
PlanExecutor executor = new PlanExecutor();
@@ -337,8 +337,8 @@ public class InsertTabletPlanTest {
QueryFilterOptimizationException, StorageEngineException, IOException {
CreateTemplatePlan plan = getCreateTemplatePlan();
- IoTDB.schemaEngine.createSchemaTemplate(plan);
- IoTDB.schemaEngine.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
+ IoTDB.schemaProcessor.createSchemaTemplate(plan);
+ IoTDB.schemaProcessor.setSchemaTemplate(new SetTemplatePlan("template1", "root.isp.d1"));
InsertTabletPlan tabletPlan = getAlignedInsertTabletPlan();
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java b/server/src/test/java/org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java
index 540f07d..a7290d3 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java
@@ -103,26 +103,26 @@ public class PhysicalPlanTest {
@Before
public void before() throws MetadataException {
EnvironmentUtils.envSetUp();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d3.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d4.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
@@ -1432,7 +1432,7 @@ public class PhysicalPlanTest {
@Test
public void testRegexpQuery() throws QueryProcessException, MetadataException {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d5.s1"),
TSDataType.TEXT,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/physical/SerializationTest.java b/server/src/test/java/org/apache/iotdb/db/qp/physical/SerializationTest.java
index b190aad..e51c441 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/physical/SerializationTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/physical/SerializationTest.java
@@ -55,26 +55,26 @@ public class SerializationTest {
@Before
public void before() throws MetadataException {
IoTDB.configManager.init();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d3.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d4.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/query/dataset/UDTFAlignByTimeDataSetTest.java b/server/src/test/java/org/apache/iotdb/db/query/dataset/UDTFAlignByTimeDataSetTest.java
index ad5c6be..c05e0a9 100644
--- a/server/src/test/java/org/apache/iotdb/db/query/dataset/UDTFAlignByTimeDataSetTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/query/dataset/UDTFAlignByTimeDataSetTest.java
@@ -78,38 +78,38 @@ public class UDTFAlignByTimeDataSetTest {
@BeforeClass
public static void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.vehicle"));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.vehicle"));
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d1.s2"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d2.s2"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d3.s1"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.vehicle.d3.s2"),
TSDataType.FLOAT,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/query/reader/series/SeriesReaderTestUtil.java b/server/src/test/java/org/apache/iotdb/db/query/reader/series/SeriesReaderTestUtil.java
index a30e032..8124c3a 100644
--- a/server/src/test/java/org/apache/iotdb/db/query/reader/series/SeriesReaderTestUtil.java
+++ b/server/src/test/java/org/apache/iotdb/db/query/reader/series/SeriesReaderTestUtil.java
@@ -180,10 +180,10 @@ public class SeriesReaderTestUtil {
for (int i = 0; i < deviceNum; i++) {
deviceIds.add(SERIES_READER_TEST_SG + PATH_SEPARATOR + "device" + i);
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(SERIES_READER_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(SERIES_READER_TEST_SG));
for (String device : deviceIds) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath(device + PATH_SEPARATOR + measurementSchema.getMeasurementId()),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/rescon/ResourceManagerTest.java b/server/src/test/java/org/apache/iotdb/db/rescon/ResourceManagerTest.java
index d91800b..ffd0026 100644
--- a/server/src/test/java/org/apache/iotdb/db/rescon/ResourceManagerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/rescon/ResourceManagerTest.java
@@ -115,11 +115,11 @@ public class ResourceManagerTest {
for (int i = 0; i < deviceNum; i++) {
deviceIds[i] = RESOURCE_MANAGER_TEST_SG + PATH_SEPARATOR + "device" + i;
}
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(RESOURCE_MANAGER_TEST_SG));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(RESOURCE_MANAGER_TEST_SG));
for (String device : deviceIds) {
for (MeasurementSchema measurementSchema : measurementSchemas) {
PartialPath devicePath = new PartialPath(device);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
devicePath.concatNode(measurementSchema.getMeasurementId()),
measurementSchema.getType(),
measurementSchema.getEncodingType(),
diff --git a/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java b/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java
index 9295946..0b669d9 100644
--- a/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java
@@ -27,7 +27,7 @@ import org.apache.iotdb.db.engine.storagegroup.VirtualStorageGroupProcessor;
import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.service.IoTDB;
import org.apache.iotdb.db.sync.conf.SyncConstant;
@@ -77,10 +77,10 @@ public class FileLoaderTest {
}
private void initMetadata() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.setStorageGroup(new PartialPath("root.sg0"));
- schemaEngine.setStorageGroup(new PartialPath("root.sg1"));
- schemaEngine.setStorageGroup(new PartialPath("root.sg2"));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg0"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg2"));
}
@After
diff --git a/server/src/test/java/org/apache/iotdb/db/sync/receiver/recover/SyncReceiverLogAnalyzerTest.java b/server/src/test/java/org/apache/iotdb/db/sync/receiver/recover/SyncReceiverLogAnalyzerTest.java
index 75f0eda..550eb7f 100644
--- a/server/src/test/java/org/apache/iotdb/db/sync/receiver/recover/SyncReceiverLogAnalyzerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/sync/receiver/recover/SyncReceiverLogAnalyzerTest.java
@@ -28,7 +28,7 @@ import org.apache.iotdb.db.exception.DiskSpaceInsufficientException;
import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.service.IoTDB;
import org.apache.iotdb.db.sync.conf.SyncConstant;
@@ -80,10 +80,10 @@ public class SyncReceiverLogAnalyzerTest {
}
private void initMetadata() throws MetadataException {
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
- schemaEngine.setStorageGroup(new PartialPath("root.sg0"));
- schemaEngine.setStorageGroup(new PartialPath("root.sg1"));
- schemaEngine.setStorageGroup(new PartialPath("root.sg2"));
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg0"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg1"));
+ schemaProcessor.setStorageGroup(new PartialPath("root.sg2"));
}
@After
diff --git a/server/src/test/java/org/apache/iotdb/db/sync/sender/manage/SyncFileManagerTest.java b/server/src/test/java/org/apache/iotdb/db/sync/sender/manage/SyncFileManagerTest.java
index 0048f10..29a3195 100644
--- a/server/src/test/java/org/apache/iotdb/db/sync/sender/manage/SyncFileManagerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/sync/sender/manage/SyncFileManagerTest.java
@@ -76,7 +76,7 @@ public class SyncFileManagerTest {
Random r = new Random(0);
for (int i = 0; i < 3; i++) {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(getSgName(i)));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(getSgName(i)));
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 5; j++) {
diff --git a/server/src/test/java/org/apache/iotdb/db/sync/sender/recover/SyncSenderLogAnalyzerTest.java b/server/src/test/java/org/apache/iotdb/db/sync/sender/recover/SyncSenderLogAnalyzerTest.java
index 3987a26..16bc0fe 100644
--- a/server/src/test/java/org/apache/iotdb/db/sync/sender/recover/SyncSenderLogAnalyzerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/sync/sender/recover/SyncSenderLogAnalyzerTest.java
@@ -84,7 +84,7 @@ public class SyncSenderLogAnalyzerTest {
Map<String, Map<Long, Map<Long, Set<File>>>> allFileList = new HashMap<>();
for (int i = 0; i < 3; i++) {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath(getSgName(i)));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath(getSgName(i)));
}
Random r = new Random(0);
for (int i = 0; i < 3; i++) {
diff --git a/server/src/test/java/org/apache/iotdb/db/tools/MLogParserTest.java b/server/src/test/java/org/apache/iotdb/db/tools/MLogParserTest.java
index 9e4c210..de28910 100644
--- a/server/src/test/java/org/apache/iotdb/db/tools/MLogParserTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/tools/MLogParserTest.java
@@ -94,7 +94,7 @@ public class MLogParserTest {
plan.setDataType(TSDataType.INT32);
plan.setEncoding(TSEncoding.PLAIN);
plan.setCompressor(CompressionType.GZIP);
- IoTDB.schemaEngine.createTimeseries(plan);
+ IoTDB.schemaProcessor.createTimeseries(plan);
} catch (MetadataException e) {
e.printStackTrace();
}
@@ -103,27 +103,27 @@ public class MLogParserTest {
}
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.ln.cc"));
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.sgcc"));
- IoTDB.schemaEngine.setTTL(new PartialPath("root.sgcc"), 1234L);
- IoTDB.schemaEngine.deleteTimeseries(new PartialPath("root.sg1.device1.s1"));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.ln.cc"));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.sgcc"));
+ IoTDB.schemaProcessor.setTTL(new PartialPath("root.sgcc"), 1234L);
+ IoTDB.schemaProcessor.deleteTimeseries(new PartialPath("root.sg1.device1.s1"));
List<PartialPath> paths = new ArrayList<>();
paths.add(new PartialPath("root.ln.cc"));
- IoTDB.schemaEngine.deleteStorageGroups(paths);
+ IoTDB.schemaProcessor.deleteStorageGroups(paths);
Map<String, String> tags = new HashMap<String, String>();
tags.put("tag1", "value1");
- IoTDB.schemaEngine.addTags(tags, new PartialPath("root.sg1.device1.s2"));
- IoTDB.schemaEngine.changeAlias(new PartialPath("root.sg1.device1.s3"), "hello");
+ IoTDB.schemaProcessor.addTags(tags, new PartialPath("root.sg1.device1.s2"));
+ IoTDB.schemaProcessor.changeAlias(new PartialPath("root.sg1.device1.s3"), "hello");
} catch (MetadataException | IOException e) {
e.printStackTrace();
}
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.sg"));
- IoTDB.schemaEngine.createSchemaTemplate(genCreateSchemaTemplatePlan());
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.sg"));
+ IoTDB.schemaProcessor.createSchemaTemplate(genCreateSchemaTemplatePlan());
SetTemplatePlan setTemplatePlan = new SetTemplatePlan("template1", "root.sg");
- IoTDB.schemaEngine.setSchemaTemplate(setTemplatePlan);
- IoTDB.schemaEngine.setUsingSchemaTemplate(
+ IoTDB.schemaProcessor.setSchemaTemplate(setTemplatePlan);
+ IoTDB.schemaProcessor.setUsingSchemaTemplate(
new ActivateTemplatePlan(new PartialPath("root.sg.d1")));
} catch (MetadataException e) {
e.printStackTrace();
@@ -160,7 +160,7 @@ public class MLogParserTest {
prepareData();
testNonExistingStorageGroupDir("root.ln.cc");
- IoTDB.schemaEngine.forceMlog();
+ IoTDB.schemaProcessor.forceMlog();
testParseStorageGroupLog();
diff --git a/server/src/test/java/org/apache/iotdb/db/utils/SchemaUtilsTest.java b/server/src/test/java/org/apache/iotdb/db/utils/SchemaUtilsTest.java
index 4fd2aaa..02eb022 100644
--- a/server/src/test/java/org/apache/iotdb/db/utils/SchemaUtilsTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/utils/SchemaUtilsTest.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.db.utils;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.qp.constant.SQLConstant;
import org.apache.iotdb.db.service.IoTDB;
@@ -37,12 +37,12 @@ public class SchemaUtilsTest {
@Test
public void registerTimeseriesTest() throws MetadataException {
IoTDB.configManager.init();
- SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
String tsPath = "root.sg.d1.s1";
TimeseriesSchema timeseriesSchema = new TimeseriesSchema(tsPath, TSDataType.INT32);
SchemaUtils.registerTimeseries(timeseriesSchema);
- Assert.assertTrue(IoTDB.schemaEngine.isPathExist(new PartialPath(tsPath)));
+ Assert.assertTrue(IoTDB.schemaProcessor.isPathExist(new PartialPath(tsPath)));
}
@Test
diff --git a/server/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java b/server/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
index 0290fe9..3e255a1 100644
--- a/server/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
@@ -149,28 +149,28 @@ public class PerformanceTest {
tempProcessorStore.createNewFile();
try {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.logTestDevice"));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.logTestDevice"));
} catch (MetadataException ignored) {
}
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.logTestDevice.s1"),
TSDataType.DOUBLE,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.logTestDevice.s2"),
TSDataType.INT32,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.logTestDevice.s3"),
TSDataType.TEXT,
TSEncoding.PLAIN,
TSFileDescriptor.getInstance().getConfig().getCompressor(),
Collections.emptyMap());
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.logTestDevice.s4"),
TSDataType.BOOLEAN,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/writelog/recover/DeviceStringTest.java b/server/src/test/java/org/apache/iotdb/db/writelog/recover/DeviceStringTest.java
index 882c34e..cf1bbec 100644
--- a/server/src/test/java/org/apache/iotdb/db/writelog/recover/DeviceStringTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/writelog/recover/DeviceStringTest.java
@@ -25,7 +25,7 @@ import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.metadata.SchemaEngine;
+import org.apache.iotdb.db.metadata.LocalSchemaProcessor;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.service.IoTDB;
import org.apache.iotdb.db.utils.EnvironmentUtils;
@@ -59,7 +59,7 @@ public class DeviceStringTest {
private String logNodePrefix = TestConstant.OUTPUT_DATA_DIR.concat("testNode/0");
private Schema schema;
private TsFileResource resource;
- private SchemaEngine schemaEngine = IoTDB.schemaEngine;
+ private LocalSchemaProcessor schemaProcessor = IoTDB.schemaProcessor;
@Before
public void setup() throws IOException, WriteProcessException, MetadataException {
@@ -71,7 +71,7 @@ public class DeviceStringTest {
schema.registerTimeseries(
new Path("root.sg.device99"),
new MeasurementSchema("sensor4", TSDataType.INT64, TSEncoding.PLAIN));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor4"),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -80,7 +80,7 @@ public class DeviceStringTest {
schema.registerTimeseries(
new Path("root.sg.device99"),
new MeasurementSchema("sensor2", TSDataType.INT64, TSEncoding.PLAIN));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor2"),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -89,7 +89,7 @@ public class DeviceStringTest {
schema.registerTimeseries(
new Path(("root.sg.device99")),
new MeasurementSchema("sensor1", TSDataType.INT64, TSEncoding.PLAIN));
- schemaEngine.createTimeseries(
+ schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor1"),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -126,7 +126,7 @@ public class DeviceStringTest {
resource.deserialize();
assertFalse(resource.getDevices().isEmpty());
for (String device : resource.getDevices()) {
- assertSame(device, schemaEngine.getDeviceId(new PartialPath(device)));
+ assertSame(device, schemaProcessor.getDeviceId(new PartialPath(device)));
}
}
}
diff --git a/server/src/test/java/org/apache/iotdb/db/writelog/recover/LogReplayerTest.java b/server/src/test/java/org/apache/iotdb/db/writelog/recover/LogReplayerTest.java
index 38d5165..ac688fa 100644
--- a/server/src/test/java/org/apache/iotdb/db/writelog/recover/LogReplayerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/writelog/recover/LogReplayerTest.java
@@ -92,11 +92,11 @@ public class LogReplayerTest {
TsFileResource tsFileResource = new TsFileResource(tsFile);
IMemTable memTable = new PrimitiveMemTable();
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.sg"));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.sg"));
try {
for (int i = 0; i <= 5; i++) {
for (int j = 0; j <= 5; j++) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device" + i + ".sensor" + j),
TSDataType.INT64,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/writelog/recover/RecoverResourceFromReaderTest.java b/server/src/test/java/org/apache/iotdb/db/writelog/recover/RecoverResourceFromReaderTest.java
index 95ccc19..93af54b 100644
--- a/server/src/test/java/org/apache/iotdb/db/writelog/recover/RecoverResourceFromReaderTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/writelog/recover/RecoverResourceFromReaderTest.java
@@ -99,7 +99,7 @@ public class RecoverResourceFromReaderTest {
MeasurementSchema measurementSchema =
new MeasurementSchema("sensor" + j, TSDataType.INT64, TSEncoding.PLAIN);
schema.registerTimeseries(new Path(path.toTSFilePath().getDevice()), measurementSchema);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
measurementSchema.getType(),
measurementSchema.getEncodingType(),
@@ -110,7 +110,7 @@ public class RecoverResourceFromReaderTest {
schema.registerTimeseries(
new Path(("root.sg.device99")),
new MeasurementSchema("sensor4", TSDataType.INT64, TSEncoding.PLAIN));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor4"),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -119,7 +119,7 @@ public class RecoverResourceFromReaderTest {
schema.registerTimeseries(
new Path("root.sg.device99"),
new MeasurementSchema("sensor2", TSDataType.INT64, TSEncoding.PLAIN));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor2"),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -128,7 +128,7 @@ public class RecoverResourceFromReaderTest {
schema.registerTimeseries(
new Path(("root.sg.device99")),
new MeasurementSchema("sensor1", TSDataType.INT64, TSEncoding.PLAIN));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor1"),
TSDataType.INT64,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/writelog/recover/SeqTsFileRecoverTest.java b/server/src/test/java/org/apache/iotdb/db/writelog/recover/SeqTsFileRecoverTest.java
index b5c2885..7aed824 100644
--- a/server/src/test/java/org/apache/iotdb/db/writelog/recover/SeqTsFileRecoverTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/writelog/recover/SeqTsFileRecoverTest.java
@@ -122,10 +122,10 @@ public class SeqTsFileRecoverTest {
}
private void prepareData() throws IOException, MetadataException, WriteProcessException {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.sg"));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.sg"));
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device" + i + ".sensor" + j),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -206,9 +206,9 @@ public class SeqTsFileRecoverTest {
private void prepareDataWithDeletion()
throws IOException, MetadataException, WriteProcessException {
- IoTDB.schemaEngine.setStorageGroup(new PartialPath("root.sg"));
+ IoTDB.schemaProcessor.setStorageGroup(new PartialPath("root.sg"));
for (int i = 0; i < 4; i++) {
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device" + i + ".sensor1"),
TSDataType.INT64,
TSEncoding.PLAIN,
diff --git a/server/src/test/java/org/apache/iotdb/db/writelog/recover/UnseqTsFileRecoverTest.java b/server/src/test/java/org/apache/iotdb/db/writelog/recover/UnseqTsFileRecoverTest.java
index 46eaa3b..6b88f14 100644
--- a/server/src/test/java/org/apache/iotdb/db/writelog/recover/UnseqTsFileRecoverTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/writelog/recover/UnseqTsFileRecoverTest.java
@@ -108,7 +108,7 @@ public class UnseqTsFileRecoverTest {
MeasurementSchema measurementSchema =
new MeasurementSchema("sensor" + j, TSDataType.INT64, TSEncoding.PLAIN);
schema.registerTimeseries(new Path(path.toTSFilePath().getDevice()), measurementSchema);
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
path,
measurementSchema.getType(),
measurementSchema.getEncodingType(),
@@ -119,7 +119,7 @@ public class UnseqTsFileRecoverTest {
schema.registerTimeseries(
new Path(("root.sg.device99")),
new MeasurementSchema("sensor4", TSDataType.INT64, TSEncoding.PLAIN));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor4"),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -128,7 +128,7 @@ public class UnseqTsFileRecoverTest {
schema.registerTimeseries(
new Path(("root.sg.device99")),
new MeasurementSchema("sensor2", TSDataType.INT64, TSEncoding.PLAIN));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor2"),
TSDataType.INT64,
TSEncoding.PLAIN,
@@ -137,7 +137,7 @@ public class UnseqTsFileRecoverTest {
schema.registerTimeseries(
new Path(("root.sg.device99")),
new MeasurementSchema("sensor1", TSDataType.INT64, TSEncoding.PLAIN));
- IoTDB.schemaEngine.createTimeseries(
+ IoTDB.schemaProcessor.createTimeseries(
new PartialPath("root.sg.device99.sensor1"),
TSDataType.INT64,
TSEncoding.PLAIN,