|
@@ -287,14 +287,18 @@ public class UserGroupInformation {
|
|
|
public static final String HADOOP_TOKEN_FILE_LOCATION =
|
|
|
"HADOOP_TOKEN_FILE_LOCATION";
|
|
|
|
|
|
+ public static boolean isInitialized() {
|
|
|
+ return conf != null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* A method to initialize the fields that depend on a configuration.
|
|
|
* Must be called before useKerberos or groups is used.
|
|
|
*/
|
|
|
private static void ensureInitialized() {
|
|
|
- if (conf == null) {
|
|
|
+ if (!isInitialized()) {
|
|
|
synchronized(UserGroupInformation.class) {
|
|
|
- if (conf == null) { // someone might have beat us
|
|
|
+ if (!isInitialized()) { // someone might have beat us
|
|
|
initialize(new Configuration(), false);
|
|
|
}
|
|
|
}
|