public PlacementCapacityUpdatePeriodicService() { super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.setMaintenanceIntervalMicros(MAINTENANCE_INTERVAL_MICROS); }
public AbstractKubernetesAdapterService() { super(); super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.setMaintenanceIntervalMicros(MAINTENANCE_INTERVAL_MICROS); }
public AbstractDockerAdapterService() { super(); super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.setMaintenanceIntervalMicros(MAINTENANCE_INTERVAL_MICROS); }
public PKSAdapterService() { super(); super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.toggleOption(ServiceOption.INSTRUMENTATION, true); super.setMaintenanceIntervalMicros(MAINTENANCE_INTERVAL_MICROS); }
public EpzComputeEnumerationPeriodicService() { super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.toggleOption(ServiceOption.PERSISTENCE, false); super.setMaintenanceIntervalMicros(MAINTENANCE_INTERVAL_MICROS); }
public IPAddressReleaseTaskService() { super.toggleOption(Service.ServiceOption.INSTRUMENTATION, true); super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.setMaintenanceIntervalMicros(IP_ADDRESS_MAINTENANCE_PERIOD_MICROS); }
@Override public void handleStart(Operation post) { ServiceDocument initState = post.getBody(ServiceDocument.class); this.documentSelfLink = initState.documentSelfLink; this.documentExpirationTimeMicros = initState.documentExpirationTimeMicros; long ttl = this.documentExpirationTimeMicros - Utils.getSystemNowMicrosUtc(); if (ttl < 0) { logWarning("Task expiration is in the past, extending it"); // task has already expired. Add some more time instead of failing ttl = Math.max(getHost().getMaintenanceIntervalMicros() * 2, DEFAULT_TTL_MICROS); } super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.setMaintenanceIntervalMicros(ttl); post.complete(); }
@Override public void handleStart(Operation post) { ServiceDocument initState = post.getBody(ServiceDocument.class); this.documentSelfLink = initState.documentSelfLink; this.documentExpirationTimeMicros = initState.documentExpirationTimeMicros; long ttl = this.documentExpirationTimeMicros - Utils.getSystemNowMicrosUtc(); if (ttl < 0) { logWarning("Task expiration is in the past, extending it"); // task has already expired. Add some more time instead of failing ttl = Math.max(getHost().getMaintenanceIntervalMicros() * 2, DEFAULT_TTL_MICROS); } super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.setMaintenanceIntervalMicros(ttl); post.complete(); }
@Override public void handleStart(final Operation post) { super.setMaintenanceIntervalMicros(getHost().getMaintenanceIntervalMicros() * 5); // index service getUri() will be invoked on every load and save call for every operation, // so its worth caching (plus we only have a very small number of index services this.uri = post.getUri(); ExecutorService es = new ThreadPoolExecutor(QUERY_THREAD_COUNT, QUERY_THREAD_COUNT, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(QUERY_EXECUTOR_WORK_QUEUE_CAPACITY), new NamedThreadFactory(getUri() + "/queries")); this.privateQueryExecutor = TracingExecutor.create(es, getHost().getTracer()); es = new ThreadPoolExecutor(UPDATE_THREAD_COUNT, UPDATE_THREAD_COUNT, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(UPDATE_EXECUTOR_WORK_QUEUE_CAPACITY), new NamedThreadFactory(getUri() + "/updates")); this.privateIndexingExecutor = TracingExecutor.create(es, getHost().getTracer()); post.complete(); }
@Override public void handleStart(Operation post) { ServiceDocument initState = post.getBody(ServiceDocument.class); long interval = initState.documentExpirationTimeMicros - Utils.getSystemNowMicrosUtc(); if (interval < 0) { logWarning("Task expiration is in the past, extending it"); interval = getHost().getMaintenanceIntervalMicros() * 2; } super.toggleOption(ServiceOption.PERIODIC_MAINTENANCE, true); super.setMaintenanceIntervalMicros(interval); post.complete(); }
@Override public void handleStart(final Operation post) { super.setMaintenanceIntervalMicros(getHost().getMaintenanceIntervalMicros() * 5);