drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sohami <...@git.apache.org>
Subject [GitHub] drill pull request #648: DRILL-5015: Randomly select the drillbit from the l...
Date Thu, 10 Nov 2016 09:02:20 GMT
Github user sohami commented on a diff in the pull request:

    https://github.com/apache/drill/pull/648#discussion_r87351670
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java ---
    @@ -245,14 +291,15 @@ public synchronized void connect(String connect, Properties props)
throws RpcExc
               throw new RpcException("Failure setting up ZK for client.", e);
             }
           }
    -
    -      final ArrayList<DrillbitEndpoint> endpoints = new ArrayList<>(clusterCoordinator.getAvailableEndpoints());
    -      checkState(!endpoints.isEmpty(), "No DrillbitEndpoint can be found");
    -      // shuffle the collection then get the first endpoint
    -      Collections.shuffle(endpoints);
    -      endpoint = endpoints.iterator().next();
    +      endpoints.addAll(clusterCoordinator.getAvailableEndpoints());
         }
     
    +    // Make sure we have at least one endpoint in the list
    +    checkState(!endpoints.isEmpty(), "No DrillbitEndpoint can be found");
    --- End diff --
    
    Moved checkstate inside the else condition and change the string to capture more information.
For if case we are throwing exception if there is no "drillbit" value passed in connection
string


---
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