CRZbulabula commented on a change in pull request #5308:
URL: https://github.com/apache/iotdb/pull/5308#discussion_r832134711
##########
File path:
confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
##########
@@ -83,9 +86,38 @@ public int getDeviceGroupID(String device) {
return hashExecutor.getDeviceGroupID(device);
}
- // TODO: Interfaces for metadata operations
+ /** Build ConfigNodeGroup ConsensusLayer */
+ private void setConsensusLayer(ConfigNodeConf config) {
+ // TODO: Support other consensus protocol
+ this.consensusImpl =
+ new StandAloneConsensus(
+ id -> {
+ if (id.getType() == GroupType.PartitionRegion) {
+ return new StandAloneStateMachine();
+ } else {
+ return new EmptyStateMachine();
+ }
+ });
+ this.consensusImpl.start();
+
+ this.consensusGroupId = new ConsensusGroupId(GroupType.PartitionRegion, 0);
+ this.consensusImpl.addConsensusGroup(
+ this.consensusGroupId,
+ Collections.singletonList(
+ new Peer(
Review comment:
I think optimize this code in next PR would be better. So that I can
discuss with Ziyang
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]