This is an automated email from the ASF dual-hosted git repository. weichiu pushed a commit to branch branch-3.1 in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.1 by this push: new bb10157 HDFS-14850. Optimize FileSystemAccessService#getFileSystemConfiguration. Contributed by Lisheng Sun. bb10157 is described below commit bb1015719c442b939d226093e6618b8879190f76 Author: Inigo Goiri <inigo...@apache.org> AuthorDate: Sat Sep 28 17:20:44 2019 -0700 HDFS-14850. Optimize FileSystemAccessService#getFileSystemConfiguration. Contributed by Lisheng Sun. (cherry picked from commit d8313b227495d748abe8884eee34db507476cee1) --- .../lib/service/hadoop/FileSystemAccessService.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/service/hadoop/FileSystemAccessService.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/service/hadoop/FileSystemAccessService.java index 61d3b45..b2bba08 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/service/hadoop/FileSystemAccessService.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/service/hadoop/FileSystemAccessService.java @@ -136,6 +136,7 @@ public class FileSystemAccessService extends BaseService implements FileSystemAc private Collection<String> nameNodeWhitelist; Configuration serviceHadoopConf; + private Configuration fileSystemConf; private AtomicInteger unmanagedFileSystems = new AtomicInteger(); @@ -188,6 +189,7 @@ public class FileSystemAccessService extends BaseService implements FileSystemAc } try { serviceHadoopConf = loadHadoopConf(hadoopConfDir); + fileSystemConf = getNewFileSystemConfiguration(); } catch (IOException ex) { throw new ServiceException(FileSystemAccessException.ERROR.H11, ex.toString(), ex); } @@ -212,6 +214,16 @@ public class FileSystemAccessService extends BaseService implements FileSystemAc return hadoopConf; } + private Configuration getNewFileSystemConfiguration() { + Configuration conf = new Configuration(true); + ConfigurationUtils.copy(serviceHadoopConf, conf); + conf.setBoolean(FILE_SYSTEM_SERVICE_CREATED, true); + + // Force-clear server-side umask to make HttpFS match WebHDFS behavior + conf.set(FsPermission.UMASK_LABEL, "000"); + return conf; + } + @Override public void postInit() throws ServiceException { super.postInit(); @@ -397,14 +409,7 @@ public class FileSystemAccessService extends BaseService implements FileSystemAc @Override public Configuration getFileSystemConfiguration() { - Configuration conf = new Configuration(true); - ConfigurationUtils.copy(serviceHadoopConf, conf); - conf.setBoolean(FILE_SYSTEM_SERVICE_CREATED, true); - - // Force-clear server-side umask to make HttpFS match WebHDFS behavior - conf.set(FsPermission.UMASK_LABEL, "000"); - - return conf; + return fileSystemConf; } } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org