drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudheeshkatkam <...@git.apache.org>
Subject [GitHub] drill pull request #626: DRILL-4560 - ZKClusterCoordinator fix
Date Thu, 20 Oct 2016 21:35:22 GMT
Github user sudheeshkatkam commented on a diff in the pull request:

    https://github.com/apache/drill/pull/626#discussion_r84380547
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/coord/zk/ZKClusterCoordinator.java
---
    @@ -231,31 +235,42 @@ public DrillbitEndpoint apply(ServiceInstance<DrillbitEndpoint>
input) {
           Set<DrillbitEndpoint> unregisteredBits = new HashSet<>(endpoints);
           unregisteredBits.removeAll(newDrillbitSet);
     
    +      // Set of newly live bits : new set of active bits - original bits.
    +      Set<DrillbitEndpoint> registeredBits = new HashSet<>(newDrillbitSet);
    +      registeredBits.removeAll(endpoints);
    +
           endpoints = newDrillbitSet;
     
           if (logger.isDebugEnabled()) {
             StringBuilder builder = new StringBuilder();
             builder.append("Active drillbit set changed.  Now includes ");
             builder.append(newDrillbitSet.size());
    -        builder.append(" total bits.  New active drillbits: \n");
    -        for (DrillbitEndpoint bit: newDrillbitSet) {
    -          builder.append('\t');
    -          builder.append(bit.getAddress());
    -          builder.append(':');
    -          builder.append(bit.getUserPort());
    -          builder.append(':');
    -          builder.append(bit.getControlPort());
    -          builder.append(':');
    -          builder.append(bit.getDataPort());
    -          builder.append('\n');
    +        builder.append(" total bits.");
    +        if (!newDrillbitSet.isEmpty()) {
    +          builder.append(" New active drillbits: \n");
    +          for (DrillbitEndpoint bit: newDrillbitSet) {
    +            builder.append('\t');
    +            builder.append(bit.getAddress());
    +            builder.append(':');
    +            builder.append(bit.getUserPort());
    +            builder.append(':');
    +            builder.append(bit.getControlPort());
    +            builder.append(':');
    +            builder.append(bit.getDataPort());
    +            builder.append('\n');
    +          }
    +          logger.debug(builder.toString());
             }
    -        logger.debug(builder.toString());
           }
     
    -      // Notify the drillbit listener for newly unregistered bits. For now, we only care
when drillbits are down / unregistered.
    -      if (! (unregisteredBits.isEmpty()) ) {
    +      // Notify the drillbit listener for newly unregistered bits.
    +      if (!(unregisteredBits.isEmpty())) {
             drillbitUnregistered(unregisteredBits);
           }
    +      // Notify the drillbit listener for newly registered bits.
    +      if (!(registeredBits.isEmpty())) {
    +        drillbitRegistered(registeredBits);
    --- End diff --
    
    Are all callbacks empty blocks?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message