use of org.apache.hadoop.security.token.delegation.web.PseudoDelegationTokenAuthenticator in project hadoop by apache.
the class TimelineConnector method serviceInit.
@Override
protected void serviceInit(Configuration conf) throws Exception {
super.serviceInit(conf);
ClientConfig cc = new DefaultClientConfig();
cc.getClasses().add(YarnJacksonJaxbJsonProvider.class);
sslFactory = getSSLFactory(conf);
connConfigurator = getConnConfigurator(sslFactory);
if (UserGroupInformation.isSecurityEnabled()) {
authenticator = new KerberosDelegationTokenAuthenticator();
} else {
authenticator = new PseudoDelegationTokenAuthenticator();
}
authenticator.setConnectionConfigurator(connConfigurator);
connectionRetry = new TimelineClientConnectionRetry(conf);
client = new Client(new URLConnectionClientHandler(new TimelineURLConnectionFactory(authUgi, authenticator, connConfigurator, token, doAsUser)), cc);
if (requireConnectionRetry) {
TimelineJerseyRetryFilter retryFilter = new TimelineJerseyRetryFilter(connectionRetry);
client.addFilter(retryFilter);
}
}
Aggregations