From c86cccbf3d3407df3522202af5160bd64b3ec405 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Tue, 16 Oct 2012 16:57:23 +0000 Subject: [PATCH] HADOOP-8932. Merging change 1398883 from trunk. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1398885 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ .../hadoop/security/JniBasedUnixGroupsMapping.java | 8 ++++++-- .../security/JniBasedUnixGroupsNetgroupMapping.java | 9 +++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 5e78b9f3dc4..8656a28387d 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -781,6 +781,8 @@ Release 0.23.5 - UNRELEASED NEW FEATURES IMPROVEMENTS + HADOOP-8923. JNI-based user-group mapping modules can be too chatty on + lookup failures. (Kihwal Lee via suresh) OPTIMIZATIONS diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsMapping.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsMapping.java index 504780b9312..b711c589529 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsMapping.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsMapping.java @@ -48,7 +48,7 @@ public class JniBasedUnixGroupsMapping implements GroupMappingServiceProvider { throw new RuntimeException("Bailing out since native library couldn't " + "be loaded"); } - LOG.info("Using JniBasedUnixGroupsMapping for Group resolution"); + LOG.debug("Using JniBasedUnixGroupsMapping for Group resolution"); } @Override @@ -57,7 +57,11 @@ public class JniBasedUnixGroupsMapping implements GroupMappingServiceProvider { try { groups = getGroupForUser(user); } catch (Exception e) { - LOG.warn("Error getting groups for " + user, e); + if (LOG.isDebugEnabled()) { + LOG.debug("Error getting groups for " + user, e); + } else { + LOG.info("Error getting groups for " + user + ": " + e.getMessage()); + } } return Arrays.asList(groups); } diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.java index cd72dfa6afc..fc3c4a7f47f 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsNetgroupMapping.java @@ -52,7 +52,7 @@ public class JniBasedUnixGroupsNetgroupMapping throw new RuntimeException("Bailing out since native library couldn't " + "be loaded"); } - LOG.info("Using JniBasedUnixGroupsNetgroupMapping for Netgroup resolution"); + LOG.debug("Using JniBasedUnixGroupsNetgroupMapping for Netgroup resolution"); } /** @@ -115,7 +115,12 @@ public class JniBasedUnixGroupsNetgroupMapping // JNI code does not expect '@' at the begining of the group name users = getUsersForNetgroupJNI(netgroup.substring(1)); } catch (Exception e) { - LOG.warn("error getting users for netgroup " + netgroup, e); + if (LOG.isDebugEnabled()) { + LOG.debug("Error getting users for netgroup " + netgroup, e); + } else { + LOG.info("Error getting users for netgroup " + netgroup + + ": " + e.getMessage()); + } } if (users != null && users.length != 0) { return Arrays.asList(users);