Index: llap-ext-client/src/java/org/apache/hadoop/hive/llap/LlapBaseInputFormat.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- llap-ext-client/src/java/org/apache/hadoop/hive/llap/LlapBaseInputFormat.java (revision 90d236affcb19b52ca66029e6646c5d751dc5f02) +++ llap-ext-client/src/java/org/apache/hadoop/hive/llap/LlapBaseInputFormat.java (revision 3f04cb86dcc5be16a675b3745384f29174ffac52) @@ -373,7 +373,6 @@ return serviceInstance; } - private LlapServiceInstance getServiceInstanceRandom(LlapRegistryService registryService) throws IOException { LlapServiceInstanceSet instanceSet = registryService.getInstances(); LlapServiceInstance serviceInstance = null; @@ -381,7 +380,7 @@ LOG.info("Finding random live service instance"); Collection allInstances = instanceSet.getAll(); if (allInstances.size() > 0) { - int randIdx = rand.nextInt() % allInstances.size(); + int randIdx = rand.nextInt(allInstances.size()); serviceInstance = allInstances.toArray(serviceInstanceArray)[randIdx]; } return serviceInstance;