merge -c 1504874 FIXES: HADOOP-9748. Reduce blocking on UGI.ensureInitialized (daryn)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1504875 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f6b0fa487b
commit
69aaf11467
|
@ -27,6 +27,8 @@ Release 2.3.0 - UNRELEASED
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
|
HADOOP-9748. Reduce blocking on UGI.ensureInitialized (daryn)
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
||||||
HADOOP-9582. Non-existent file to "hadoop fs -conf" doesn't throw error
|
HADOOP-9582. Non-existent file to "hadoop fs -conf" doesn't throw error
|
||||||
|
|
|
@ -208,11 +208,15 @@ public class UserGroupInformation {
|
||||||
* A method to initialize the fields that depend on a configuration.
|
* A method to initialize the fields that depend on a configuration.
|
||||||
* Must be called before useKerberos or groups is used.
|
* Must be called before useKerberos or groups is used.
|
||||||
*/
|
*/
|
||||||
private static synchronized void ensureInitialized() {
|
private static void ensureInitialized() {
|
||||||
if (conf == null) {
|
if (conf == null) {
|
||||||
|
synchronized(UserGroupInformation.class) {
|
||||||
|
if (conf == null) { // someone might have beat us
|
||||||
initialize(new Configuration(), false);
|
initialize(new Configuration(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize UGI and related classes.
|
* Initialize UGI and related classes.
|
||||||
|
|
Loading…
Reference in New Issue