falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject falcon git commit: FALCON-1551 Implement setWorkingDir Method in JailedFileSystem(Pavan Kolamuri)
Date Wed, 21 Oct 2015 05:54:40 GMT
Repository: falcon
Updated Branches:
  refs/heads/0.8 f6899706d -> 432f8b0d7


FALCON-1551 Implement setWorkingDir Method in JailedFileSystem(Pavan Kolamuri)


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/432f8b0d
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/432f8b0d
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/432f8b0d

Branch: refs/heads/0.8
Commit: 432f8b0d7588a6d9afd24b091f49588a95a31792
Parents: f689970
Author: Pallavi Rao <pallavi.rao@inmobi.com>
Authored: Wed Oct 21 10:18:25 2015 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Wed Oct 21 10:18:25 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                          |  2 ++
 .../org/apache/falcon/hadoop/JailedFileSystem.java   | 15 +++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/432f8b0d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index bc4fdf5..5d6b994 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -69,6 +69,8 @@ Trunk (Unreleased)
     FALCON-1403 Revisit IT cleanup and teardown(Narayan Periwal via Pallavi Rao)
 
   BUG FIXES
+    FALCON-1551 Implement setWorkingDir Method in JailedFileSystem(Pavan Kolamuri via Pallavi
Rao)
+
     FALCON-1541 Bundle deploy.properties while packaging falcon (Pragya Mittal via Pallavi
Rao)
 
     FALCON-1530 SLAMonitoring API is not honouring delete feature(Ajay Yadava).

http://git-wip-us.apache.org/repos/asf/falcon/blob/432f8b0d/hadoop-dependencies/src/main/java/org/apache/falcon/hadoop/JailedFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-dependencies/src/main/java/org/apache/falcon/hadoop/JailedFileSystem.java
b/hadoop-dependencies/src/main/java/org/apache/falcon/hadoop/JailedFileSystem.java
index d5b2eb3..27b5a9e 100644
--- a/hadoop-dependencies/src/main/java/org/apache/falcon/hadoop/JailedFileSystem.java
+++ b/hadoop-dependencies/src/main/java/org/apache/falcon/hadoop/JailedFileSystem.java
@@ -43,9 +43,11 @@ public class JailedFileSystem extends FileSystem {
     private URI uri;
     private String basePath;
     private LocalFileSystem localFS;
+    private Path workingDir;
 
     public JailedFileSystem() {
         localFS = new LocalFileSystem();
+        this.workingDir = new Path("/user", System.getProperty("user.name"));
     }
 
     @Override
@@ -128,12 +130,21 @@ public class JailedFileSystem extends FileSystem {
 
     @Override
     public void setWorkingDirectory(Path newDir) {
-        throw new UnsupportedOperationException();
+        if (newDir != null) {
+            workingDir = makeAbsolute(newDir);
+        }
+    }
+
+    private Path makeAbsolute(Path path) {
+        if (path.isAbsolute()) {
+            return path;
+        }
+        return new Path(workingDir, path);
     }
 
     @Override
     public Path getWorkingDirectory() {
-        return new Path("/user/" + System.getProperty("user.name"));
+        return workingDir;
     }
 
     @Override


Mime
View raw message