15 package com.cloudera.impala.analysis;
17 import java.io.IOException;
19 import org.apache.hadoop.fs.FileSystem;
20 import org.apache.hadoop.fs.Path;
21 import org.apache.hadoop.fs.permission.FsAction;
29 import com.google.common.base.Preconditions;
41 Preconditions.checkNotNull(location);
42 this.location_ = location.trim();
46 Preconditions.checkNotNull(
uriPath_);
52 analyze(analyzer, privilege, FsAction.NONE,
true);
57 analyze(analyzer, privilege, perm,
true);
62 analyze(analyzer, privilege, FsAction.NONE, registerPrivReq);
85 Path parentPath = uriPath_.getParent();
87 FileSystem fs = uriPath_.getFileSystem(FileSystemUtil.getConfiguration());
88 StringBuilder errorMsg =
new StringBuilder();
90 analyzer.addWarning(String.format(
"Path '%s' cannot be reached: %s",
91 parentPath, errorMsg.toString()));
92 }
else if (perm != FsAction.NONE) {
94 if (!checker.
getPermissions(fs, parentPath).checkPermissions(perm)) {
95 analyzer.addWarning(String.format(
96 "Impala does not have %s access to path '%s'",
97 perm.toString(), parentPath));
100 }
catch (IOException e) {
104 if (registerPrivReq) {
void analyze(Analyzer analyzer, Privilege privilege, FsAction perm, boolean registerPrivReq)
void analyze(Analyzer analyzer, Privilege privilege)
Permissions getPermissions(FileSystem fs, Path path)
void analyze(Analyzer analyzer, Privilege privilege, FsAction perm)
void analyze(Analyzer analyzer, Privilege privilege, boolean registerPrivReq)
static Boolean isPathReachable(Path path, FileSystem fs, StringBuilder error_msg)