Skip to content

Commit

Permalink
Log setting being loaded.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed May 6, 2021
1 parent e201d6f commit 714f4e9
Showing 1 changed file with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,37 +136,54 @@ public JobSweeper(Settings settings, Client client, ClusterService clusterServic

private void loadSettings(Settings settings) {
this.sweepPeriod = JobSchedulerSettings.SWEEP_PERIOD.get(settings);
log.debug("Background full sweep with period: " + this.sweepPeriod.getMinutes());
this.sweepPageMaxSize = JobSchedulerSettings.SWEEP_PAGE_SIZE.get(settings);
log.debug("Background sweep page size: " + this.sweepPageMaxSize);
this.sweepSearchTimeout = JobSchedulerSettings.REQUEST_TIMEOUT.get(settings);
log.debug("Background sweep search timeout: " + this.sweepSearchTimeout.getMinutes());
this.sweepSearchBackoffMillis = JobSchedulerSettings.SWEEP_BACKOFF_MILLIS.get(settings);
log.debug("Background sweep search backoff: " + this.sweepSearchBackoffMillis.getMillis());
this.sweepSearchBackoffRetryCount = JobSchedulerSettings.SWEEP_BACKOFF_RETRY_COUNT.get(settings);
log.debug("Background sweep search backoff retry count: " + this.sweepSearchBackoffRetryCount);
this.jitterLimit = JobSchedulerSettings.JITTER_LIMIT.get(settings);
log.debug("Background sweep jitter limit: " + this.jitterLimit);
this.sweepSearchBackoff = this.updateRetryPolicy();
}

private void addConfigListeners() {
clusterService.getClusterSettings().addSettingsUpdateConsumer(JobSchedulerSettings.SWEEP_PERIOD,
timeValue -> {
sweepPeriod = timeValue;
log.debug("Reinitializing background full sweep with period: " + sweepPeriod.getMinutes());
log.debug("Reinitializing background full sweep with period: " + this.sweepPeriod.getMinutes());
initBackgroundSweep();
});
clusterService.getClusterSettings().addSettingsUpdateConsumer(JobSchedulerSettings.SWEEP_PAGE_SIZE,
intValue -> sweepPageMaxSize = intValue);
intValue -> {
sweepPageMaxSize = intValue;
log.debug("Setting background sweep page size: " + this.sweepPageMaxSize);
});
clusterService.getClusterSettings().addSettingsUpdateConsumer(JobSchedulerSettings.REQUEST_TIMEOUT,
timeValue -> this.sweepSearchTimeout = timeValue);
timeValue -> {
this.sweepSearchTimeout = timeValue;
log.debug("Setting background sweep search timeout: " + this.sweepSearchTimeout.getMinutes());
});
clusterService.getClusterSettings().addSettingsUpdateConsumer(JobSchedulerSettings.SWEEP_BACKOFF_MILLIS,
timeValue -> {
this.sweepSearchBackoffMillis = timeValue;
this.sweepSearchBackoff = this.updateRetryPolicy();
log.debug("Setting background sweep search backoff: " + this.sweepSearchBackoffMillis.getMillis());
});
clusterService.getClusterSettings().addSettingsUpdateConsumer(JobSchedulerSettings.SWEEP_BACKOFF_RETRY_COUNT,
intValue -> {
this.sweepSearchBackoffRetryCount = intValue;
this.sweepSearchBackoff = this.updateRetryPolicy();
log.debug("Setting background sweep search backoff retry count: " + this.sweepSearchBackoffRetryCount);
});
clusterService.getClusterSettings().addSettingsUpdateConsumer(JobSchedulerSettings.JITTER_LIMIT,
doubleValue -> this.jitterLimit = doubleValue);
doubleValue -> {
this.jitterLimit = doubleValue;
log.debug("Setting background sweep jitter limit: " + this.jitterLimit);
});
}

private BackoffPolicy updateRetryPolicy() {
Expand Down

0 comments on commit 714f4e9

Please sign in to comment.