From 149b903be30e2b973691c30ee02f0d5b53ca0abc Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Tue, 9 May 2017 10:27:17 -0700 Subject: [PATCH] HADOOP-14384. Reduce the visibility of FileSystem.newFSDataOutputStreamBuilder before the API becomes stable. (lei) --- .../org/apache/hadoop/fs/FSDataOutputStreamBuilder.java | 8 ++++++-- .../src/main/java/org/apache/hadoop/fs/FileSystem.java | 6 +++++- .../main/java/org/apache/hadoop/fs/FilterFileSystem.java | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataOutputStreamBuilder.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataOutputStreamBuilder.java index 2e885f3460c..55836cc2347 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataOutputStreamBuilder.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataOutputStreamBuilder.java @@ -18,6 +18,8 @@ package org.apache.hadoop.fs; import com.google.common.base.Preconditions; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.fs.Options.ChecksumOpt; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; @@ -29,7 +31,9 @@ import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.IO_FILE_BUFFER_ import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_KEY; /** Base of specific file system FSDataOutputStreamBuilder. */ -public class FSDataOutputStreamBuilder{ +@InterfaceAudience.Private +@InterfaceStability.Unstable +public class FSDataOutputStreamBuilder { private Path path = null; private FsPermission permission = null; private Integer bufferSize; @@ -41,7 +45,7 @@ public class FSDataOutputStreamBuilder{ private final FileSystem fs; - public FSDataOutputStreamBuilder(FileSystem fileSystem, Path p) { + protected FSDataOutputStreamBuilder(FileSystem fileSystem, Path p) { fs = fileSystem; path = p; } diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java index 29da214f962..1907475df2b 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java @@ -4144,8 +4144,12 @@ public abstract class FileSystem extends Configured implements Closeable { * Create a new FSDataOutputStreamBuilder for the file with path. * @param path file path * @return a FSDataOutputStreamBuilder object to build the file + * + * HADOOP-14384. Temporarily reduce the visibility of method before the + * builder interface becomes stable. */ - public FSDataOutputStreamBuilder newFSDataOutputStreamBuilder(Path path) { + @InterfaceAudience.Private + protected FSDataOutputStreamBuilder newFSDataOutputStreamBuilder(Path path) { return new FSDataOutputStreamBuilder(this, path); } } diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java index ef0945896ef..3466922b6cb 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java @@ -667,7 +667,7 @@ public class FilterFileSystem extends FileSystem { } @Override - public FSDataOutputStreamBuilder newFSDataOutputStreamBuilder(Path path) { + protected FSDataOutputStreamBuilder newFSDataOutputStreamBuilder(Path path) { return fs.newFSDataOutputStreamBuilder(path); } }