ankitsultana commented on code in PR #10455:
URL: https://github.com/apache/pinot/pull/10455#discussion_r1145180705


##########
pinot-core/src/main/java/org/apache/pinot/core/routing/RoutingTable.java:
##########
@@ -25,16 +25,37 @@
 
 public class RoutingTable {
   private final Map<ServerInstance, List<String>> _serverInstanceToSegmentsMap;
+  private final Map<ServerInstance, Map<Integer, List<String>>> 
_serverInstanceToPartitionedSegmentsMap;
   private final List<String> _unavailableSegments;
   private final int _numPrunedSegments;
+  private final boolean _isPartitionRouting;
 
-  public RoutingTable(Map<ServerInstance, List<String>> 
serverInstanceToSegmentsMap, List<String> unavailableSegments,
-      int numPrunedSegments) {
+  public RoutingTable(Map<ServerInstance, List<String>> 
serverInstanceToSegmentsMap,
+      List<String> unavailableSegments, int numPrunedSegments) {
     _serverInstanceToSegmentsMap = serverInstanceToSegmentsMap;
+    _serverInstanceToPartitionedSegmentsMap = null;
+    _isPartitionRouting = false;
     _unavailableSegments = unavailableSegments;
     _numPrunedSegments = numPrunedSegments;
   }
 
+  public RoutingTable(Map<ServerInstance, Map<Integer, List<String>>> 
serverInstanceToPartitionedSegmentsMap,
+      List<String> unavailableSegments, int numPrunedSegments, boolean 
isPartitionRouting) {
+    _serverInstanceToPartitionedSegmentsMap = 
serverInstanceToPartitionedSegmentsMap;
+    _serverInstanceToSegmentsMap = null;
+    _isPartitionRouting = isPartitionRouting;
+    _unavailableSegments = unavailableSegments;
+    _numPrunedSegments = numPrunedSegments;
+  }
+
+  public boolean isPartitionRouting() {
+    return _isPartitionRouting;
+  }
+
+  public Map<ServerInstance, Map<Integer, List<String>>> 
getServerInstanceToPartitionedSegmentsMap() {

Review Comment:
   `@Nullable`.



##########
pinot-core/src/main/java/org/apache/pinot/core/routing/RoutingTable.java:
##########
@@ -25,16 +25,37 @@
 
 public class RoutingTable {
   private final Map<ServerInstance, List<String>> _serverInstanceToSegmentsMap;
+  private final Map<ServerInstance, Map<Integer, List<String>>> 
_serverInstanceToPartitionedSegmentsMap;
   private final List<String> _unavailableSegments;
   private final int _numPrunedSegments;
+  private final boolean _isPartitionRouting;
 
-  public RoutingTable(Map<ServerInstance, List<String>> 
serverInstanceToSegmentsMap, List<String> unavailableSegments,
-      int numPrunedSegments) {
+  public RoutingTable(Map<ServerInstance, List<String>> 
serverInstanceToSegmentsMap,

Review Comment:
   Should we add a `PartitionRoutingTable` which extends this? One advantage of 
that is we can have added type-safety to ensure the right version of the 
routing table is passed around.



##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/segmentmetadata/SegmentZkMetadataCache.java:
##########
@@ -0,0 +1,105 @@
+/**
+ * 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.broker.routing.segmentmetadata;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.helix.AccessOption;
+import org.apache.helix.model.ExternalView;
+import org.apache.helix.model.IdealState;
+import org.apache.helix.store.zk.ZkHelixPropertyStore;
+import org.apache.helix.zookeeper.datamodel.ZNRecord;
+import org.apache.pinot.broker.routing.segmentpruner.SegmentPruner;
+import org.apache.pinot.common.metadata.ZKMetadataProvider;
+
+
+/**
+ *

Review Comment:
   javadoc



##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java:
##########
@@ -105,6 +106,8 @@ public class BrokerRoutingManager implements 
RoutingManager, ClusterChangeHandle
   private String _idealStatePathPrefix;
   private String _instanceConfigsPath;
   private ZkHelixPropertyStore<ZNRecord> _propertyStore;
+  // TODO: Entries are never removed from map
+  private Map<String, SegmentZkMetadataCache> _segmentMetadataCacheMap;

Review Comment:
   I can't see where we are adding entries to this map. Is this map needed?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to