You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/05/14 18:07:02 UTC

[GitHub] [incubator-pinot] snleee commented on a change in pull request #4193: Creation/deletion flow for replica groups sets in realtime

snleee commented on a change in pull request #4193: Creation/deletion flow for replica groups sets in realtime
URL: https://github.com/apache/incubator-pinot/pull/4193#discussion_r283926380
 
 

 ##########
 File path: pinot-core/src/main/java/org/apache/pinot/core/util/ReplicationUtils.java
 ##########
 @@ -0,0 +1,68 @@
+/**
+ * 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.pinot.core.util;
+
+import org.apache.pinot.common.config.SegmentsValidationAndRetentionConfig;
+import org.apache.pinot.common.config.TableConfig;
+import org.apache.pinot.common.utils.CommonConstants.Helix.TableType;
+import org.apache.pinot.core.realtime.stream.StreamConfig;
+
+
+/**
+ * Methods related to replication
+ */
+public class ReplicationUtils {
+
+  /**
+   * Decides if {@link SegmentsValidationAndRetentionConfig::getReplicationNumber} should be used
+   */
+  public static boolean useReplication(TableConfig tableConfig) {
+
+    TableType tableType = tableConfig.getTableType();
+    if (tableType.equals(TableType.REALTIME)) {
+      StreamConfig streamConfig = new StreamConfig(tableConfig.getIndexingConfig().getStreamConfigs());
+      return streamConfig.hasHighLevelConsumerType();
+    }
+    return true;
+  }
+
+  /**
+   * Decides if {@link SegmentsValidationAndRetentionConfig::getReplicasPerPartitionNumber} should be used
+   */
+  public static boolean useReplicasPerPartition(TableConfig tableConfig) {
 
 Review comment:
   Unrelated to this PR but.. do you know the reason why we added `ReplicasPerPartition`? Was it necessary to add? It would have been much clear if realtime/offline table use the same field for replication.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org