diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 0bff243..24cd728 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -3162,10 +3162,11 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal "llap.daemon.service.port"), LLAP_DAEMON_WEB_SSL("hive.llap.daemon.web.ssl", false, "Whether LLAP daemon web UI should use SSL.", "llap.daemon.service.ssl"), - LLAP_CLIENT_CONSISTENT_SPLITS("hive.llap.client.consistent.splits", - false, - "Whether to setup split locations to match nodes on which llap daemons are running," + - " instead of using the locations provided by the split itself"), + LLAP_CLIENT_CONSISTENT_SPLITS("hive.llap.client.consistent.splits", false, + "Whether to setup split locations to match nodes on which llap daemons are running, " + + "instead of using the locations provided by the split itself. If there is no llap daemon " + + "running, fall back to locations provided by the split. This is effective only if " + + "hive.execution.mode is llap"), LLAP_VALIDATE_ACLS("hive.llap.validate.acls", true, "Whether LLAP should reject permissive ACLs in some cases (e.g. its own management\n" + "protocol or ZK paths), similar to how ssh refuses a key with bad access permissions."), diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java index d691e18..2b57d90 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collection; +import com.google.common.base.Preconditions; import org.apache.commons.lang.ArrayUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.conf.HiveConf; @@ -34,7 +35,8 @@ public static SplitLocationProvider getSplitLocationProvider(Configuration conf, Logger LOG) throws IOException { boolean useCustomLocations = - HiveConf.getBoolVar(conf, HiveConf.ConfVars.LLAP_CLIENT_CONSISTENT_SPLITS); + HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_EXECUTION_MODE).equals("llap") + && HiveConf.getBoolVar(conf, HiveConf.ConfVars.LLAP_CLIENT_CONSISTENT_SPLITS); SplitLocationProvider splitLocationProvider; LOG.info("SplitGenerator using llap affinitized locations: " + useCustomLocations); if (useCustomLocations) { @@ -43,6 +45,8 @@ public static SplitLocationProvider getSplitLocationProvider(Configuration conf, Collection serviceInstances = serviceRegistry.getInstances().getAllInstancesOrdered(true); + Preconditions.checkArgument(!serviceInstances.isEmpty(), + "No running LLAP daemons! Please check LLAP service status and zookeeper configuration"); ArrayList locations = new ArrayList<>(serviceInstances.size()); for (ServiceInstance serviceInstance : serviceInstances) { if (LOG.isDebugEnabled()) {