cbalci commented on a change in pull request #6530:
URL: https://github.com/apache/incubator-pinot/pull/6530#discussion_r569116464



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/OfflineDimTableSegmentAssignment.java
##########
@@ -68,21 +70,24 @@ public void init(HelixManager helixManager, TableConfig 
tableConfig) {
   @Override
   public List<String> assignSegment(String segmentName, Map<String, 
Map<String, String>> currentAssignment,
       Map<InstancePartitionsType, InstancePartitions> instancePartitionsMap) {
-    String serverTag = TagNameUtils.extractOfflineServerTag(_tenantConfig);
+    String serverTag = _tenantConfig.getServer();
+    Set<String> instances = 
HelixHelper.getServerInstancesForTenant(_helixManager, serverTag);
 
-    List<String> instances = HelixHelper.getInstancesWithTag(_helixManager, 
serverTag);
     int numInstances = instances.size();
-    Preconditions.checkState(numInstances > 0, "No instance found with tag: 
%s", serverTag);
+    Preconditions.checkState(numInstances > 0, "No instance found with tag: %s 
or %s",
+        TagNameUtils.getOfflineTagForTenant(serverTag),
+        TagNameUtils.getRealtimeTagForTenant(serverTag));
 
-    return instances;
+    return new ArrayList<>(instances);
   }
 
   @Override
   public Map<String, Map<String, String>> rebalanceTable(Map<String, 
Map<String, String>> currentAssignment,
       Map<InstancePartitionsType, InstancePartitions> instancePartitionsMap, 
@Nullable List<Tier> sortedTiers,
       @Nullable Map<String, InstancePartitions> tierInstancePartitionsMap, 
Configuration config) {
-    String serverTag = TagNameUtils.extractOfflineServerTag(_tenantConfig);
-    List<String> instances = HelixHelper.getInstancesWithTag(_helixManager, 
serverTag);
+

Review comment:
       Removed.




----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to