You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2022/11/12 08:45:33 UTC
[iotdb] 01/01: rename PartitionRegion to ConfigNodeRegion
This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a commit to branch beyyes/remove_node_perfect
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 8609fa66ef5eb576e756cc02018cc1eaa90d10d3
Author: Beyyes <cg...@foxmail.com>
AuthorDate: Sat Nov 12 16:45:17 2022 +0800
rename PartitionRegion to ConfigNodeRegion
---
.../iotdb/confignode/conf/ConfigNodeConfig.java | 10 +--
...hine.java => ConfigNodeRegionStateMachine.java} | 10 +--
.../iotdb/confignode/manager/ConfigManager.java | 6 +-
.../iotdb/confignode/manager/ConsensusManager.java | 14 ++--
.../partition/StorageGroupPartitionTable.java | 2 +-
.../procedure/env/DataNodeRemoveHandler.java | 2 +-
.../thrift/ConfigNodeRPCServiceProcessor.java | 2 +-
.../request/ConfigPhysicalPlanSerDeTest.java | 4 +-
consensus/README.md | 2 +-
.../apache/iotdb/consensus/ratis/UtilsTest.java | 4 +-
.../consensus/simple/SimpleConsensusTest.java | 4 +-
.../org/apache/iotdb/itbase/env/BaseConfig.java | 2 +-
.../confignode/it/IoTDBClusterPartitionIT.java | 6 +-
.../it/IoTDBConfigNodeSwitchLeaderIT.java | 8 +-
...titionRegionId.java => ConfigNodeRegionId.java} | 6 +-
.../iotdb/commons/consensus/ConsensusGroupId.java | 8 +-
.../commons/utils/ThriftCommonsSerDeUtilsTest.java | 2 +-
.../iotdb/db/auth/ClusterAuthorityFetcher.java | 14 ++--
.../apache/iotdb/db/client/ConfigNodeClient.java | 22 ++---
.../org/apache/iotdb/db/client/ConfigNodeInfo.java | 4 +-
.../iotdb/db/client/DataNodeClientPoolFactory.java | 14 ++--
.../metadata/template/ClusterTemplateManager.java | 16 ++--
.../mpp/plan/analyze/ClusterPartitionFetcher.java | 18 ++---
.../db/mpp/plan/analyze/cache/PartitionCache.java | 12 +--
.../config/executor/ClusterConfigTaskExecutor.java | 94 +++++++++++-----------
.../iotdb/db/mpp/plan/parser/ASTVisitor.java | 2 +-
.../db/sync/common/ClusterSyncInfoFetcher.java | 10 +--
.../db/trigger/executor/TriggerFireVisitor.java | 8 +-
.../trigger/service/TriggerInformationUpdater.java | 8 +-
thrift-commons/src/main/thrift/common.thrift | 2 +-
30 files changed, 158 insertions(+), 158 deletions(-)
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
index f0b54710d3..addb84a15e 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
@@ -47,7 +47,7 @@ public class ConfigNodeConfig {
private TEndPoint targetConfigNode = new TEndPoint("127.0.0.1", 22277);
// TODO: Read from iotdb-confignode.properties
- private int partitionRegionId = 0;
+ private int configNodeRegionId = 0;
/** ConfigNodeGroup consensus protocol */
private String configNodeConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
@@ -299,12 +299,12 @@ public class ConfigNodeConfig {
this.targetConfigNode = targetConfigNode;
}
- public int getPartitionRegionId() {
- return partitionRegionId;
+ public int getConfigNodeRegionId() {
+ return configNodeRegionId;
}
- public void setPartitionRegionId(int partitionRegionId) {
- this.partitionRegionId = partitionRegionId;
+ public void setConfigNodeRegionId(int configNodeRegionId) {
+ this.configNodeRegionId = configNodeRegionId;
}
public int getSeriesPartitionSlotNum() {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/PartitionRegionStateMachine.java b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
similarity index 97%
rename from confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/PartitionRegionStateMachine.java
rename to confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
index fc2b8a8210..70e2fa1bd2 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/PartitionRegionStateMachine.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
@@ -52,11 +52,11 @@ import java.nio.file.StandardCopyOption;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
-/** StateMachine for PartitionRegion */
-public class PartitionRegionStateMachine
+/** StateMachine for ConfigNodeRegion */
+public class ConfigNodeRegionStateMachine
implements IStateMachine, IStateMachine.EventApi, IStateMachine.RetryPolicy {
- private static final Logger LOGGER = LoggerFactory.getLogger(PartitionRegionStateMachine.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ConfigNodeRegionStateMachine.class);
private static final ExecutorService threadPool =
IoTDBThreadPoolFactory.newCachedThreadPool("CQ-recovery");
@@ -77,7 +77,7 @@ public class PartitionRegionStateMachine
CONF.getConfigNodeSimpleConsensusLogSegmentSizeMax();
private final TEndPoint currentNodeTEndPoint;
- public PartitionRegionStateMachine(ConfigManager configManager, ConfigPlanExecutor executor) {
+ public ConfigNodeRegionStateMachine(ConfigManager configManager, ConfigPlanExecutor executor) {
this.executor = executor;
this.configManager = configManager;
this.currentNodeTEndPoint =
@@ -180,7 +180,7 @@ public class PartitionRegionStateMachine
@Override
public void notifyLeaderChanged(ConsensusGroupId groupId, int newLeaderId) {
// We get currentNodeId here because the currentNodeId
- // couldn't initialize earlier than the PartitionRegionStateMachine
+ // couldn't initialize earlier than the ConfigNodeRegionStateMachine
int currentNodeId = ConfigNodeDescriptor.getInstance().getConf().getConfigNodeId();
if (currentNodeId == newLeaderId) {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
index e2d793958d..75230f5283 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
@@ -75,7 +75,7 @@ import org.apache.iotdb.confignode.consensus.response.SchemaNodeManagementResp;
import org.apache.iotdb.confignode.consensus.response.SchemaPartitionResp;
import org.apache.iotdb.confignode.consensus.response.StorageGroupSchemaResp;
import org.apache.iotdb.confignode.consensus.response.TemplateSetInfoResp;
-import org.apache.iotdb.confignode.consensus.statemachine.PartitionRegionStateMachine;
+import org.apache.iotdb.confignode.consensus.statemachine.ConfigNodeRegionStateMachine;
import org.apache.iotdb.confignode.manager.cq.CQManager;
import org.apache.iotdb.confignode.manager.load.LoadManager;
import org.apache.iotdb.confignode.manager.node.NodeManager;
@@ -194,7 +194,7 @@ public class ConfigManager implements IManager {
/** CQ */
private final CQManager cqManager;
- private final PartitionRegionStateMachine stateMachine;
+ private final ConfigNodeRegionStateMachine stateMachine;
public ConfigManager() throws IOException {
// Build the persistence module
@@ -220,7 +220,7 @@ public class ConfigManager implements IManager {
triggerInfo,
syncInfo,
cqInfo);
- this.stateMachine = new PartitionRegionStateMachine(this, executor);
+ this.stateMachine = new ConfigNodeRegionStateMachine(this, executor);
// Build the manager module
this.nodeManager = new NodeManager(this, nodeInfo);
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
index b0b8f44794..446d745b20 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
@@ -21,15 +21,15 @@ package org.apache.iotdb.confignode.manager;
import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.consensus.ConsensusGroupId;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
import org.apache.iotdb.commons.exception.BadNodeUrlException;
import org.apache.iotdb.commons.utils.TestOnly;
import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.conf.SystemPropertiesUtils;
import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlan;
-import org.apache.iotdb.confignode.consensus.statemachine.PartitionRegionStateMachine;
+import org.apache.iotdb.confignode.consensus.statemachine.ConfigNodeRegionStateMachine;
import org.apache.iotdb.confignode.exception.AddPeerException;
import org.apache.iotdb.confignode.manager.node.NodeManager;
import org.apache.iotdb.consensus.ConsensusFactory;
@@ -66,7 +66,7 @@ public class ConsensusManager {
private ConsensusGroupId consensusGroupId;
private IConsensus consensusImpl;
- public ConsensusManager(IManager configManager, PartitionRegionStateMachine stateMachine)
+ public ConsensusManager(IManager configManager, ConfigNodeRegionStateMachine stateMachine)
throws IOException {
this.configManager = configManager;
setConsensusLayer(stateMachine);
@@ -77,9 +77,9 @@ public class ConsensusManager {
}
/** ConsensusLayer local implementation */
- private void setConsensusLayer(PartitionRegionStateMachine stateMachine) throws IOException {
+ private void setConsensusLayer(ConfigNodeRegionStateMachine stateMachine) throws IOException {
// There is only one ConfigNodeGroup
- consensusGroupId = new PartitionRegionId(CONF.getPartitionRegionId());
+ consensusGroupId = new ConfigNodeRegionId(CONF.getConfigNodeRegionId());
if (ConsensusFactory.SIMPLE_CONSENSUS.equals(CONF.getConfigNodeConsensusProtocolClass())) {
consensusImpl =
@@ -260,11 +260,11 @@ public class ConsensusManager {
}
/**
- * Remove a ConfigNode Peer out of PartitionRegion
+ * Remove a ConfigNode Peer out of ConfigNodeRegion
*
* @param tConfigNodeLocation config node location
* @return True if successfully removePeer. False if another ConfigNode is being removed to the
- * PartitionRegion
+ * ConfigNodeRegion
*/
public boolean removeConfigNodePeer(TConfigNodeLocation tConfigNodeLocation) {
return consensusImpl
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
index b763fded02..b058b4e938 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
@@ -407,7 +407,7 @@ public class StorageGroupPartitionTable {
return dataPartitionTable.getSeriesSlotList();
case SchemaRegion:
return schemaPartitionTable.getSeriesSlotList();
- case PartitionRegion:
+ case ConfigNodeRegion:
default:
return Stream.concat(
schemaPartitionTable.getSeriesSlotList().stream(),
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java
index 8575c565a6..6660c0c080 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java
@@ -85,7 +85,7 @@ public class DataNodeRemoveHandler {
.filter(
rg ->
rg.getDataNodeLocations().contains(dataNodeLocation)
- && rg.regionId.getType() != TConsensusGroupType.PartitionRegion)
+ && rg.regionId.getType() != TConsensusGroupType.ConfigNodeRegion)
.map(TRegionReplicaSet::getRegionId)
.collect(Collectors.toList());
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
index 1ead8f76cf..7c2fc48269 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
@@ -754,7 +754,7 @@ public class ConfigNodeRPCServiceProcessor implements IConfigNodeRPCService.Ifac
@Override
public TGetSeriesSlotListResp getSeriesSlotList(TGetSeriesSlotListReq req) {
TConsensusGroupType type =
- req.isSetType() ? req.getType() : TConsensusGroupType.PartitionRegion;
+ req.isSetType() ? req.getType() : TConsensusGroupType.ConfigNodeRegion;
GetSeriesSlotListPlan plan = new GetSeriesSlotListPlan(req.getStorageGroup(), type);
return configManager.getSeriesSlotList(plan);
}
diff --git a/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java b/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java
index 66a9a60350..07a77ee756 100644
--- a/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java
+++ b/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java
@@ -136,8 +136,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import static org.apache.iotdb.common.rpc.thrift.TConsensusGroupType.ConfigNodeRegion;
import static org.apache.iotdb.common.rpc.thrift.TConsensusGroupType.DataRegion;
-import static org.apache.iotdb.common.rpc.thrift.TConsensusGroupType.PartitionRegion;
import static org.apache.iotdb.common.rpc.thrift.TConsensusGroupType.SchemaRegion;
import static org.junit.Assert.assertEquals;
@@ -1143,7 +1143,7 @@ public class ConfigPhysicalPlanSerDeTest {
public void GetRegionIdPlanTest() throws IOException {
GetRegionIdPlan getRegionIdPlan0 =
new GetRegionIdPlan(
- "root.test", PartitionRegion, new TSeriesPartitionSlot(1), new TTimePartitionSlot(0));
+ "root.test", ConfigNodeRegion, new TSeriesPartitionSlot(1), new TTimePartitionSlot(0));
GetRegionIdPlan getRegionIdPlan1 =
(GetRegionIdPlan)
ConfigPhysicalPlan.Factory.create(getRegionIdPlan0.serializeToByteBuffer());
diff --git a/consensus/README.md b/consensus/README.md
index ecd5c35eae..99b3f37933 100644
--- a/consensus/README.md
+++ b/consensus/README.md
@@ -72,7 +72,7 @@ IConsensus consensusImpl =
ConsensusFactory.RatisConsensus,
new Endpoint(conf.getRpcAddress(), conf.getInternalPort()),
new File(conf.getConsensusDir()),
- gid -> new PartitionRegionStateMachine())
+ gid -> new ConfigNodeRegionStateMachine())
.orElseThrow(() ->
new IllegalArgumentException(
String.format(
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/UtilsTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/UtilsTest.java
index 794c23289a..2d531bdcab 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/UtilsTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/UtilsTest.java
@@ -18,8 +18,8 @@
*/
package org.apache.iotdb.consensus.ratis;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.consensus.ConsensusGroupId;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
import org.apache.ratis.protocol.RaftGroupId;
import org.junit.Assert;
@@ -28,7 +28,7 @@ import org.junit.Test;
public class UtilsTest {
@Test
public void testEncryption() {
- ConsensusGroupId raw = new PartitionRegionId(100);
+ ConsensusGroupId raw = new ConfigNodeRegionId(100);
RaftGroupId id = Utils.fromConsensusGroupIdToRaftGroupId(raw);
ConsensusGroupId cgid = Utils.fromRaftGroupIdToConsensusGroupId(id);
Assert.assertEquals(raw.getId(), cgid.getId());
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/simple/SimpleConsensusTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/simple/SimpleConsensusTest.java
index 88a9ef34dc..8bea3db3d5 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/simple/SimpleConsensusTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/simple/SimpleConsensusTest.java
@@ -21,9 +21,9 @@ package org.apache.iotdb.consensus.simple;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.consensus.ConsensusGroupId;
import org.apache.iotdb.commons.consensus.DataRegionId;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
import org.apache.iotdb.commons.consensus.SchemaRegionId;
import org.apache.iotdb.consensus.ConsensusFactory;
import org.apache.iotdb.consensus.EmptyStateMachine;
@@ -65,7 +65,7 @@ public class SimpleConsensusTest {
new ByteBufferConsensusRequest(ByteBuffer.wrap(new byte[4]));
private final ConsensusGroupId dataRegionId = new DataRegionId(0);
private final ConsensusGroupId schemaRegionId = new SchemaRegionId(1);
- private final ConsensusGroupId configId = new PartitionRegionId(2);
+ private final ConsensusGroupId configId = new ConfigNodeRegionId(2);
private static class TestEntry implements IConsensusRequest {
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java
index d9d9023b57..4c5fc1187c 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java
@@ -267,7 +267,7 @@ public interface BaseConfig {
return 400000;
}
- default int getPartitionRegionRatisRPCLeaderElectionTimeoutMaxMs() {
+ default int getConfigNodeRegionRatisRPCLeaderElectionTimeoutMaxMs() {
return 4000;
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBClusterPartitionIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBClusterPartitionIT.java
index 9d8e011edc..0ba9a9dcd1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBClusterPartitionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBClusterPartitionIT.java
@@ -660,7 +660,7 @@ public class IoTDBClusterPartitionIT {
Assert.assertEquals(
TSStatusCode.ILLEGAL_PARAMETER.getStatusCode(), getRegionIdResp.status.getCode());
- getRegionIdReq.setType(TConsensusGroupType.PartitionRegion);
+ getRegionIdReq.setType(TConsensusGroupType.ConfigNodeRegion);
getRegionIdResp = client.getRegionId(getRegionIdReq);
Assert.assertEquals(
TSStatusCode.ILLEGAL_PARAMETER.getStatusCode(), getRegionIdResp.status.getCode());
@@ -679,7 +679,7 @@ public class IoTDBClusterPartitionIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), getRegionIdResp.status.getCode());
Assert.assertEquals(1, getRegionIdResp.getDataRegionIdListSize());
- getRegionIdReq.setType(TConsensusGroupType.PartitionRegion);
+ getRegionIdReq.setType(TConsensusGroupType.ConfigNodeRegion);
getRegionIdResp = client.getRegionId(getRegionIdReq);
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), getRegionIdResp.status.getCode());
@@ -724,7 +724,7 @@ public class IoTDBClusterPartitionIT {
TSStatusCode.SUCCESS_STATUS.getStatusCode(), getSeriesSlotListResp.status.getCode());
Assert.assertEquals(102, getSeriesSlotListResp.getSeriesSlotListSize());
- getSeriesSlotListReq.setType(TConsensusGroupType.PartitionRegion);
+ getSeriesSlotListReq.setType(TConsensusGroupType.ConfigNodeRegion);
getSeriesSlotListResp = client.getSeriesSlotList(getSeriesSlotListReq);
Assert.assertEquals(
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSwitchLeaderIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSwitchLeaderIT.java
index 3491e02616..a3a94ced3b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSwitchLeaderIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSwitchLeaderIT.java
@@ -68,7 +68,7 @@ public class IoTDBConfigNodeSwitchLeaderIT {
private static final int testConfigNodeNum = 3;
private static final int testDataNodeNum = 3;
- private static int partitionRegionRatisRPCLeaderElectionTimeoutMaxMs;
+ private static int configNodeRegionRatisRPCLeaderElectionTimeoutMaxMs;
@Before
public void setUp() throws Exception {
@@ -89,8 +89,8 @@ public class IoTDBConfigNodeSwitchLeaderIT {
ConfigFactory.getConfig().setSchemaReplicationFactor(testReplicationFactor);
ConfigFactory.getConfig().setDataReplicationFactor(testReplicationFactor);
- partitionRegionRatisRPCLeaderElectionTimeoutMaxMs =
- ConfigFactory.getConfig().getPartitionRegionRatisRPCLeaderElectionTimeoutMaxMs();
+ configNodeRegionRatisRPCLeaderElectionTimeoutMaxMs =
+ ConfigFactory.getConfig().getConfigNodeRegionRatisRPCLeaderElectionTimeoutMaxMs();
// Init 3C3D cluster environment
EnvFactory.getEnv().initClusterEnvironment(testConfigNodeNum, testDataNodeNum);
@@ -115,7 +115,7 @@ public class IoTDBConfigNodeSwitchLeaderIT {
// The ConfigNode-Group will elect a new leader after the current ConfigNode-Leader is shutdown
EnvFactory.getEnv().shutdownConfigNode(EnvFactory.getEnv().getLeaderConfigNodeIndex());
// Waiting for leader election
- TimeUnit.MILLISECONDS.sleep(partitionRegionRatisRPCLeaderElectionTimeoutMaxMs);
+ TimeUnit.MILLISECONDS.sleep(configNodeRegionRatisRPCLeaderElectionTimeoutMaxMs);
}
@Test
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/consensus/PartitionRegionId.java b/node-commons/src/main/java/org/apache/iotdb/commons/consensus/ConfigNodeRegionId.java
similarity index 87%
rename from node-commons/src/main/java/org/apache/iotdb/commons/consensus/PartitionRegionId.java
rename to node-commons/src/main/java/org/apache/iotdb/commons/consensus/ConfigNodeRegionId.java
index 82cb7a2fed..c6850e3dd2 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/consensus/PartitionRegionId.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/consensus/ConfigNodeRegionId.java
@@ -21,14 +21,14 @@ package org.apache.iotdb.commons.consensus;
import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
-public class PartitionRegionId extends ConsensusGroupId {
+public class ConfigNodeRegionId extends ConsensusGroupId {
- public PartitionRegionId(int id) {
+ public ConfigNodeRegionId(int id) {
this.id = id;
}
@Override
public TConsensusGroupType getType() {
- return TConsensusGroupType.PartitionRegion;
+ return TConsensusGroupType.ConfigNodeRegion;
}
}
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/consensus/ConsensusGroupId.java b/node-commons/src/main/java/org/apache/iotdb/commons/consensus/ConsensusGroupId.java
index 2a5ab281f2..167c1c3b3e 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/consensus/ConsensusGroupId.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/consensus/ConsensusGroupId.java
@@ -71,8 +71,8 @@ public abstract class ConsensusGroupId {
groupId = new DataRegionId(id);
} else if (type == TConsensusGroupType.SchemaRegion.getValue()) {
groupId = new SchemaRegionId(id);
- } else if (type == TConsensusGroupType.PartitionRegion.getValue()) {
- groupId = new PartitionRegionId(id);
+ } else if (type == TConsensusGroupType.ConfigNodeRegion.getValue()) {
+ groupId = new ConfigNodeRegionId(id);
} else {
throw new IllegalArgumentException(
"Unrecognized TConsensusGroupType: " + type + " with id = " + id);
@@ -96,8 +96,8 @@ public abstract class ConsensusGroupId {
case DataRegion:
format.append("DataRegion");
break;
- case PartitionRegion:
- format.append("PartitionRegion");
+ case ConfigNodeRegion:
+ format.append("ConfigNodeRegion");
break;
}
diff --git a/node-commons/src/test/java/org/apache/iotdb/commons/utils/ThriftCommonsSerDeUtilsTest.java b/node-commons/src/test/java/org/apache/iotdb/commons/utils/ThriftCommonsSerDeUtilsTest.java
index ea1ab01764..31972fc30b 100644
--- a/node-commons/src/test/java/org/apache/iotdb/commons/utils/ThriftCommonsSerDeUtilsTest.java
+++ b/node-commons/src/test/java/org/apache/iotdb/commons/utils/ThriftCommonsSerDeUtilsTest.java
@@ -108,7 +108,7 @@ public class ThriftCommonsSerDeUtilsTest {
@Test
public void readWriteTConsensusGroupIdTest() throws IOException {
TConsensusGroupId consensusGroupId0 =
- new TConsensusGroupId(TConsensusGroupType.PartitionRegion, 0);
+ new TConsensusGroupId(TConsensusGroupType.ConfigNodeRegion, 0);
try (PublicBAOS byteArrayOutputStream = new PublicBAOS();
DataOutputStream outputStream = new DataOutputStream(byteArrayOutputStream)) {
ThriftCommonsSerDeUtils.serializeTConsensusGroupId(consensusGroupId0, outputStream);
diff --git a/server/src/main/java/org/apache/iotdb/db/auth/ClusterAuthorityFetcher.java b/server/src/main/java/org/apache/iotdb/db/auth/ClusterAuthorityFetcher.java
index 5591bc1fa5..17c11b50cc 100644
--- a/server/src/main/java/org/apache/iotdb/db/auth/ClusterAuthorityFetcher.java
+++ b/server/src/main/java/org/apache/iotdb/db/auth/ClusterAuthorityFetcher.java
@@ -25,7 +25,7 @@ import org.apache.iotdb.commons.auth.entity.PathPrivilege;
import org.apache.iotdb.commons.auth.entity.Role;
import org.apache.iotdb.commons.auth.entity.User;
import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.exception.IoTDBException;
import org.apache.iotdb.commons.path.PartialPath;
import org.apache.iotdb.commons.utils.AuthUtils;
@@ -62,9 +62,9 @@ public class ClusterAuthorityFetcher implements IAuthorityFetcher {
private IAuthorCache iAuthorCache;
- private static final IClientManager<PartitionRegionId, ConfigNodeClient>
+ private static final IClientManager<ConfigNodeRegionId, ConfigNodeClient>
CONFIG_NODE_CLIENT_MANAGER =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(new DataNodeClientPoolFactory.ConfigNodeClientPoolFactory());
public ClusterAuthorityFetcher(IAuthorCache iAuthorCache) {
@@ -114,7 +114,7 @@ public class ClusterAuthorityFetcher implements IAuthorityFetcher {
public SettableFuture<ConfigTaskResult> operatePermission(AuthorStatement authorStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Construct request using statement
TAuthorizerReq authorizerReq = statementToAuthorizerReq(authorStatement);
// Send request to some API server
@@ -148,7 +148,7 @@ public class ClusterAuthorityFetcher implements IAuthorityFetcher {
TAuthorizerResp authorizerResp = new TAuthorizerResp();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Construct request using statement
TAuthorizerReq authorizerReq = statementToAuthorizerReq(authorStatement);
// Send request to some API server
@@ -199,7 +199,7 @@ public class ClusterAuthorityFetcher implements IAuthorityFetcher {
TLoginReq req = new TLoginReq(username, password);
TPermissionInfoResp status = null;
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
status = configNodeClient.login(req);
} catch (TException | IOException e) {
@@ -226,7 +226,7 @@ public class ClusterAuthorityFetcher implements IAuthorityFetcher {
TCheckUserPrivilegesReq req = new TCheckUserPrivilegesReq(username, allPath, permission);
TPermissionInfoResp permissionInfoResp;
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
permissionInfoResp = configNodeClient.checkUserPrivileges(req);
} catch (TException | IOException e) {
diff --git a/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeClient.java b/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeClient.java
index cf67cba8e5..e85ae84c85 100644
--- a/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeClient.java
+++ b/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeClient.java
@@ -31,7 +31,7 @@ import org.apache.iotdb.commons.client.ClientPoolProperty;
import org.apache.iotdb.commons.client.sync.SyncThriftClient;
import org.apache.iotdb.commons.client.sync.SyncThriftClientWithErrorHandler;
import org.apache.iotdb.commons.conf.CommonDescriptor;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.confignode.rpc.thrift.IConfigNodeRPCService;
import org.apache.iotdb.confignode.rpc.thrift.TAddConsensusGroupReq;
import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerReq;
@@ -149,9 +149,9 @@ public class ConfigNodeClient
private final IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
- ClientManager<PartitionRegionId, ConfigNodeClient> clientManager;
+ ClientManager<ConfigNodeRegionId, ConfigNodeClient> clientManager;
- PartitionRegionId partitionRegionId = ConfigNodeInfo.partitionRegionId;
+ ConfigNodeRegionId configNodeRegionId = ConfigNodeInfo.configNodeRegionId;
TProtocolFactory protocolFactory;
@@ -169,7 +169,7 @@ public class ConfigNodeClient
public ConfigNodeClient(
TProtocolFactory protocolFactory,
long connectionTimeout,
- ClientManager<PartitionRegionId, ConfigNodeClient> clientManager)
+ ClientManager<ConfigNodeRegionId, ConfigNodeClient> clientManager)
throws TException {
configNodes = ConfigNodeInfo.getInstance().getLatestConfigNodes();
this.protocolFactory = protocolFactory;
@@ -252,7 +252,7 @@ public class ConfigNodeClient
@Override
public void close() {
if (clientManager != null) {
- clientManager.returnClient(partitionRegionId, this);
+ clientManager.returnClient(configNodeRegionId, this);
} else {
invalidate();
}
@@ -265,7 +265,7 @@ public class ConfigNodeClient
@Override
public void invalidateAll() {
- clientManager.clear(ConfigNodeInfo.partitionRegionId);
+ clientManager.clear(ConfigNodeInfo.configNodeRegionId);
}
private boolean updateConfigNodeLeader(TSStatus status) {
@@ -1736,22 +1736,22 @@ public class ConfigNodeClient
throw new TException(MSG_RECONNECTION_FAIL);
}
- public static class Factory extends BaseClientFactory<PartitionRegionId, ConfigNodeClient> {
+ public static class Factory extends BaseClientFactory<ConfigNodeRegionId, ConfigNodeClient> {
public Factory(
- ClientManager<PartitionRegionId, ConfigNodeClient> clientManager,
+ ClientManager<ConfigNodeRegionId, ConfigNodeClient> clientManager,
ClientFactoryProperty clientFactoryProperty) {
super(clientManager, clientFactoryProperty);
}
@Override
public void destroyObject(
- PartitionRegionId partitionRegionId, PooledObject<ConfigNodeClient> pooledObject) {
+ ConfigNodeRegionId configNodeRegionId, PooledObject<ConfigNodeClient> pooledObject) {
pooledObject.getObject().invalidate();
}
@Override
- public PooledObject<ConfigNodeClient> makeObject(PartitionRegionId partitionRegionId)
+ public PooledObject<ConfigNodeClient> makeObject(ConfigNodeRegionId configNodeRegionId)
throws Exception {
Constructor<ConfigNodeClient> constructor =
ConfigNodeClient.class.getConstructor(
@@ -1767,7 +1767,7 @@ public class ConfigNodeClient
@Override
public boolean validateObject(
- PartitionRegionId partitionRegionId, PooledObject<ConfigNodeClient> pooledObject) {
+ ConfigNodeRegionId configNodeRegionId, PooledObject<ConfigNodeClient> pooledObject) {
return pooledObject.getObject() != null && pooledObject.getObject().getTransport().isOpen();
}
}
diff --git a/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeInfo.java b/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeInfo.java
index 85fd29516f..fe7c36731d 100644
--- a/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeInfo.java
+++ b/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeInfo.java
@@ -20,7 +20,7 @@
package org.apache.iotdb.db.client;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.exception.BadNodeUrlException;
import org.apache.iotdb.commons.file.SystemFileFactory;
import org.apache.iotdb.commons.utils.NodeUrlUtils;
@@ -53,7 +53,7 @@ public class ConfigNodeInfo {
// latest config nodes
private final Set<TEndPoint> onlineConfigNodes;
- public static PartitionRegionId partitionRegionId = new PartitionRegionId(0);
+ public static ConfigNodeRegionId configNodeRegionId = new ConfigNodeRegionId(0);
private File propertiesFile;
diff --git a/server/src/main/java/org/apache/iotdb/db/client/DataNodeClientPoolFactory.java b/server/src/main/java/org/apache/iotdb/db/client/DataNodeClientPoolFactory.java
index 09305eeeb3..5be86a5185 100644
--- a/server/src/main/java/org/apache/iotdb/db/client/DataNodeClientPoolFactory.java
+++ b/server/src/main/java/org/apache/iotdb/db/client/DataNodeClientPoolFactory.java
@@ -30,7 +30,7 @@ import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.commons.client.sync.SyncDataNodeInternalServiceClient;
import org.apache.iotdb.commons.client.sync.SyncDataNodeMPPDataExchangeServiceClient;
import org.apache.iotdb.commons.concurrent.ThreadName;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
@@ -143,10 +143,10 @@ public class DataNodeClientPoolFactory {
}
public static class ConfigNodeClientPoolFactory
- implements IClientPoolFactory<PartitionRegionId, ConfigNodeClient> {
+ implements IClientPoolFactory<ConfigNodeRegionId, ConfigNodeClient> {
@Override
- public KeyedObjectPool<PartitionRegionId, ConfigNodeClient> createClientPool(
- ClientManager<PartitionRegionId, ConfigNodeClient> manager) {
+ public KeyedObjectPool<ConfigNodeRegionId, ConfigNodeClient> createClientPool(
+ ClientManager<ConfigNodeRegionId, ConfigNodeClient> manager) {
return new GenericKeyedObjectPool<>(
new ConfigNodeClient.Factory(
manager,
@@ -160,10 +160,10 @@ public class DataNodeClientPoolFactory {
}
public static class ClusterDeletionConfigNodeClientPoolFactory
- implements IClientPoolFactory<PartitionRegionId, ConfigNodeClient> {
+ implements IClientPoolFactory<ConfigNodeRegionId, ConfigNodeClient> {
@Override
- public KeyedObjectPool<PartitionRegionId, ConfigNodeClient> createClientPool(
- ClientManager<PartitionRegionId, ConfigNodeClient> manager) {
+ public KeyedObjectPool<ConfigNodeRegionId, ConfigNodeClient> createClientPool(
+ ClientManager<ConfigNodeRegionId, ConfigNodeClient> manager) {
return new GenericKeyedObjectPool<>(
new ConfigNodeClient.Factory(
manager,
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/template/ClusterTemplateManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/template/ClusterTemplateManager.java
index fccfab6294..ea81e4401b 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/template/ClusterTemplateManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/template/ClusterTemplateManager.java
@@ -21,7 +21,7 @@ package org.apache.iotdb.db.metadata.template;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.exception.IllegalPathException;
import org.apache.iotdb.commons.exception.IoTDBException;
import org.apache.iotdb.commons.path.PartialPath;
@@ -78,16 +78,16 @@ public class ClusterTemplateManager implements ITemplateManager {
return ClusterTemplateManager.ClusterTemplateManagerHolder.INSTANCE;
}
- private static final IClientManager<PartitionRegionId, ConfigNodeClient>
+ private static final IClientManager<ConfigNodeRegionId, ConfigNodeClient>
CONFIG_NODE_CLIENT_MANAGER =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(new DataNodeClientPoolFactory.ConfigNodeClientPoolFactory());
@Override
public TSStatus createSchemaTemplate(CreateSchemaTemplateStatement statement) {
TCreateSchemaTemplateReq req = constructTCreateSchemaTemplateReq(statement);
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
TSStatus tsStatus = configNodeClient.createSchemaTemplate(req);
// Get response or throw exception
@@ -122,7 +122,7 @@ public class ClusterTemplateManager implements ITemplateManager {
public List<Template> getAllTemplates() {
List<Template> templatesList = new ArrayList<>();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetAllTemplatesResp tGetAllTemplatesResp = configNodeClient.getAllTemplates();
// Get response or throw exception
if (tGetAllTemplatesResp.getStatus().getCode()
@@ -151,7 +151,7 @@ public class ClusterTemplateManager implements ITemplateManager {
@Override
public Template getTemplate(String name) {
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetTemplateResp resp = configNodeClient.getTemplate(name);
if (resp.getStatus().getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
byte[] templateBytes = resp.getTemplate();
@@ -172,7 +172,7 @@ public class ClusterTemplateManager implements ITemplateManager {
@Override
public void setSchemaTemplate(String name, PartialPath path) {
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TSetSchemaTemplateReq req = new TSetSchemaTemplateReq();
req.setName(name);
req.setPath(path.getFullPath());
@@ -189,7 +189,7 @@ public class ClusterTemplateManager implements ITemplateManager {
public List<PartialPath> getPathsSetTemplate(String name) {
List<PartialPath> listPath = new ArrayList<PartialPath>();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetPathsSetTemplatesResp resp = configNodeClient.getPathsSetTemplate(name);
if (resp.getStatus().getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
if (resp.getPathList() != null) {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java
index 383595c5bd..941d41d165 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java
@@ -23,7 +23,7 @@ import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.exception.IoTDBException;
import org.apache.iotdb.commons.partition.DataPartition;
import org.apache.iotdb.commons.partition.DataPartitionQueryParam;
@@ -69,8 +69,8 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
private final PartitionCache partitionCache;
- private final IClientManager<PartitionRegionId, ConfigNodeClient> configNodeClientManager =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ private final IClientManager<ConfigNodeRegionId, ConfigNodeClient> configNodeClientManager =
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(new DataNodeClientPoolFactory.ConfigNodeClientPoolFactory());
private static final class ClusterPartitionFetcherHolder {
@@ -93,7 +93,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
@Override
public SchemaPartition getSchemaPartition(PathPatternTree patternTree) {
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
patternTree.constructTree();
List<String> devicePaths = patternTree.getAllDevicePatterns();
Map<String, List<String>> storageGroupToDeviceMap =
@@ -125,7 +125,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
@Override
public SchemaPartition getOrCreateSchemaPartition(PathPatternTree patternTree) {
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
patternTree.constructTree();
List<String> devicePaths = patternTree.getAllDevicePatterns();
Map<String, List<String>> storageGroupToDeviceMap =
@@ -157,7 +157,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
public SchemaNodeManagementPartition getSchemaNodeManagementPartitionWithLevel(
PathPatternTree patternTree, Integer level) {
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
patternTree.constructTree();
TSchemaNodeManagementResp schemaNodeManagementResp =
client.getSchemaNodeManagementPartition(
@@ -174,7 +174,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
public DataPartition getDataPartition(
Map<String, List<DataPartitionQueryParam>> sgNameToQueryParamsMap) {
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
DataPartition dataPartition = partitionCache.getDataPartition(sgNameToQueryParamsMap);
if (null == dataPartition) {
TDataPartitionTableResp dataPartitionTableResp =
@@ -201,7 +201,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
Map<String, List<DataPartitionQueryParam>> sgNameToQueryParamsMap) {
// Do not use data partition cache
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
DataPartition dataPartition = partitionCache.getDataPartition(sgNameToQueryParamsMap);
if (null == dataPartition) {
TDataPartitionTableResp dataPartitionTableResp =
@@ -227,7 +227,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
public DataPartition getOrCreateDataPartition(
List<DataPartitionQueryParam> dataPartitionQueryParams) {
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
Map<String, List<DataPartitionQueryParam>> splitDataPartitionQueryParams =
splitDataPartitionQueryParam(dataPartitionQueryParams, true);
DataPartition dataPartition = partitionCache.getDataPartition(splitDataPartitionQueryParams);
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java
index be0e9b6e94..62a8a7da38 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/cache/PartitionCache.java
@@ -24,7 +24,7 @@ import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.exception.IoTDBException;
import org.apache.iotdb.commons.exception.MetadataException;
import org.apache.iotdb.commons.partition.DataPartition;
@@ -105,8 +105,8 @@ public class PartitionCache {
private final ReentrantReadWriteLock regionReplicaSetLock = new ReentrantReadWriteLock();
- private final IClientManager<PartitionRegionId, ConfigNodeClient> configNodeClientManager =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ private final IClientManager<ConfigNodeRegionId, ConfigNodeClient> configNodeClientManager =
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(new DataNodeClientPoolFactory.ConfigNodeClientPoolFactory());
public PartitionCache() {
@@ -186,7 +186,7 @@ public class PartitionCache {
private void fetchStorageGroupAndUpdateCache(
StorageGroupCacheResult<?> result, List<String> devicePaths) throws IOException, TException {
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
storageGroupCacheLock.writeLock().lock();
result.reset();
getStorageGroupMap(result, devicePaths, true);
@@ -217,7 +217,7 @@ public class PartitionCache {
StorageGroupCacheResult<?> result, List<String> devicePaths)
throws IOException, MetadataException, TException {
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
storageGroupCacheLock.writeLock().lock();
// try to check whether storage group need to be created
result.reset();
@@ -411,7 +411,7 @@ public class PartitionCache {
// verify that there are not hit in cache
if (!groupIdToReplicaSetMap.containsKey(consensusGroupId)) {
try (ConfigNodeClient client =
- configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ configNodeClientManager.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TRegionRouteMapResp resp = client.getLatestRegionRouteMap();
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() == resp.getStatus().getCode()) {
updateGroupIdToReplicaSetMap(resp.getTimestamp(), resp.getRegionRouteMap());
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/executor/ClusterConfigTaskExecutor.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/executor/ClusterConfigTaskExecutor.java
index d909f82a1b..101bacc51e 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/executor/ClusterConfigTaskExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/executor/ClusterConfigTaskExecutor.java
@@ -24,7 +24,7 @@ import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.common.rpc.thrift.TSetTTLReq;
import org.apache.iotdb.commons.client.IClientManager;
import org.apache.iotdb.commons.cluster.NodeStatus;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.exception.IoTDBException;
import org.apache.iotdb.commons.executable.ExecutableManager;
import org.apache.iotdb.commons.executable.ExecutableResource;
@@ -171,14 +171,14 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
private static final Logger LOGGER = LoggerFactory.getLogger(ClusterConfigTaskExecutor.class);
- private static final IClientManager<PartitionRegionId, ConfigNodeClient>
+ private static final IClientManager<ConfigNodeRegionId, ConfigNodeClient>
CONFIG_NODE_CLIENT_MANAGER =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(new DataNodeClientPoolFactory.ConfigNodeClientPoolFactory());
- private static final IClientManager<PartitionRegionId, ConfigNodeClient>
+ private static final IClientManager<ConfigNodeRegionId, ConfigNodeClient>
CLUSTER_DELETION_CONFIG_NODE_CLIENT_MANAGER =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(
new DataNodeClientPoolFactory.ClusterDeletionConfigNodeClientPoolFactory());
@@ -201,7 +201,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SetStorageGroupTask.constructStorageGroupSchema(setStorageGroupStatement);
TSetStorageGroupReq req = new TSetStorageGroupReq(storageGroupSchema);
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
TSStatus tsStatus = configNodeClient.setStorageGroup(req);
// Get response or throw exception
@@ -228,7 +228,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
List<String> storageGroupPathPattern =
Arrays.asList(showStorageGroupStatement.getPathPattern().getNodes());
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
TShowStorageGroupResp resp = client.showStorageGroup(storageGroupPathPattern);
// build TSBlock
@@ -247,7 +247,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
List<String> storageGroupPathPattern =
Arrays.asList(countStorageGroupStatement.getPathPattern().getNodes());
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TCountStorageGroupResp resp = client.countMatchedStorageGroups(storageGroupPathPattern);
storageGroupNum = resp.getCount();
// build TSBlock
@@ -265,7 +265,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
TDeleteStorageGroupsReq req =
new TDeleteStorageGroupsReq(deleteStorageGroupStatement.getPrefixPath());
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TSStatus tsStatus = client.deleteStorageGroups(req);
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != tsStatus.getCode()) {
LOGGER.error(
@@ -289,7 +289,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
String udfName = createFunctionStatement.getUdfName();
String className = createFunctionStatement.getClassName();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TCreateFunctionReq tCreateFunctionReq = new TCreateFunctionReq(udfName, className, false);
String libRoot = UDFExecutableManager.getInstance().getLibRoot();
String jarFileName;
@@ -388,7 +388,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> dropFunction(String udfName) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
final TSStatus executionStatus = client.dropFunction(new TDropFunctionReq(udfName));
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != executionStatus.getCode()) {
@@ -407,7 +407,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> showFunctions() {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetUDFTableResp getUDFTableResp = client.getUDFTable();
if (getUDFTableResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
future.setException(
@@ -429,7 +429,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
CreateTriggerStatement createTriggerStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TCreateTriggerReq tCreateTriggerReq =
new TCreateTriggerReq(
@@ -547,7 +547,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> dropTrigger(String triggerName) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
final TSStatus executionStatus = client.dropTrigger(new TDropTriggerReq(triggerName));
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != executionStatus.getCode()) {
LOGGER.error("[{}] Failed to drop trigger {}.", executionStatus, triggerName);
@@ -565,7 +565,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> showTriggers() {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetTriggerTableResp getTriggerTableResp = client.getTriggerTable();
if (getTriggerTableResp.getStatus().getCode()
!= TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
@@ -590,7 +590,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
Arrays.asList(setTTLStatement.getStorageGroupPath().getNodes());
TSetTTLReq setTTLReq = new TSetTTLReq(storageGroupPathPattern, setTTLStatement.getTTL());
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
TSStatus tsStatus = configNodeClient.setTTL(setTTLReq);
// Get response or throw exception
@@ -616,7 +616,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
TSStatus tsStatus = new TSStatus();
if (onCluster) {
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
tsStatus = client.merge();
} catch (IOException | TException e) {
@@ -639,7 +639,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
TSStatus tsStatus = new TSStatus();
if (onCluster) {
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
tsStatus = client.flush(tFlushReq);
} catch (IOException | TException e) {
@@ -662,7 +662,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
TSStatus tsStatus = new TSStatus();
if (onCluster) {
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
tsStatus = client.clearCache();
} catch (IOException | TException e) {
@@ -685,7 +685,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
TSStatus tsStatus = new TSStatus();
if (onCluster) {
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
tsStatus = client.loadConfiguration();
} catch (IOException | TException e) {
@@ -708,7 +708,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
TSStatus tsStatus = new TSStatus();
if (onCluster) {
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
tsStatus = client.setSystemStatus(status.getStatus());
} catch (IOException | TException e) {
@@ -730,7 +730,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
TShowClusterResp showClusterResp = new TShowClusterResp();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
showClusterResp = client.showCluster();
} catch (TException | IOException e) {
if (showClusterResp.getConfigNodeList() == null) {
@@ -756,7 +756,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
List<PartialPath> storageGroupPaths = showTTLStatement.getPaths();
Map<String, Long> storageGroupToTTL = new HashMap<>();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
if (showTTLStatement.isAll()) {
List<String> allStorageGroupPathPattern = Arrays.asList("root", "**");
TStorageGroupSchemaResp resp =
@@ -801,7 +801,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
.collect(Collectors.toList()));
}
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
showRegionResp = client.showRegion(showRegionReq);
if (showRegionResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
future.setException(
@@ -823,7 +823,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
TShowDataNodesResp showDataNodesResp = new TShowDataNodesResp();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
showDataNodesResp = client.showDataNodes();
if (showDataNodesResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
future.setException(
@@ -844,7 +844,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
TShowConfigNodesResp showConfigNodesResp = new TShowConfigNodesResp();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
showConfigNodesResp = client.showConfigNodes();
if (showConfigNodesResp.getStatus().getCode()
!= TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
@@ -891,7 +891,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
ShowSchemaTemplateStatement showSchemaTemplateStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
List<Template> templateList = ClusterTemplateManager.getInstance().getAllTemplates();
// build TSBlock
@@ -909,7 +909,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
String req = showNodesInSchemaTemplateStatement.getTemplateName();
TGetTemplateResp tGetTemplateResp = new TGetTemplateResp();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
Template template = ClusterTemplateManager.getInstance().getTemplate(req);
// build TSBlock
@@ -943,7 +943,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
String templateName = showPathSetTemplateStatement.getTemplateName();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
List<PartialPath> listPath =
ClusterTemplateManager.getInstance().getPathsSetTemplate(templateName);
@@ -966,7 +966,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
serializePatternListToByteBuffer(deactivateTemplateStatement.getPathPatternList()));
try (ConfigNodeClient client =
CLUSTER_DELETION_CONFIG_NODE_CLIENT_MANAGER.borrowClient(
- ConfigNodeInfo.partitionRegionId)) {
+ ConfigNodeInfo.configNodeRegionId)) {
TSStatus tsStatus;
do {
try {
@@ -1004,7 +1004,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
DropSchemaTemplateStatement dropSchemaTemplateStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
// Send request to some API server
TSStatus tsStatus =
configNodeClient.dropSchemaTemplate(dropSchemaTemplateStatement.getTemplateName());
@@ -1050,7 +1050,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
req.setPath(unsetSchemaTemplateStatement.getPath().getFullPath());
try (ConfigNodeClient client =
CLUSTER_DELETION_CONFIG_NODE_CLIENT_MANAGER.borrowClient(
- ConfigNodeInfo.partitionRegionId)) {
+ ConfigNodeInfo.configNodeRegionId)) {
TSStatus tsStatus;
do {
try {
@@ -1088,7 +1088,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
CreatePipeSinkStatement createPipeSinkStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TPipeSinkInfo pipeSinkInfo = new TPipeSinkInfo();
pipeSinkInfo.setPipeSinkName(createPipeSinkStatement.getPipeSinkName());
pipeSinkInfo.setPipeSinkType(createPipeSinkStatement.getPipeSinkType());
@@ -1115,7 +1115,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
DropPipeSinkStatement dropPipeSinkStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TDropPipeSinkReq req = new TDropPipeSinkReq();
req.setPipeSinkName(dropPipeSinkStatement.getPipeSinkName());
TSStatus tsStatus = configNodeClient.dropPipeSink(req);
@@ -1139,7 +1139,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
ShowPipeSinkStatement showPipeSinkStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetPipeSinkReq tGetPipeSinkReq = new TGetPipeSinkReq();
if (!StringUtils.isEmpty(showPipeSinkStatement.getPipeSinkName())) {
tGetPipeSinkReq.setPipeSinkName(showPipeSinkStatement.getPipeSinkName());
@@ -1156,7 +1156,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> createPipe(CreatePipeStatement createPipeStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TCreatePipeReq req =
new TCreatePipeReq()
.setPipeName(createPipeStatement.getPipeName())
@@ -1183,7 +1183,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> startPipe(StartPipeStatement startPipeStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TSStatus tsStatus = configNodeClient.startPipe(startPipeStatement.getPipeName());
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != tsStatus.getCode()) {
LOGGER.error(
@@ -1202,7 +1202,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> dropPipe(DropPipeStatement dropPipeStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TSStatus tsStatus = configNodeClient.dropPipe(dropPipeStatement.getPipeName());
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != tsStatus.getCode()) {
LOGGER.error(
@@ -1221,7 +1221,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> stopPipe(StopPipeStatement stopPipeStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TSStatus tsStatus = configNodeClient.stopPipe(stopPipeStatement.getPipeName());
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != tsStatus.getCode()) {
LOGGER.error(
@@ -1240,7 +1240,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> showPipe(ShowPipeStatement showPipeStatement) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TShowPipeReq tShowPipeReq = new TShowPipeReq();
if (!StringUtils.isEmpty(showPipeStatement.getPipeName())) {
tShowPipeReq.setPipeName(showPipeStatement.getPipeName());
@@ -1266,7 +1266,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
serializePatternListToByteBuffer(deleteTimeSeriesStatement.getPathPatternList()));
try (ConfigNodeClient client =
CLUSTER_DELETION_CONFIG_NODE_CLIENT_MANAGER.borrowClient(
- ConfigNodeInfo.partitionRegionId)) {
+ ConfigNodeInfo.configNodeRegionId)) {
TSStatus tsStatus;
do {
try {
@@ -1303,7 +1303,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
TGetRegionIdResp resp = new TGetRegionIdResp();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetRegionIdReq tGetRegionIdReq =
new TGetRegionIdReq(
getRegionIdStatement.getStorageGroup(),
@@ -1330,7 +1330,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
TGetSeriesSlotListResp resp = new TGetSeriesSlotListResp();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetSeriesSlotListReq tGetSeriesSlotListReq =
new TGetSeriesSlotListReq(getSeriesSlotListStatement.getStorageGroup());
if (getSeriesSlotListStatement.getPartitionType() != null) {
@@ -1354,7 +1354,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
TGetTimeSlotListResp resp = new TGetTimeSlotListResp();
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetTimeSlotListReq tGetTimeSlotListReq =
new TGetTimeSlotListReq(
getTimeSlotListStatement.getStorageGroup(),
@@ -1388,7 +1388,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TCreateCQReq tCreateCQReq =
new TCreateCQReq(
createContinuousQueryStatement.getCqId(),
@@ -1422,7 +1422,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> dropContinuousQuery(String cqId) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
final TSStatus executionStatus = client.dropCQ(new TDropCQReq(cqId));
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != executionStatus.getCode()) {
LOGGER.error("[{}] Failed to drop continuous query {}.", executionStatus, cqId);
@@ -1440,7 +1440,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
public SettableFuture<ConfigTaskResult> showContinuousQueries() {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TShowCQResp showCQResp = client.showCQ();
if (showCQResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
future.setException(
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
index 1ce8194f91..538ef609d5 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
@@ -2780,7 +2780,7 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
@Override
public Statement visitShowRegion(IoTDBSqlParser.ShowRegionContext ctx) {
ShowRegionStatement showRegionStatement = new ShowRegionStatement();
- // TODO: Maybe add a show partition region in the future
+ // TODO: Maybe add a show ConfigNode region in the future
if (ctx.DATA() != null) {
showRegionStatement.setRegionType(TConsensusGroupType.DataRegion);
} else if (ctx.SCHEMA() != null) {
diff --git a/server/src/main/java/org/apache/iotdb/db/sync/common/ClusterSyncInfoFetcher.java b/server/src/main/java/org/apache/iotdb/db/sync/common/ClusterSyncInfoFetcher.java
index 33254a4547..fbcee83b13 100644
--- a/server/src/main/java/org/apache/iotdb/db/sync/common/ClusterSyncInfoFetcher.java
+++ b/server/src/main/java/org/apache/iotdb/db/sync/common/ClusterSyncInfoFetcher.java
@@ -20,7 +20,7 @@ package org.apache.iotdb.db.sync.common;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.exception.sync.PipeSinkException;
import org.apache.iotdb.commons.sync.pipe.PipeInfo;
import org.apache.iotdb.commons.sync.pipe.PipeMessage;
@@ -47,9 +47,9 @@ public class ClusterSyncInfoFetcher implements ISyncInfoFetcher {
private static final Logger LOGGER = LoggerFactory.getLogger(ClusterSyncInfoFetcher.class);
- private static final IClientManager<PartitionRegionId, ConfigNodeClient>
+ private static final IClientManager<ConfigNodeRegionId, ConfigNodeClient>
CONFIG_NODE_CLIENT_MANAGER =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(new DataNodeClientPoolFactory.ConfigNodeClientPoolFactory());
// region Interfaces of PipeSink
@@ -67,7 +67,7 @@ public class ClusterSyncInfoFetcher implements ISyncInfoFetcher {
@Override
public PipeSink getPipeSink(String name) throws PipeSinkException {
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetPipeSinkReq tGetPipeSinkReq = new TGetPipeSinkReq().setPipeSinkName(name);
TGetPipeSinkResp resp = configNodeClient.getPipeSink(tGetPipeSinkReq);
if (resp.getPipeSinkInfoList().isEmpty()) {
@@ -113,7 +113,7 @@ public class ClusterSyncInfoFetcher implements ISyncInfoFetcher {
@Override
public List<PipeInfo> getAllPipeInfos() {
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetAllPipeInfoResp resp = configNodeClient.getAllPipeInfo();
return resp.getAllPipeInfo().stream()
.map(PipeInfo::deserializePipeInfo)
diff --git a/server/src/main/java/org/apache/iotdb/db/trigger/executor/TriggerFireVisitor.java b/server/src/main/java/org/apache/iotdb/db/trigger/executor/TriggerFireVisitor.java
index 1164976beb..fc1a7d056b 100644
--- a/server/src/main/java/org/apache/iotdb/db/trigger/executor/TriggerFireVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/trigger/executor/TriggerFireVisitor.java
@@ -23,7 +23,7 @@ import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.commons.client.IClientManager;
import org.apache.iotdb.commons.client.sync.SyncDataNodeInternalServiceClient;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.path.PartialPath;
import org.apache.iotdb.commons.trigger.TriggerInformation;
import org.apache.iotdb.commons.trigger.TriggerTable;
@@ -73,9 +73,9 @@ public class TriggerFireVisitor extends PlanVisitor<TriggerFireResult, TriggerEv
.createClientManager(
new DataNodeClientPoolFactory.SyncDataNodeInternalServiceClientPoolFactory());
- private static final IClientManager<PartitionRegionId, ConfigNodeClient>
+ private static final IClientManager<ConfigNodeRegionId, ConfigNodeClient>
CONFIG_NODE_CLIENT_MANAGER =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(new DataNodeClientPoolFactory.ConfigNodeClientPoolFactory());
/**
@@ -400,7 +400,7 @@ public class TriggerFireVisitor extends PlanVisitor<TriggerFireResult, TriggerEv
/** Return true if the config node returns a new TDataNodeLocation */
private boolean updateLocationOfStatefulTrigger(String triggerName, int currentDataNodeId) {
try (ConfigNodeClient configNodeClient =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TDataNodeLocation newTDataNodeLocation =
configNodeClient.getLocationOfStatefulTrigger(triggerName).getDataNodeLocation();
if (newTDataNodeLocation != null) {
diff --git a/server/src/main/java/org/apache/iotdb/db/trigger/service/TriggerInformationUpdater.java b/server/src/main/java/org/apache/iotdb/db/trigger/service/TriggerInformationUpdater.java
index c6e0ff97d1..0aadf06daa 100644
--- a/server/src/main/java/org/apache/iotdb/db/trigger/service/TriggerInformationUpdater.java
+++ b/server/src/main/java/org/apache/iotdb/db/trigger/service/TriggerInformationUpdater.java
@@ -22,7 +22,7 @@ package org.apache.iotdb.db.trigger.service;
import org.apache.iotdb.commons.client.IClientManager;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
-import org.apache.iotdb.commons.consensus.PartitionRegionId;
+import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.exception.IoTDBException;
import org.apache.iotdb.commons.trigger.TriggerInformation;
import org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableResp;
@@ -44,9 +44,9 @@ public class TriggerInformationUpdater {
private static final Logger LOGGER = LoggerFactory.getLogger(TriggerInformationUpdater.class);
- private static final IClientManager<PartitionRegionId, ConfigNodeClient>
+ private static final IClientManager<ConfigNodeRegionId, ConfigNodeClient>
CONFIG_NODE_CLIENT_MANAGER =
- new IClientManager.Factory<PartitionRegionId, ConfigNodeClient>()
+ new IClientManager.Factory<ConfigNodeRegionId, ConfigNodeClient>()
.createClientManager(new DataNodeClientPoolFactory.ConfigNodeClientPoolFactory());
private final ScheduledExecutorService triggerInformationUpdateExecutor =
@@ -80,7 +80,7 @@ public class TriggerInformationUpdater {
public void updateTask() {
try (ConfigNodeClient client =
- CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.partitionRegionId)) {
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.configNodeRegionId)) {
TGetTriggerTableResp getStatefulTriggerTableResp = client.getStatefulTriggerTable();
if (getStatefulTriggerTableResp.getStatus().getCode()
!= TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
diff --git a/thrift-commons/src/main/thrift/common.thrift b/thrift-commons/src/main/thrift/common.thrift
index e71978c6aa..b82f5c3804 100644
--- a/thrift-commons/src/main/thrift/common.thrift
+++ b/thrift-commons/src/main/thrift/common.thrift
@@ -35,7 +35,7 @@ struct TSStatus {
}
enum TConsensusGroupType {
- PartitionRegion,
+ ConfigNodeRegion,
DataRegion,
SchemaRegion
}