diff --git a/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java b/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java index d11bf1326c..48501e5e39 100644 --- a/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java +++ b/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java @@ -296,6 +296,7 @@ public void setError(Void v, Throwable t) { private int totalGuaranteed = 0, unusedGuaranteed = 0; + private final boolean consistentSplits; /** * An internal version to make sure we don't race and overwrite a newer totalGuaranteed count in * ZK with an older one, without requiring us to make ZK updates under the main writeLock. @@ -345,6 +346,7 @@ public LlapTaskSchedulerService(TaskSchedulerContext taskSchedulerContext, Clock LOCK_METRICS); readLock = lock.readLock(); writeLock = lock.writeLock(); + this.consistentSplits = HiveConf.getBoolVar(conf, ConfVars.LLAP_CLIENT_CONSISTENT_SPLITS); if (conf.getBoolean(LLAP_PLUGIN_ENDPOINT_ENABLED, false)) { JobTokenSecretManager sm = null; @@ -444,8 +446,8 @@ public LlapTaskSchedulerService(TaskSchedulerContext taskSchedulerContext, Clock String hostsString = HiveConf.getVar(conf, ConfVars.LLAP_DAEMON_SERVICE_HOSTS); LOG.info("Running with configuration: hosts={}, numSchedulableTasksPerNode={}, " - + "nodeBlacklistConf={}, localityConf={}", - hostsString, numSchedulableTasksPerNode, nodeBlacklistConf, localityDelayConf); + + "nodeBlacklistConf={}, localityConf={} consistentSplits={}", + hostsString, numSchedulableTasksPerNode, nodeBlacklistConf, localityDelayConf, consistentSplits); this.amRegistry = TezAmRegistryImpl.create(conf, true); synchronized (LlapTaskCommunicator.pluginInitLock) { @@ -1476,7 +1478,13 @@ private SelectHostResult selectHost(TaskInfo request) { } /* fall through - miss in locality or no locality-requested */ - Collection instances = activeInstances.getAllInstancesOrdered(true); + Collection instances; + if (consistentSplits) { + instances = activeInstances.getAllInstancesOrdered(true); + } else { + // if consistent splits are not used we don't need the ordering as there will be no cache benefit anyways + instances = activeInstances.getAll(); + } List allNodes = new ArrayList<>(instances.size()); List activeNodesWithFreeSlots = new ArrayList<>(); for (LlapServiceInstance inst : instances) {