@Override public Void run() throws IOException { aggLogDelService.refreshLogRetentionSettings(); return null; } });
@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); }
public void refreshLogRetentionSettings() throws IOException { if (getServiceState() == STATE.STARTED) { Configuration conf = createConf(); setConfig(conf); stopRMClient(); stopTimer(); scheduleLogDeletionTask(); } else { LOG.warn("Failed to execute refreshLogRetentionSettings : Aggregated Log Deletion Service is not started"); } }
deletionSvc.init(conf); deletionSvc.start(); "2"); Assert.assertTrue(2000l != deletionSvc.getCheckIntervalMsecs()); deletionSvc.refreshLogRetentionSettings(); Assert.assertTrue(2000l == deletionSvc.getCheckIntervalMsecs()); deletionSvc.stop();
private void scheduleLogDeletionTask() throws IOException { Configuration conf = getConfig(); if (!conf.getBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, YarnConfiguration.DEFAULT_LOG_AGGREGATION_ENABLED)) { // Log aggregation is not enabled so don't bother return; } long retentionSecs = conf.getLong( YarnConfiguration.LOG_AGGREGATION_RETAIN_SECONDS, YarnConfiguration.DEFAULT_LOG_AGGREGATION_RETAIN_SECONDS); if (retentionSecs < 0) { LOG.info("Log Aggregation deletion is disabled because retention is" + " too small (" + retentionSecs + ")"); return; } setLogAggCheckIntervalMsecs(retentionSecs); task = new LogDeletionTask(conf, retentionSecs, creatRMClient()); timer = new Timer(); timer.scheduleAtFixedRate(task, 0, checkIntervalMsecs); }
private void scheduleLogDeletionTask() throws IOException { Configuration conf = getConfig(); if (!conf.getBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, YarnConfiguration.DEFAULT_LOG_AGGREGATION_ENABLED)) { // Log aggregation is not enabled so don't bother return; } long retentionSecs = conf.getLong( YarnConfiguration.LOG_AGGREGATION_RETAIN_SECONDS, YarnConfiguration.DEFAULT_LOG_AGGREGATION_RETAIN_SECONDS); if (retentionSecs < 0) { LOG.info("Log Aggregation deletion is disabled because retention is" + " too small (" + retentionSecs + ")"); return; } setLogAggCheckIntervalMsecs(retentionSecs); task = new LogDeletionTask(conf, retentionSecs, createRMClient()); timer = new Timer(); timer.scheduleAtFixedRate(task, 0, checkIntervalMsecs); }
private void setLogAggCheckIntervalMsecs(long retentionSecs) { Configuration conf = getConfig(); checkIntervalMsecs = 1000 * conf .getLong( YarnConfiguration.LOG_AGGREGATION_RETAIN_CHECK_INTERVAL_SECONDS, YarnConfiguration.DEFAULT_LOG_AGGREGATION_RETAIN_CHECK_INTERVAL_SECONDS); if (checkIntervalMsecs <= 0) { // when unspecified compute check interval as 1/10th of retention checkIntervalMsecs = (retentionSecs * 1000) / 10; } }
@Override protected void serviceStart() throws Exception { scheduleLogDeletionTask(); super.serviceStart(); }
deletionSvc.init(conf); deletionSvc.start(); "2"); Assert.assertTrue(2000l != deletionSvc.getCheckIntervalMsecs()); deletionSvc.refreshLogRetentionSettings(); Assert.assertTrue(2000l == deletionSvc.getCheckIntervalMsecs()); deletionSvc.stop();
private void scheduleLogDeletionTask() throws IOException { Configuration conf = getConfig(); if (!conf.getBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, YarnConfiguration.DEFAULT_LOG_AGGREGATION_ENABLED)) { // Log aggregation is not enabled so don't bother return; } long retentionSecs = conf.getLong( YarnConfiguration.LOG_AGGREGATION_RETAIN_SECONDS, YarnConfiguration.DEFAULT_LOG_AGGREGATION_RETAIN_SECONDS); if (retentionSecs < 0) { LOG.info("Log Aggregation deletion is disabled because retention is" + " too small (" + retentionSecs + ")"); return; } setLogAggCheckIntervalMsecs(retentionSecs); task = new LogDeletionTask(conf, retentionSecs, creatRMClient()); timer = new Timer(); timer.scheduleAtFixedRate(task, 0, checkIntervalMsecs); }
private void setLogAggCheckIntervalMsecs(long retentionSecs) { Configuration conf = getConfig(); checkIntervalMsecs = 1000 * conf .getLong( YarnConfiguration.LOG_AGGREGATION_RETAIN_CHECK_INTERVAL_SECONDS, YarnConfiguration.DEFAULT_LOG_AGGREGATION_RETAIN_CHECK_INTERVAL_SECONDS); if (checkIntervalMsecs <= 0) { // when unspecified compute check interval as 1/10th of retention checkIntervalMsecs = (retentionSecs * 1000) / 10; } }
@Override protected void serviceStart() throws Exception { scheduleLogDeletionTask(); super.serviceStart(); }
public void refreshLogRetentionSettings() throws IOException { if (getServiceState() == STATE.STARTED) { Configuration conf = createConf(); setConfig(conf); stopRMClient(); stopTimer(); scheduleLogDeletionTask(); } else { LOG.warn("Failed to execute refreshLogRetentionSettings : Aggregated Log Deletion Service is not started"); } }
deletionSvc.init(conf); deletionSvc.start(); "2"); Assert.assertTrue(2000l != deletionSvc.getCheckIntervalMsecs()); deletionSvc.refreshLogRetentionSettings(); Assert.assertTrue(2000l == deletionSvc.getCheckIntervalMsecs()); deletionSvc.stop();
@Override public Void run() throws IOException { aggLogDelService.refreshLogRetentionSettings(); return null; } });
@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); }
private void setLogAggCheckIntervalMsecs(long retentionSecs) { Configuration conf = getConfig(); checkIntervalMsecs = 1000 * conf .getLong( YarnConfiguration.LOG_AGGREGATION_RETAIN_CHECK_INTERVAL_SECONDS, YarnConfiguration.DEFAULT_LOG_AGGREGATION_RETAIN_CHECK_INTERVAL_SECONDS); if (checkIntervalMsecs <= 0) { // when unspecified compute check interval as 1/10th of retention checkIntervalMsecs = (retentionSecs * 1000) / 10; } }