use of com.netflix.titus.common.util.guice.annotation.Activator in project titus-control-plane by Netflix.
the class ManagementSubsystemInitializer method enterActiveMode.
@Activator
public Observable<Void> enterActiveMode() {
logger.info("Entering active mode");
try {
ApplicationSLA defaultSLA = applicationSlaStore.findByName(ApplicationSlaManagementService.DEFAULT_APPLICATION).toBlocking().first();
logger.info("Default application SLA configured as: {}", defaultSLA);
} catch (NotFoundException e) {
ApplicationSLA defaultSLA = buildDefaultApplicationSLA(configuration);
applicationSlaStore.create(defaultSLA).toBlocking().firstOrDefault(null);
logger.info("Default application SLA not defined; creating it according to the provided configuration: {}", defaultSLA);
}
return Observable.empty();
}
use of com.netflix.titus.common.util.guice.annotation.Activator in project titus-control-plane by Netflix.
the class ArchivedTasksGc method enterActiveMode.
@Activator
public void enterActiveMode() {
ScheduleDescriptor scheduleDescriptor = ScheduleDescriptor.newBuilder().withName("gcArchivedTasks").withDescription("GC oldest archived pasts once the criteria is met").withInitialDelay(Duration.ofMillis(configuration.getGcInitialDelayMs())).withInterval(Duration.ofMillis(configuration.getGcIntervalMs())).withTimeout(Duration.ofMillis(configuration.getGcTimeoutMs())).build();
this.schedulerRef = titusRuntime.getLocalScheduler().schedule(scheduleDescriptor, e -> gc(), ExecutorsExt.namedSingleThreadExecutor(ArchivedTasksGc.class.getSimpleName()));
}
use of com.netflix.titus.common.util.guice.annotation.Activator in project titus-control-plane by Netflix.
the class DefaultKubeJobManagementReconciler method enterActiveMode.
@Activator
public void enterActiveMode() {
ScheduleDescriptor scheduleDescriptor = ScheduleDescriptor.newBuilder().withName("reconcileNodesAndPods").withDescription("Reconcile nodes and pods").withInitialDelay(Duration.ofMillis(backendConfiguration.getReconcilerInitialDelayMs())).withInterval(Duration.ofMillis(backendConfiguration.getReconcilerIntervalMs())).withTimeout(Duration.ofMinutes(5)).build();
this.schedulerRef = titusRuntime.getLocalScheduler().schedule(scheduleDescriptor, e -> reconcile(), ExecutorsExt.namedSingleThreadExecutor(DefaultKubeJobManagementReconciler.class.getSimpleName()));
}
use of com.netflix.titus.common.util.guice.annotation.Activator in project titus-control-plane by Netflix.
the class BaseGcController method enterActiveMode.
@Activator
public void enterActiveMode() {
ScheduleDescriptor gcScheduleDescriptor = ScheduleDescriptor.newBuilder().withName(name).withDescription(description).withInitialDelay(Duration.ofMillis(controllerConfiguration.getControllerInitialDelayMs())).withInterval(Duration.ofMillis(controllerConfiguration.getControllerIntervalMs())).withTimeout(Duration.ofMillis(controllerConfiguration.getControllerTimeoutMs())).build();
executorService = ExecutorsExt.namedSingleThreadExecutor(name);
schedulerRef = scheduler.schedule(gcScheduleDescriptor, e -> doGc(), executorService);
tokenBucket = Limiters.createInstrumentedFixedIntervalTokenBucket(name + "TokenBucket", tokenBucketConfiguration, currentTokenBucket -> logger.info("Token bucket: {} configuration updated with: {}", name, currentTokenBucket), titusRuntime);
}
Aggregations