Search in sources :

Example 1 with TimelinePolicyProvider

use of org.apache.hadoop.yarn.server.timeline.security.authorize.TimelinePolicyProvider in project hadoop by apache.

the class ApplicationHistoryClientService method serviceStart.

protected void serviceStart() throws Exception {
    Configuration conf = getConfig();
    YarnRPC rpc = YarnRPC.create(conf);
    InetSocketAddress address = conf.getSocketAddr(YarnConfiguration.TIMELINE_SERVICE_BIND_HOST, YarnConfiguration.TIMELINE_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_PORT);
    Preconditions.checkArgument(conf.getInt(YarnConfiguration.TIMELINE_SERVICE_HANDLER_THREAD_COUNT, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_CLIENT_THREAD_COUNT) > 0, "%s property value should be greater than zero", YarnConfiguration.TIMELINE_SERVICE_HANDLER_THREAD_COUNT);
    server = rpc.getServer(ApplicationHistoryProtocol.class, this, address, conf, null, conf.getInt(YarnConfiguration.TIMELINE_SERVICE_HANDLER_THREAD_COUNT, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_CLIENT_THREAD_COUNT));
    // Enable service authorization?
    if (conf.getBoolean(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false)) {
        refreshServiceAcls(conf, new TimelinePolicyProvider());
    }
    server.start();
    this.bindAddress = conf.updateConnectAddr(YarnConfiguration.TIMELINE_SERVICE_BIND_HOST, YarnConfiguration.TIMELINE_SERVICE_ADDRESS, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ADDRESS, server.getListenerAddress());
    LOG.info("Instantiated ApplicationHistoryClientService at " + this.bindAddress);
    super.serviceStart();
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) TimelinePolicyProvider(org.apache.hadoop.yarn.server.timeline.security.authorize.TimelinePolicyProvider) InetSocketAddress(java.net.InetSocketAddress) YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC) ApplicationHistoryProtocol(org.apache.hadoop.yarn.api.ApplicationHistoryProtocol)

Aggregations

InetSocketAddress (java.net.InetSocketAddress)1 Configuration (org.apache.hadoop.conf.Configuration)1 ApplicationHistoryProtocol (org.apache.hadoop.yarn.api.ApplicationHistoryProtocol)1 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)1 YarnRPC (org.apache.hadoop.yarn.ipc.YarnRPC)1 TimelinePolicyProvider (org.apache.hadoop.yarn.server.timeline.security.authorize.TimelinePolicyProvider)1