HADOOP-8923. JNI-based user-group mapping modules can be too chatty on lookup failures. Contributed by Kihwal Lee.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1398883 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b245adb163
commit
9757f7407a
@ -1056,6 +1056,8 @@ Release 0.23.5 - UNRELEASED
|
|||||||
NEW FEATURES
|
NEW FEATURES
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
|
HADOOP-8923. JNI-based user-group mapping modules can be too chatty on
|
||||||
|
lookup failures. (Kihwal Lee via suresh)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class JniBasedUnixGroupsMapping implements GroupMappingServiceProvider {
|
|||||||
throw new RuntimeException("Bailing out since native library couldn't " +
|
throw new RuntimeException("Bailing out since native library couldn't " +
|
||||||
"be loaded");
|
"be loaded");
|
||||||
}
|
}
|
||||||
LOG.info("Using JniBasedUnixGroupsMapping for Group resolution");
|
LOG.debug("Using JniBasedUnixGroupsMapping for Group resolution");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -57,7 +57,11 @@ public List<String> getGroups(String user) throws IOException {
|
|||||||
try {
|
try {
|
||||||
groups = getGroupForUser(user);
|
groups = getGroupForUser(user);
|
||||||
} catch (Exception e) {
|
} 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);
|
return Arrays.asList(groups);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class JniBasedUnixGroupsNetgroupMapping
|
|||||||
throw new RuntimeException("Bailing out since native library couldn't " +
|
throw new RuntimeException("Bailing out since native library couldn't " +
|
||||||
"be loaded");
|
"be loaded");
|
||||||
}
|
}
|
||||||
LOG.info("Using JniBasedUnixGroupsNetgroupMapping for Netgroup resolution");
|
LOG.debug("Using JniBasedUnixGroupsNetgroupMapping for Netgroup resolution");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,7 +115,12 @@ protected synchronized List<String> getUsersForNetgroup(String netgroup) {
|
|||||||
// JNI code does not expect '@' at the begining of the group name
|
// JNI code does not expect '@' at the begining of the group name
|
||||||
users = getUsersForNetgroupJNI(netgroup.substring(1));
|
users = getUsersForNetgroupJNI(netgroup.substring(1));
|
||||||
} catch (Exception e) {
|
} 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) {
|
if (users != null && users.length != 0) {
|
||||||
return Arrays.asList(users);
|
return Arrays.asList(users);
|
||||||
|
Loading…
Reference in New Issue
Block a user