use of org.apache.hadoop.security.SecurityUtil in project tez by apache.
the class TezUtilsInternal method setSecurityUtilConfigration.
@Private
public static void setSecurityUtilConfigration(Logger log, Configuration conf) {
// Use reflection to invoke SecurityUtil.setConfiguration when available, version 2.6.0 of
// hadoop does not support it, it is currently available from 2.9.0.
// Remove this when the minimum supported hadoop version has the above method.
Class<SecurityUtil> clz = SecurityUtil.class;
try {
Method method = clz.getMethod("setConfiguration", Configuration.class);
method.invoke(null, conf);
} catch (NoSuchMethodException e) {
// This is not available, so ignore it.
} catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
log.warn("Error invoking SecurityUtil.setConfiguration: ", e);
throw new TezUncheckedException("Error invoking SecurityUtil.setConfiguration", e);
}
}
Aggregations