flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject flink git commit: [FLINK-1609] FileSystem.getHomeDirectory()
Date Wed, 25 Feb 2015 10:38:22 GMT
Repository: flink
Updated Branches:
  refs/heads/master 639cd1c32 -> 649334a69


[FLINK-1609] FileSystem.getHomeDirectory()

This closes #438.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/649334a6
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/649334a6
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/649334a6

Branch: refs/heads/master
Commit: 649334a69e50d638224bc23c8e240c063eee1476
Parents: 639cd1c
Author: zentol <s.motsu@web.de>
Authored: Wed Feb 25 08:35:42 2015 +0100
Committer: Ufuk Celebi <uce@apache.org>
Committed: Wed Feb 25 11:38:03 2015 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/flink/core/fs/FileSystem.java    | 7 +++++++
 .../java/org/apache/flink/core/fs/local/LocalFileSystem.java  | 4 ++++
 .../org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java    | 4 ++++
 .../org/apache/flink/runtime/fs/maprfs/MapRFileSystem.java    | 4 ++++
 .../java/org/apache/flink/runtime/fs/s3/S3FileSystem.java     | 3 +++
 5 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/649334a6/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java b/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
index 3cfb75f..7e8c667 100644
--- a/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
+++ b/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
@@ -321,6 +321,13 @@ public abstract class FileSystem {
 	public abstract Path getWorkingDirectory();
 
 	/**
+	 * Returns the path of the user's home directory in this file system.
+	 *
+	 * @return the path of the user's home directory in this file system.
+	 */
+	public abstract Path getHomeDirectory();
+
+	/**
 	 * Returns a URI whose scheme and authority identify this file system.
 	 * 
 	 * @return a URI whose scheme and authority identify this file system

http://git-wip-us.apache.org/repos/asf/flink/blob/649334a6/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
b/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
index d4b570a..2313a41 100644
--- a/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
+++ b/flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
@@ -120,6 +120,10 @@ public class LocalFileSystem extends FileSystem {
 		return workingDir;
 	}
 
+	@Override
+	public Path getHomeDirectory() {
+		return new Path(System.getProperty("user.home"));
+	}
 
 	@Override
 	public void initialize(final URI name) throws IOException {	}

http://git-wip-us.apache.org/repos/asf/flink/blob/649334a6/flink-runtime/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java
index 1a79f23..f3ca404 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java
@@ -255,6 +255,10 @@ public final class HadoopFileSystem extends FileSystem implements HadoopFileSyst
 		return new Path(this.fs.getWorkingDirectory().toUri());
 	}
 
+	public Path getHomeDirectory() {
+		return new Path(this.fs.getHomeDirectory().toUri());
+	}
+
 	@Override
 	public URI getUri() {
 		return fs.getUri();

http://git-wip-us.apache.org/repos/asf/flink/blob/649334a6/flink-runtime/src/main/java/org/apache/flink/runtime/fs/maprfs/MapRFileSystem.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/fs/maprfs/MapRFileSystem.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/fs/maprfs/MapRFileSystem.java
index 41bbaca..a7ef441 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/fs/maprfs/MapRFileSystem.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/fs/maprfs/MapRFileSystem.java
@@ -124,6 +124,10 @@ public final class MapRFileSystem extends FileSystem {
 		return new Path(this.fs.getWorkingDirectory().toUri());
 	}
 
+	public Path getHomeDirectory() {
+		return new Path(this.fs.getHomeDirectory().toUri());
+	}
+
 	@Override
 	public URI getUri() {
 

http://git-wip-us.apache.org/repos/asf/flink/blob/649334a6/flink-runtime/src/main/java/org/apache/flink/runtime/fs/s3/S3FileSystem.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/fs/s3/S3FileSystem.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/fs/s3/S3FileSystem.java
index 603b53a..d3eb0e2 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/fs/s3/S3FileSystem.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/fs/s3/S3FileSystem.java
@@ -160,6 +160,9 @@ public final class S3FileSystem extends FileSystem {
 		return new Path(this.s3Uri);
 	}
 
+	public Path getHomeDirectory() {
+		return new Path(this.s3Uri);
+	}
 
 	@Override
 	public URI getUri() {


Mime
View raw message