You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@helix.apache.org by GitBox <gi...@apache.org> on 2019/07/20 02:42:49 UTC

[GitHub] [helix] lei-xia commented on a change in pull request #346: Unwanted logs have been removed.

lei-xia commented on a change in pull request #346: Unwanted logs have been removed.
URL: https://github.com/apache/helix/pull/346#discussion_r305564620
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
 ##########
 @@ -241,38 +241,28 @@ private boolean computeResourceBestPossibleState(ClusterEvent event, ResourceCon
       try {
         HelixManager manager = event.getAttribute(AttributeName.helixmanager.name());
         rebalancer.init(manager);
-        idealState =
-            rebalancer.computeNewIdealState(resourceName, idealState, currentStateOutput, cache);
+        idealState = rebalancer.computeNewIdealState(resourceName, idealState, currentStateOutput, cache);
 
         output.setPreferenceLists(resourceName, idealState.getPreferenceLists());
 
         // Use the internal MappingCalculator interface to compute the final assignment
         // The next release will support rebalancers that compute the mapping from start to finish
-        partitionStateAssignment = mappingCalculator
-            .computeBestPossiblePartitionState(cache, idealState, resource, currentStateOutput);
+        partitionStateAssignment =
+            mappingCalculator.computeBestPossiblePartitionState(cache, idealState, resource, currentStateOutput);
         for (Partition partition : resource.getPartitions()) {
           Map<String, String> newStateMap = partitionStateAssignment.getReplicaMap(partition);
           output.setState(resourceName, partition, newStateMap);
         }
 
         // Check if calculation is done successfully
         return checkBestPossibleStateCalculation(idealState);
+      } catch (HelixException e){
+        // No eligible instance is found.
+        LogUtil
+            .logError(logger, _eventId, e.getMessage());
       } catch (Exception e) {
         LogUtil
             .logError(logger, _eventId, "Error computing assignment for resource " + resourceName + ". Skipping.", e);
-        // TODO : remove this part after debugging NPE
-        StringBuilder sb = new StringBuilder();
 
 Review comment:
   @dasahcc: Can you confirm this part can be safely 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:
users@infra.apache.org


With regards,
Apache Git Services