|
@@ -102,6 +102,8 @@ import com.google.common.base.Preconditions;
|
|
|
public class DistributedFileSystem extends FileSystem {
|
|
|
private Path workingDir;
|
|
|
private URI uri;
|
|
|
+ private String homeDirPrefix =
|
|
|
+ DFSConfigKeys.DFS_USER_HOME_DIR_PREFIX_DEFAULT;
|
|
|
|
|
|
DFSClient dfs;
|
|
|
private boolean verifyChecksum = true;
|
|
@@ -136,7 +138,10 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
if (host == null) {
|
|
|
throw new IOException("Incomplete HDFS URI, no host: "+ uri);
|
|
|
}
|
|
|
-
|
|
|
+ homeDirPrefix = conf.get(
|
|
|
+ DFSConfigKeys.DFS_USER_HOME_DIR_PREFIX_KEY,
|
|
|
+ DFSConfigKeys.DFS_USER_HOME_DIR_PREFIX_DEFAULT);
|
|
|
+
|
|
|
this.dfs = new DFSClient(uri, conf, statistics);
|
|
|
this.uri = URI.create(uri.getScheme()+"://"+uri.getAuthority());
|
|
|
this.workingDir = getHomeDirectory();
|
|
@@ -167,10 +172,10 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
workingDir = fixRelativePart(dir);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public Path getHomeDirectory() {
|
|
|
- return makeQualified(new Path("/user/" + dfs.ugi.getShortUserName()));
|
|
|
+ return makeQualified(new Path(homeDirPrefix + "/"
|
|
|
+ + dfs.ugi.getShortUserName()));
|
|
|
}
|
|
|
|
|
|
/**
|