From 4e419b6ede3f529887a10f2bda937687b6638a10 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Wed, 29 Oct 2014 17:54:26 -0700 Subject: [PATCH] HADOOP-11247. Fix a couple javac warnings in NFS. Contributed by Brandon Li. (cherry picked from commit c7d1db7495e772ff81077b3865337838eded025a) Conflicts: hadoop-common-project/hadoop-common/CHANGES.txt --- hadoop-common-project/hadoop-common/CHANGES.txt | 1 + .../org/apache/hadoop/security/IdMappingConstant.java | 2 +- .../java/org/apache/hadoop/nfs/nfs3/Nfs3Constant.java | 8 -------- .../org/apache/hadoop/hdfs/nfs/conf/NfsConfiguration.java | 4 ++-- .../org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java | 2 +- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index e5bd5ec3fc4..63d266409d5 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -304,6 +304,7 @@ Release 2.6.0 - UNRELEASED HADOOP-11195. Move Id-Name mapping in NFS to the hadoop-common area for better maintenance (Yongjun Zhang via brandonli) + HADOOP-11247. Fix a couple javac warnings in NFS. (Brandon Li via wheat9) BUG FIXES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/IdMappingConstant.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/IdMappingConstant.java index f43556f9718..29664fbb233 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/IdMappingConstant.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/IdMappingConstant.java @@ -32,5 +32,5 @@ public class IdMappingConstant { // Used for finding the configured static mapping file. public static final String STATIC_ID_MAPPING_FILE_KEY = "static.id.mapping.file"; - public static final String STATIC_ID_MAPPING_FILE_DEFAULT = "/etc/usergroupid.map"; + public static final String STATIC_ID_MAPPING_FILE_DEFAULT = "/etc/nfs.map"; } diff --git a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Constant.java b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Constant.java index 8b269af5f4b..6ab6f6fe48b 100644 --- a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Constant.java +++ b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/Nfs3Constant.java @@ -193,12 +193,4 @@ public class Nfs3Constant { /** Expiration time for nfs exports cache entry */ public static final String NFS_EXPORTS_CACHE_EXPIRYTIME_MILLIS_KEY = "nfs.exports.cache.expirytime.millis"; public static final long NFS_EXPORTS_CACHE_EXPIRYTIME_MILLIS_DEFAULT = 15 * 60 * 1000; // 15 min - - @Deprecated - public final static String NFS_USERGROUP_UPDATE_MILLIS_KEY = "nfs.usergroup.update.millis"; - - // Used for finding the configured static mapping file. - @Deprecated - public static final String NFS_STATIC_MAPPING_FILE_KEY = "nfs.static.mapping.file"; - public static final String NFS_STATIC_MAPPING_FILE_DEFAULT = "/etc/nfs.map"; } diff --git a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/conf/NfsConfiguration.java b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/conf/NfsConfiguration.java index 5e73afbe17c..23f91489f92 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/conf/NfsConfiguration.java +++ b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/conf/NfsConfiguration.java @@ -43,9 +43,9 @@ public class NfsConfiguration extends HdfsConfiguration { Nfs3Constant.NFS_EXPORTS_CACHE_EXPIRYTIME_MILLIS_KEY), new DeprecationDelta("hadoop.nfs.userupdate.milly", IdMappingConstant.USERGROUPID_UPDATE_MILLIS_KEY), - new DeprecationDelta(Nfs3Constant.NFS_USERGROUP_UPDATE_MILLIS_KEY, + new DeprecationDelta("nfs.usergroup.update.millis", IdMappingConstant.USERGROUPID_UPDATE_MILLIS_KEY), - new DeprecationDelta(Nfs3Constant.NFS_STATIC_MAPPING_FILE_KEY, + new DeprecationDelta("nfs.static.mapping.file", IdMappingConstant.STATIC_ID_MAPPING_FILE_KEY), new DeprecationDelta("dfs.nfs3.enableDump", NfsConfigKeys.DFS_NFS_FILE_DUMP_KEY), diff --git a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java index fb215655aae..91d066e723d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java +++ b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java @@ -174,7 +174,7 @@ public class RpcProgramNfs3 extends RpcProgram implements Nfs3Interface { this.config = config; config.set(FsPermission.UMASK_LABEL, "000"); iug = new ShellBasedIdMapping(config, - Nfs3Constant.NFS_STATIC_MAPPING_FILE_DEFAULT); + IdMappingConstant.STATIC_ID_MAPPING_FILE_DEFAULT); aixCompatMode = config.getBoolean( NfsConfigKeys.AIX_COMPAT_MODE_KEY,