You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/11 08:09:22 UTC
[GitHub] [iotdb] CRZbulabula commented on a diff in pull request #5862: [IoTDB-3053] Copyset algorithm when create timeseries
CRZbulabula commented on code in PR #5862:
URL: https://github.com/apache/iotdb/pull/5862#discussion_r869999095
##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/allocator/IRegionAllocator.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.confignode.manager.allocator;
+
+import org.apache.iotdb.common.rpc.thrift.TConsensusGroupId;
+import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
+import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
+
+import java.util.List;
+
+public interface IRegionAllocator {
+
+ /**
+ * Calculating the next optimal TRegionReplicaSet based on the current online DataNodes and
+ * allocated Regions
+ *
+ * @param onlineDataNodes DataNodes that currently communicable
+ * @param allocatedRegions Allocated Regions
+ * @param replicationFactor Replication factor of TRegionReplicaSet
+ * @param consensusGroupId TConsensusGroupId of result TRegionReplicaSet
+ * @return The optimal TRegionReplicaSet derived by the specific algorithm
+ */
+ TRegionReplicaSet allocateRegion(
+ List<TDataNodeLocation> onlineDataNodes,
+ List<TRegionReplicaSet> allocatedRegions,
Review Comment:
1. I want the IRegionAllocator just be a functional interface. And every class that implement it just be a functional class. Which means their duty is simply to take input parameters and return the best results.
2. I want to cancel the singleton mode of the PartitionInfo and other Info classes in the future.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org