org.apache.hadoop.yarn.logaggregation.AggregatedLogDeletionService Java Examples

The following examples show how to use org.apache.hadoop.yarn.logaggregation.AggregatedLogDeletionService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JobHistoryServer.java    From XLearning with Apache License 2.0 5 votes vote down vote up
@Override
protected void serviceInit(Configuration conf) throws Exception {
  Configuration config = new XLearningConfiguration(conf);

  config.setBoolean(Dispatcher.DISPATCHER_EXIT_ON_ERROR_KEY, true);

  // This is required for WebApps to use https if enabled.
  XLearningWebAppUtil.initialize(getConfig());

  try {
    doSecureLogin(conf);
  } catch (IOException ie) {
    throw new YarnRuntimeException("History Server Failed to login", ie);
  }

  jobHistoryService = new JobHistory();
  historyContext = (HistoryContext) jobHistoryService;
  stateStore = createStateStore(conf);
  this.jhsDTSecretManager = createJHSSecretManager(conf, stateStore);
  clientService = createHistoryClientService();
  aggLogDelService = new AggregatedLogDeletionService();

  addService(stateStore);
  addService(new HistoryServerSecretManagerService());
  addService(clientService);
  addService(aggLogDelService);
  super.serviceInit(config);
}
 
Example #2
Source File: JobHistoryServer.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
protected void serviceInit(Configuration conf) throws Exception {
  Configuration config = new YarnConfiguration(conf);

  config.setBoolean(Dispatcher.DISPATCHER_EXIT_ON_ERROR_KEY, true);

  // This is required for WebApps to use https if enabled.
  MRWebAppUtil.initialize(getConfig());
  try {
    doSecureLogin(conf);
  } catch(IOException ie) {
    throw new YarnRuntimeException("History Server Failed to login", ie);
  }
  jobHistoryService = new JobHistory();
  historyContext = (HistoryContext)jobHistoryService;
  stateStore = createStateStore(conf);
  this.jhsDTSecretManager = createJHSSecretManager(conf, stateStore);
  clientService = createHistoryClientService();
  aggLogDelService = new AggregatedLogDeletionService();
  hsAdminServer = new HSAdminServer(aggLogDelService, jobHistoryService);
  addService(stateStore);
  addService(new HistoryServerSecretManagerService());
  addService(jobHistoryService);
  addService(clientService);
  addService(aggLogDelService);
  addService(hsAdminServer);
  super.serviceInit(config);
}
 
Example #3
Source File: TestHSAdminServer.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Before
public void init() throws HadoopIllegalArgumentException, IOException {
  conf = new JobConf();
  conf.set(JHAdminConfig.JHS_ADMIN_ADDRESS, "0.0.0.0:0");
  conf.setClass("hadoop.security.group.mapping", MockUnixGroupsMapping.class,
      GroupMappingServiceProvider.class);
  conf.setLong("hadoop.security.groups.cache.secs", groupRefreshTimeoutSec);
  conf.setBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
        securityEnabled);
  Groups.getUserToGroupsMappingService(conf);
  jobHistoryService = mock(JobHistory.class);
  alds = mock(AggregatedLogDeletionService.class);

  hsAdminServer = new HSAdminServer(alds, jobHistoryService) {

    @Override
    protected Configuration createConf() {
      return conf;
    }
  };
  hsAdminServer.init(conf);
  hsAdminServer.start();
  conf.setSocketAddr(JHAdminConfig.JHS_ADMIN_ADDRESS,
      hsAdminServer.clientRpcServer.getListenerAddress());
  hsAdminClient = new HSAdmin(conf);
}
 
Example #4
Source File: JobHistoryServer.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
protected void serviceInit(Configuration conf) throws Exception {
  Configuration config = new YarnConfiguration(conf);

  config.setBoolean(Dispatcher.DISPATCHER_EXIT_ON_ERROR_KEY, true);

  // This is required for WebApps to use https if enabled.
  MRWebAppUtil.initialize(getConfig());
  try {
    doSecureLogin(conf);
  } catch(IOException ie) {
    throw new YarnRuntimeException("History Server Failed to login", ie);
  }
  jobHistoryService = new JobHistory();
  historyContext = (HistoryContext)jobHistoryService;
  stateStore = createStateStore(conf);
  this.jhsDTSecretManager = createJHSSecretManager(conf, stateStore);
  clientService = createHistoryClientService();
  aggLogDelService = new AggregatedLogDeletionService();
  hsAdminServer = new HSAdminServer(aggLogDelService, jobHistoryService);
  addService(stateStore);
  addService(new HistoryServerSecretManagerService());
  addService(jobHistoryService);
  addService(clientService);
  addService(aggLogDelService);
  addService(hsAdminServer);
  super.serviceInit(config);
}
 
Example #5
Source File: TestHSAdminServer.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Before
public void init() throws HadoopIllegalArgumentException, IOException {
  conf = new JobConf();
  conf.set(JHAdminConfig.JHS_ADMIN_ADDRESS, "0.0.0.0:0");
  conf.setClass("hadoop.security.group.mapping", MockUnixGroupsMapping.class,
      GroupMappingServiceProvider.class);
  conf.setLong("hadoop.security.groups.cache.secs", groupRefreshTimeoutSec);
  conf.setBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
        securityEnabled);
  Groups.getUserToGroupsMappingService(conf);
  jobHistoryService = mock(JobHistory.class);
  alds = mock(AggregatedLogDeletionService.class);

  hsAdminServer = new HSAdminServer(alds, jobHistoryService) {

    @Override
    protected Configuration createConf() {
      return conf;
    }
  };
  hsAdminServer.init(conf);
  hsAdminServer.start();
  conf.setSocketAddr(JHAdminConfig.JHS_ADMIN_ADDRESS,
      hsAdminServer.clientRpcServer.getListenerAddress());
  hsAdminClient = new HSAdmin(conf);
}
 
Example #6
Source File: HSAdminServer.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public HSAdminServer(AggregatedLogDeletionService aggLogDelService,
    JobHistory jobHistoryService) {
  super(HSAdminServer.class.getName());
  this.aggLogDelService = aggLogDelService;
  this.jobHistoryService = jobHistoryService;
}
 
Example #7
Source File: HSAdminServer.java    From big-c with Apache License 2.0 4 votes vote down vote up
public HSAdminServer(AggregatedLogDeletionService aggLogDelService,
    JobHistory jobHistoryService) {
  super(HSAdminServer.class.getName());
  this.aggLogDelService = aggLogDelService;
  this.jobHistoryService = jobHistoryService;
}