You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/11/02 09:37:16 UTC
[iotdb] 01/01: Rename OneCopyConsensus to SimpleConsensus
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch SimpleConsensus
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit c27cba503e71d88af0b2bbebf2856d2c9752a335
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Wed Nov 2 17:36:56 2022 +0800
Rename OneCopyConsensus to SimpleConsensus
---
.../iotdb/confignode/conf/ConfigNodeConfig.java | 4 ++--
.../confignode/conf/ConfigNodeStartupCheck.java | 14 ++++++-------
.../iotdb/confignode/manager/ConsensusManager.java | 8 ++++----
.../procedure/env/DataNodeRemoveHandler.java | 7 +++----
.../apache/iotdb/consensus/ConsensusFactory.java | 3 +--
.../SimpleConsensus.java} | 23 ++++++++++-----------
.../SimpleServerImpl.java} | 6 +++---
.../{onecopy => simple}/RecoveryTest.java | 6 +++---
.../SimpleConsensusTest.java} | 8 ++++----
.../Reference/ConfigNode-Config-Manual.md | 24 +++++++++++-----------
.../Reference/ConfigNode-Config-Manual.md | 16 +++++++--------
.../org/apache/iotdb/it/env/ConfigNodeWrapper.java | 6 +++---
.../org/apache/iotdb/itbase/env/BaseConfig.java | 6 +++---
.../resources/conf/iotdb-common.properties | 8 ++++----
14 files changed, 68 insertions(+), 71 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 49b39d1b58..ff06c839e3 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
@@ -53,13 +53,13 @@ public class ConfigNodeConfig {
private String configNodeConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
/** DataNode schema region consensus protocol */
- private String schemaRegionConsensusProtocolClass = ConsensusFactory.ONE_COPY_CONSENSUS;
+ private String schemaRegionConsensusProtocolClass = ConsensusFactory.SIMPLE_CONSENSUS;
/** The maximum number of SchemaRegion expected to be managed by each DataNode. */
private double schemaRegionPerDataNode = 1.0;
/** DataNode data region consensus protocol */
- private String dataRegionConsensusProtocolClass = ConsensusFactory.ONE_COPY_CONSENSUS;
+ private String dataRegionConsensusProtocolClass = ConsensusFactory.SIMPLE_CONSENSUS;
/** The maximum number of SchemaRegion expected to be managed by each DataNode. */
private double dataRegionPerProcessor = 0.5;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
index e96d46f7d2..0f015e5d11 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
@@ -50,9 +50,9 @@ public class ConfigNodeStartupCheck {
/** Check whether the global configuration of the cluster is correct */
private void checkGlobalConfig() throws ConfigurationException {
- // When the ConfigNode consensus protocol is set to ONE_COPY_CONSENSUS,
+ // When the ConfigNode consensus protocol is set to SIMPLE_CONSENSUS,
// the target_config_nodes needs to point to itself
- if (CONF.getConfigNodeConsensusProtocolClass().equals(ConsensusFactory.ONE_COPY_CONSENSUS)
+ if (CONF.getConfigNodeConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
&& (!CONF.getInternalAddress().equals(CONF.getTargetConfigNode().getIp())
|| CONF.getInternalPort() != CONF.getTargetConfigNode().getPort())) {
throw new ConfigurationException(
@@ -61,9 +61,9 @@ public class ConfigNodeStartupCheck {
CONF.getInternalAddress() + ":" + CONF.getInternalPort());
}
- // When the data region consensus protocol is set to ONE_COPY_CONSENSUS,
+ // When the data region consensus protocol is set to SIMPLE_CONSENSUS,
// the data replication factor must be 1
- if (CONF.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.ONE_COPY_CONSENSUS)
+ if (CONF.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
&& CONF.getDataReplicationFactor() != 1) {
throw new ConfigurationException(
"data_replication_factor",
@@ -71,9 +71,9 @@ public class ConfigNodeStartupCheck {
String.valueOf(1));
}
- // When the schema region consensus protocol is set to ONE_COPY_CONSENSUS,
+ // When the schema region consensus protocol is set to SIMPLE_CONSENSUS,
// the schema replication factor must be 1
- if (CONF.getSchemaRegionConsensusProtocolClass().equals(ConsensusFactory.ONE_COPY_CONSENSUS)
+ if (CONF.getSchemaRegionConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
&& CONF.getSchemaReplicationFactor() != 1) {
throw new ConfigurationException(
"schema_replication_factor",
@@ -89,7 +89,7 @@ public class ConfigNodeStartupCheck {
"schema_region_consensus_protocol_class",
String.valueOf(CONF.getSchemaRegionConsensusProtocolClass()),
String.format(
- "%s or %s", ConsensusFactory.ONE_COPY_CONSENSUS, ConsensusFactory.RATIS_CONSENSUS));
+ "%s or %s", ConsensusFactory.SIMPLE_CONSENSUS, ConsensusFactory.RATIS_CONSENSUS));
}
// The routing policy is limited
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 5523786a2c..3aa494e078 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
@@ -79,14 +79,14 @@ public class ConsensusManager {
// There is only one ConfigNodeGroup
consensusGroupId = new PartitionRegionId(CONF.getPartitionRegionId());
- if (ConsensusFactory.ONE_COPY_CONSENSUS.equals(CONF.getConfigNodeConsensusProtocolClass())) {
+ if (ConsensusFactory.SIMPLE_CONSENSUS.equals(CONF.getConfigNodeConsensusProtocolClass())) {
consensusImpl =
ConsensusFactory.getConsensusImpl(
- ConsensusFactory.ONE_COPY_CONSENSUS,
+ ConsensusFactory.SIMPLE_CONSENSUS,
ConsensusConfig.newBuilder()
.setThisNode(
new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort()))
- .setStorageDir("target" + java.io.File.separator + "one_copy")
+ .setStorageDir("target" + java.io.File.separator + "simple")
.build(),
gid -> stateMachine)
.orElseThrow(
@@ -94,7 +94,7 @@ public class ConsensusManager {
new IllegalArgumentException(
String.format(
ConsensusFactory.CONSTRUCT_FAILED_MSG,
- ConsensusFactory.ONE_COPY_CONSENSUS)));
+ ConsensusFactory.SIMPLE_CONSENSUS)));
} else {
// Implement local ConsensusLayer by ConfigNodeConfig
consensusImpl =
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 324cb2466d..a5f1cc5b2e 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
@@ -610,11 +610,10 @@ public class DataNodeRemoveHandler {
*/
private TSStatus checkClusterProtocol() {
TSStatus status = new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
- if (CONF.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.ONE_COPY_CONSENSUS)
- || CONF.getSchemaRegionConsensusProtocolClass()
- .equals(ConsensusFactory.ONE_COPY_CONSENSUS)) {
+ if (CONF.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
+ || CONF.getSchemaRegionConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)) {
status.setCode(TSStatusCode.REMOVE_DATANODE_FAILED.getStatusCode());
- status.setMessage("standalone protocol is not supported to remove data node");
+ status.setMessage("SimpleConsensus protocol is not supported to remove data node");
}
return status;
}
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ConsensusFactory.java b/consensus/src/main/java/org/apache/iotdb/consensus/ConsensusFactory.java
index b60c6a0458..e9271e868f 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ConsensusFactory.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ConsensusFactory.java
@@ -32,8 +32,7 @@ public class ConsensusFactory {
public static final String CONSTRUCT_FAILED_MSG =
"Construct consensusImpl failed, Please check your consensus className %s";
- public static final String ONE_COPY_CONSENSUS =
- "org.apache.iotdb.consensus.onecopy.OneCopyConsensus";
+ public static final String SIMPLE_CONSENSUS = "org.apache.iotdb.consensus.simple.SimpleConsensus";
public static final String RATIS_CONSENSUS = "org.apache.iotdb.consensus.ratis.RatisConsensus";
public static final String MULTI_LEADER_CONSENSUS =
"org.apache.iotdb.consensus.multileader.MultiLeaderConsensus";
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/onecopy/OneCopyConsensus.java b/consensus/src/main/java/org/apache/iotdb/consensus/simple/SimpleConsensus.java
similarity index 91%
rename from consensus/src/main/java/org/apache/iotdb/consensus/onecopy/OneCopyConsensus.java
rename to consensus/src/main/java/org/apache/iotdb/consensus/simple/SimpleConsensus.java
index c6066bff51..1dd3f7dee1 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/onecopy/OneCopyConsensus.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/simple/SimpleConsensus.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.iotdb.consensus.onecopy;
+package org.apache.iotdb.consensus.simple;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
@@ -57,18 +57,17 @@ import java.util.concurrent.atomic.AtomicBoolean;
*
* <p>Notice: The stateMachine needs to implement WAL itself to ensure recovery after a restart
*/
-class OneCopyConsensus implements IConsensus {
+class SimpleConsensus implements IConsensus {
- private final Logger logger = LoggerFactory.getLogger(OneCopyConsensus.class);
+ private final Logger logger = LoggerFactory.getLogger(SimpleConsensus.class);
private final TEndPoint thisNode;
private final int thisNodeId;
private final File storageDir;
private final IStateMachine.Registry registry;
- private final Map<ConsensusGroupId, OneCopyServerImpl> stateMachineMap =
- new ConcurrentHashMap<>();
+ private final Map<ConsensusGroupId, SimpleServerImpl> stateMachineMap = new ConcurrentHashMap<>();
- public OneCopyConsensus(ConsensusConfig config, Registry registry) {
+ public SimpleConsensus(ConsensusConfig config, Registry registry) {
this.thisNode = config.getThisNodeEndPoint();
this.thisNodeId = config.getThisNodeId();
this.storageDir = new File(config.getStorageDir());
@@ -92,8 +91,8 @@ class OneCopyConsensus implements IConsensus {
ConsensusGroupId consensusGroupId =
ConsensusGroupId.Factory.create(
Integer.parseInt(items[0]), Integer.parseInt(items[1]));
- OneCopyServerImpl consensus =
- new OneCopyServerImpl(
+ SimpleServerImpl consensus =
+ new SimpleServerImpl(
new Peer(consensusGroupId, thisNodeId, thisNode),
registry.apply(consensusGroupId));
stateMachineMap.put(consensusGroupId, consensus);
@@ -105,12 +104,12 @@ class OneCopyConsensus implements IConsensus {
@Override
public void stop() throws IOException {
- stateMachineMap.values().parallelStream().forEach(OneCopyServerImpl::stop);
+ stateMachineMap.values().parallelStream().forEach(SimpleServerImpl::stop);
}
@Override
public ConsensusWriteResponse write(ConsensusGroupId groupId, IConsensusRequest request) {
- OneCopyServerImpl impl = stateMachineMap.get(groupId);
+ SimpleServerImpl impl = stateMachineMap.get(groupId);
if (impl == null) {
return ConsensusWriteResponse.newBuilder()
.setException(new ConsensusGroupNotExistException(groupId))
@@ -129,7 +128,7 @@ class OneCopyConsensus implements IConsensus {
@Override
public ConsensusReadResponse read(ConsensusGroupId groupId, IConsensusRequest request) {
- OneCopyServerImpl impl = stateMachineMap.get(groupId);
+ SimpleServerImpl impl = stateMachineMap.get(groupId);
if (impl == null) {
return ConsensusReadResponse.newBuilder()
.setException(new ConsensusGroupNotExistException(groupId))
@@ -156,7 +155,7 @@ class OneCopyConsensus implements IConsensus {
groupId,
k -> {
exist.set(false);
- OneCopyServerImpl impl = new OneCopyServerImpl(peers.get(0), registry.apply(groupId));
+ SimpleServerImpl impl = new SimpleServerImpl(peers.get(0), registry.apply(groupId));
impl.start();
String path = buildPeerDir(groupId);
File file = new File(path);
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/onecopy/OneCopyServerImpl.java b/consensus/src/main/java/org/apache/iotdb/consensus/simple/SimpleServerImpl.java
similarity index 92%
rename from consensus/src/main/java/org/apache/iotdb/consensus/onecopy/OneCopyServerImpl.java
rename to consensus/src/main/java/org/apache/iotdb/consensus/simple/SimpleServerImpl.java
index df8c993c22..bb3ef2f557 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/onecopy/OneCopyServerImpl.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/simple/SimpleServerImpl.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.iotdb.consensus.onecopy;
+package org.apache.iotdb.consensus.simple;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.consensus.IStateMachine;
@@ -27,12 +27,12 @@ import org.apache.iotdb.consensus.common.request.IConsensusRequest;
import java.io.File;
-public class OneCopyServerImpl implements IStateMachine {
+public class SimpleServerImpl implements IStateMachine {
private final Peer peer;
private final IStateMachine stateMachine;
- public OneCopyServerImpl(Peer peer, IStateMachine stateMachine) {
+ public SimpleServerImpl(Peer peer, IStateMachine stateMachine) {
this.peer = peer;
this.stateMachine = stateMachine;
}
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/onecopy/RecoveryTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/simple/RecoveryTest.java
similarity index 95%
rename from consensus/src/test/java/org/apache/iotdb/consensus/onecopy/RecoveryTest.java
rename to consensus/src/test/java/org/apache/iotdb/consensus/simple/RecoveryTest.java
index 409d4f1bd3..83fc2414b9 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/onecopy/RecoveryTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/simple/RecoveryTest.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.iotdb.consensus.onecopy;
+package org.apache.iotdb.consensus.simple;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.commons.consensus.ConsensusGroupId;
@@ -46,7 +46,7 @@ public class RecoveryTest {
public void constructConsensus() throws IOException {
consensusImpl =
ConsensusFactory.getConsensusImpl(
- ConsensusFactory.ONE_COPY_CONSENSUS,
+ ConsensusFactory.SIMPLE_CONSENSUS,
ConsensusConfig.newBuilder()
.setThisNodeId(1)
.setThisNode(new TEndPoint("0.0.0.0", 9000))
@@ -58,7 +58,7 @@ public class RecoveryTest {
new IllegalArgumentException(
String.format(
ConsensusFactory.CONSTRUCT_FAILED_MSG,
- ConsensusFactory.ONE_COPY_CONSENSUS)));
+ ConsensusFactory.SIMPLE_CONSENSUS)));
consensusImpl.start();
}
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/onecopy/OneCopyConsensusTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/simple/SimpleConsensusTest.java
similarity index 98%
rename from consensus/src/test/java/org/apache/iotdb/consensus/onecopy/OneCopyConsensusTest.java
rename to consensus/src/test/java/org/apache/iotdb/consensus/simple/SimpleConsensusTest.java
index 151c3763c0..88a9ef34dc 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/onecopy/OneCopyConsensusTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/simple/SimpleConsensusTest.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.iotdb.consensus.onecopy;
+package org.apache.iotdb.consensus.simple;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
@@ -57,7 +57,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-public class OneCopyConsensusTest {
+public class SimpleConsensusTest {
private IConsensus consensusImpl;
private final TestEntry entry1 = new TestEntry(0);
@@ -126,7 +126,7 @@ public class OneCopyConsensusTest {
public void setUp() throws Exception {
consensusImpl =
ConsensusFactory.getConsensusImpl(
- ConsensusFactory.ONE_COPY_CONSENSUS,
+ ConsensusFactory.SIMPLE_CONSENSUS,
ConsensusConfig.newBuilder()
.setThisNodeId(1)
.setThisNode(new TEndPoint("0.0.0.0", 6667))
@@ -146,7 +146,7 @@ public class OneCopyConsensusTest {
new IllegalArgumentException(
String.format(
ConsensusFactory.CONSTRUCT_FAILED_MSG,
- ConsensusFactory.ONE_COPY_CONSENSUS)));
+ ConsensusFactory.SIMPLE_CONSENSUS)));
consensusImpl.start();
}
diff --git a/docs/UserGuide/Reference/ConfigNode-Config-Manual.md b/docs/UserGuide/Reference/ConfigNode-Config-Manual.md
index 1840d39bcc..5c3e62bfff 100644
--- a/docs/UserGuide/Reference/ConfigNode-Config-Manual.md
+++ b/docs/UserGuide/Reference/ConfigNode-Config-Manual.md
@@ -164,12 +164,12 @@ The global configuration of cluster is in ConfigNode.
* data\_region\_consensus\_protocol\_class
-|Name| data\_region\_consensus\_protocol\_class |
-|:---:|:---|
-|Description| Consensus protocol of data replicas, OneCopyConsensus could only be used in 1 replica,larger than 1 replicas could use MultiLeaderConsensus or RatisConsensus |
-|Type| String |
-|Default| org.apache.iotdb.consensus.onecopy.OneCopyConsensus |
-|Effective|Only allowed to be modified in first start up|
+|Name| data\_region\_consensus\_protocol\_class |
+|:---:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------|
+|Description| Consensus protocol of data replicas, SimpleConsensus could only be used in 1 replica,larger than 1 replicas could use MultiLeaderConsensus or RatisConsensus |
+|Type| String |
+|Default| org.apache.iotdb.consensus.simple.SimpleConsensus |
+|Effective| Only allowed to be modified in first start up |
* schema\_replication\_factor
@@ -183,12 +183,12 @@ The global configuration of cluster is in ConfigNode.
* schema\_region\_consensus\_protocol\_class
-|Name| schema\_region\_consensus\_protocol\_class |
-|:---:|:---|
-|Description| Consensus protocol of schema replicas, OneCopyConsensus could only be used in 1 replica,larger than 1 replicas could only use RatisConsensus | |
-|Type| String |
-|Default| org.apache.iotdb.consensus.onecopy.OneCopyConsensus |
-|Effective|Only allowed to be modified in first start up|
+|Name| schema\_region\_consensus\_protocol\_class |
+|:---:|:--------------------------------------------------------------------------------------------------------------------------------------------|
+|Description| Consensus protocol of schema replicas, SimpleConsensus could only be used in 1 replica,larger than 1 replicas could only use RatisConsensus | |
+|Type| String |
+|Default| org.apache.iotdb.consensus.simple.SimpleConsensus |
+|Effective| Only allowed to be modified in first start up |
* region\_allocate\_strategy
diff --git a/docs/zh/UserGuide/Reference/ConfigNode-Config-Manual.md b/docs/zh/UserGuide/Reference/ConfigNode-Config-Manual.md
index 7e76613d0c..40ff39524d 100644
--- a/docs/zh/UserGuide/Reference/ConfigNode-Config-Manual.md
+++ b/docs/zh/UserGuide/Reference/ConfigNode-Config-Manual.md
@@ -161,12 +161,12 @@ IoTDB 集群的全局配置通过 ConfigNode 配置。
* data\_region\_consensus\_protocol\_class
-|名字| data\_region\_consensus\_protocol\_class |
-|:---:|:---|
-|描述| 数据副本的共识协议,1 副本时可以使用 OneCopyConsensus 协议,多副本时可以使用 MultiLeaderConsensus 或 RatisConsensus |
-|类型| String |
-|默认值| org.apache.iotdb.consensus.onecopy.OneCopyConsensus |
-|改后生效方式|仅允许在第一次启动服务前修改|
+|名字| data\_region\_consensus\_protocol\_class |
+|:---:|:--------------------------------------------------------------------------------------|
+|描述| 数据副本的共识协议,1 副本时可以使用 SimpleConsensus 协议,多副本时可以使用 MultiLeaderConsensus 或 RatisConsensus |
+|类型| String |
+|默认值| org.apache.iotdb.consensus.simple.SimpleConsensus |
+|改后生效方式| 仅允许在第一次启动服务前修改 |
* schema\_replication\_factor
@@ -181,9 +181,9 @@ IoTDB 集群的全局配置通过 ConfigNode 配置。
|名字| schema\_region\_consensus\_protocol\_class |
|:---:|:---|
-|描述| 元数据副本的共识协议,1 副本时可以使用 OneCopyConsensus 协议,多副本时只能使用 RatisConsensus |
+|描述| 元数据副本的共识协议,1 副本时可以使用 SimpleConsensus 协议,多副本时只能使用 RatisConsensus |
|类型| String |
-|默认值| org.apache.iotdb.consensus.onecopy.OneCopyConsensus |
+|默认值| org.apache.iotdb.consensus.simple.SimpleConsensus |
|改后生效方式|仅允许在第一次启动服务前修改|
* region\_allocate\_strategy
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigNodeWrapper.java
index 8253b64110..f6a08286f5 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigNodeWrapper.java
@@ -55,13 +55,13 @@ public class ConfigNodeWrapper extends AbstractNodeWrapper {
properties.setProperty(IoTDBConstant.CN_TARGET_CONFIG_NODES, this.targetConfigNodes);
properties.setProperty(
"config_node_consensus_protocol_class",
- "org.apache.iotdb.consensus.onecopy.OneCopyConsensus");
+ "org.apache.iotdb.consensus.simple.SimpleConsensus");
properties.setProperty(
"schema_region_consensus_protocol_class",
- "org.apache.iotdb.consensus.onecopy.OneCopyConsensus");
+ "org.apache.iotdb.consensus.simple.SimpleConsensus");
properties.setProperty(
"data_region_consensus_protocol_class",
- "org.apache.iotdb.consensus.onecopy.OneCopyConsensus");
+ "org.apache.iotdb.consensus.simple.SimpleConsensus");
properties.setProperty("schema_replication_factor", "1");
properties.setProperty("data_replication_factor", "1");
properties.setProperty("cn_connection_timeout_ms", "30000");
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 56ad0abe80..20c6464436 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
@@ -215,7 +215,7 @@ public interface BaseConfig {
}
default String getConfigNodeConsesusProtocolClass() {
- return "org.apache.iotdb.consensus.onecopy.OneCopyConsensus";
+ return "org.apache.iotdb.consensus.simple.SimpleConsensus";
}
default BaseConfig setSchemaRegionConsensusProtocolClass(
@@ -224,7 +224,7 @@ public interface BaseConfig {
}
default String getSchemaRegionConsensusProtocolClass() {
- return "org.apache.iotdb.consensus.onecopy.OneCopyConsensus";
+ return "org.apache.iotdb.consensus.simple.SimpleConsensus";
}
default BaseConfig setDataRegionConsensusProtocolClass(String dataRegionConsensusProtocolClass) {
@@ -232,7 +232,7 @@ public interface BaseConfig {
}
default String getDataRegionConsensusProtocolClass() {
- return "org.apache.iotdb.consensus.onecopy.OneCopyConsensus";
+ return "org.apache.iotdb.consensus.simple.SimpleConsensus";
}
default BaseConfig setSchemaReplicationFactor(int schemaReplicationFactor) {
diff --git a/node-commons/src/assembly/resources/conf/iotdb-common.properties b/node-commons/src/assembly/resources/conf/iotdb-common.properties
index a39d54ef8e..8e78af7200 100644
--- a/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -978,10 +978,10 @@ trigger_forward_mqtt_pool_size=4
# SchemaRegion consensus protocol type.
# This parameter is unmodifiable after ConfigNode starts for the first time.
# These consensus protocols are currently supported:
-# 1. org.apache.iotdb.consensus.onecopy.OneCopyConsensus(Consensus patterns optimized specifically for single replica)
+# 1. org.apache.iotdb.consensus.simple.SimpleConsensus(Consensus patterns optimized specifically for single replica)
# 2. org.apache.iotdb.consensus.ratis.RatisConsensus(Raft protocol)
# Datatype: String
-# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.onecopy.OneCopyConsensus
+# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus
# The maximum number of SchemaRegion expected to be managed by each DataNode.
# Notice: Since each StorageGroup requires at least one SchemaRegion to manage its schema,
@@ -992,11 +992,11 @@ trigger_forward_mqtt_pool_size=4
# DataRegion consensus protocol type.
# This parameter is unmodifiable after ConfigNode starts for the first time.
# These consensus protocols are currently supported:
-# 1. org.apache.iotdb.consensus.onecopy.OneCopyConsensus(Consensus patterns optimized specifically for single replica)
+# 1. org.apache.iotdb.consensus.simple.SimpleConsensus(Consensus patterns optimized specifically for single replica)
# 2. org.apache.iotdb.consensus.multileader.MultiLeaderConsensus(weak consistency, high performance)
# 3. org.apache.iotdb.consensus.ratis.RatisConsensus(Raft protocol)
# Datatype: String
-# data_region_consensus_protocol_class=org.apache.iotdb.consensus.onecopy.OneCopyConsensus
+# data_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus
# The maximum number of DataRegion expected to be managed by each processor.
# Notice: Since each StorageGroup requires at least two DataRegions to manage its data,