Skip to content

Commit

Permalink
add npr guard
Browse files Browse the repository at this point in the history
  • Loading branch information
xyuanlu committed Oct 18, 2023
1 parent 38ac277 commit 839ca71
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ private static Set<String> getActiveNodes(Set<String> allNodes, Set<String> live

public static Set<String> filterOutEvacuatingInstances(Map<String, InstanceConfig> instanceConfigMap,
Set<String> nodes) {
return nodes.stream()
.filter(instance -> !instanceConfigMap.get(instance).getInstanceOperation().equals(
InstanceConstants.InstanceOperation.EVACUATE.name()))
return nodes.stream()
.filter(instance -> (instanceConfigMap.get(instance) != null && !instanceConfigMap.get(instance)
.getInstanceOperation()
.equals(InstanceConstants.InstanceOperation.EVACUATE.name())))
.collect(Collectors.toSet());
}

Expand Down

0 comments on commit 839ca71

Please sign in to comment.