diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 96928db..941fbfa 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -3144,10 +3144,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 113aa49..30dead8 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 @@ -34,7 +34,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) { @@ -51,24 +52,24 @@ public static SplitLocationProvider getSplitLocationProvider(Configuration conf, } locations.add(serviceInstance.getHost()); } - splitLocationProvider = new HostAffinitySplitLocationProvider(locations); - } else { - splitLocationProvider = new SplitLocationProvider() { - @Override - public String[] getLocations(InputSplit split) throws IOException { - if (split == null) { - return null; - } - String[] locations = split.getLocations(); - if (locations != null && locations.length == 1) { - if ("localhost".equals(locations[0])) { - return ArrayUtils.EMPTY_STRING_ARRAY; - } + return new HostAffinitySplitLocationProvider(locations); + } + + splitLocationProvider = new SplitLocationProvider() { + @Override + public String[] getLocations(InputSplit split) throws IOException { + if (split == null) { + return null; + } + String[] locations = split.getLocations(); + if (locations != null && locations.length == 1) { + if ("localhost".equals(locations[0])) { + return ArrayUtils.EMPTY_STRING_ARRAY; } - return locations; } - }; - } + return locations; + } + }; return splitLocationProvider; } }