|
85 | 85 | import org.apache.hadoop.hive.ql.session.SessionState;
|
86 | 86 | import org.apache.hadoop.hive.ql.session.SessionState.LogHelper;
|
87 | 87 | import org.apache.hadoop.hive.serde2.ByteStream;
|
| 88 | +import org.apache.hadoop.hive.shims.ShimLoader; |
88 | 89 | import org.apache.hadoop.mapred.ClusterStatus;
|
89 | 90 | import org.apache.hadoop.mapred.JobClient;
|
90 | 91 | import org.apache.hadoop.mapred.JobConf;
|
91 |
| -import org.apache.hadoop.security.UnixUserGroupInformation; |
92 | 92 | import org.apache.hadoop.util.ReflectionUtils;
|
93 | 93 |
|
94 | 94 | public class Driver implements CommandProcessor {
|
@@ -285,21 +285,11 @@ public boolean hasReduceTasks(List<Task<? extends Serializable>> tasks) {
|
285 | 285 | */
|
286 | 286 | public Driver(HiveConf conf) {
|
287 | 287 | this.conf = conf;
|
288 |
| - try { |
289 |
| - UnixUserGroupInformation.login(conf, true); |
290 |
| - } catch (Exception e) { |
291 |
| - LOG.warn("Ignoring " + e.getMessage()); |
292 |
| - } |
293 | 288 | }
|
294 | 289 |
|
295 | 290 | public Driver() {
|
296 | 291 | if (SessionState.get() != null) {
|
297 | 292 | conf = SessionState.get().getConf();
|
298 |
| - try { |
299 |
| - UnixUserGroupInformation.login(conf, true); |
300 |
| - } catch (Exception e) { |
301 |
| - LOG.warn("Ignoring " + e.getMessage()); |
302 |
| - } |
303 | 293 | }
|
304 | 294 | }
|
305 | 295 |
|
@@ -739,8 +729,7 @@ public int execute() {
|
739 | 729 | // Get all the pre execution hooks and execute them.
|
740 | 730 | for (PreExecute peh : getPreExecHooks()) {
|
741 | 731 | peh.run(SessionState.get(), plan.getInputs(), plan.getOutputs(),
|
742 |
| - UnixUserGroupInformation.readFromConf(conf, |
743 |
| - UnixUserGroupInformation.UGI_PROPERTY_NAME)); |
| 732 | + ShimLoader.getHadoopShims().getUGIForConf(conf)); |
744 | 733 | }
|
745 | 734 |
|
746 | 735 | int jobs = Utilities.getMRTasks(plan.getRootTasks()).size();
|
@@ -822,8 +811,7 @@ public int execute() {
|
822 | 811 | for (PostExecute peh : getPostExecHooks()) {
|
823 | 812 | peh.run(SessionState.get(), plan.getInputs(), plan.getOutputs(),
|
824 | 813 | (SessionState.get() != null ? SessionState.get().getLineageState().getLineageInfo() : null),
|
825 |
| - UnixUserGroupInformation.readFromConf(conf, |
826 |
| - UnixUserGroupInformation.UGI_PROPERTY_NAME)); |
| 814 | + ShimLoader.getHadoopShims().getUGIForConf(conf)); |
827 | 815 | }
|
828 | 816 |
|
829 | 817 | if (SessionState.get() != null) {
|
|
0 commit comments