Github user bitblender commented on a diff in the pull request:
https://github.com/apache/drill/pull/921#discussion_r148682167
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/coord/zk/ZKClusterCoordinator.java
---
@@ -229,27 +272,52 @@ public DrillbitEndpoint
apply(ServiceInstance<DrillbitEndpoint> input) {
});
// set of newly dead bits : original bits - new set of active bits.
- Set<DrillbitEndpoint> unregisteredBits = new HashSet<>(endpoints);
- unregisteredBits.removeAll(newDrillbitSet);
-
+ Set<DrillbitEndpoint> unregisteredBits = new HashSet<>();
// Set of newly live bits : new set of active bits - original bits.
- Set<DrillbitEndpoint> registeredBits = new HashSet<>(newDrillbitSet);
- registeredBits.removeAll(endpoints);
-
- endpoints = newDrillbitSet;
+ Set<DrillbitEndpoint> registeredBits = new HashSet<>();
+ // Update the endpoints map with change in state of the endpoint or
with the addition
--- End diff --
loop below does not handle change in state, so the comment should be
changed. Is the endpointsMap necessary because of port hunting ?
---