@Override public void init(NodeEngine nodeEngine, Properties properties) { this.nodeEngine = nodeEngine; this.executionService = nodeEngine.getExecutionService(); this.logger = nodeEngine.getLogger(DistributedExecutorService.class); }
public void shutdownExecutor(String name) { if (shutdownExecutors.putIfAbsent(name, Boolean.TRUE) == null) { ((InternalExecutionService) nodeEngine.getExecutionService()).shutdownScheduledDurableExecutor(name); } }
ScheduledExecutorContainer(String name, int partitionId, NodeEngine nodeEngine, int durability, int capacity, ConcurrentMap<String, ScheduledTaskDescriptor> tasks) { this.logger = nodeEngine.getLogger(getClass()); this.name = name; this.nodeEngine = nodeEngine; this.executionService = (InternalExecutionService) nodeEngine.getExecutionService(); this.partitionId = partitionId; this.durability = durability; this.capacity = capacity; this.tasks = tasks; }
@Override public void destroyDistributedObject(String name) { if (shutdownExecutors.remove(name) == null) { ((InternalExecutionService) nodeEngine.getExecutionService()).shutdownScheduledDurableExecutor(name); } resetPartitionOrMemberBinContainer(name); quorumConfigCache.remove(name); }
private void checkBackgroundTaskIsRunning() { if (runningBackgroundTask.get()) { // return if already started return; } if (runningBackgroundTask.compareAndSet(false, true)) { ExecutionService executionService = nodeEngine.getExecutionService(); executionService.scheduleWithRepetition(invalidationExecutorName, new BatchInvalidationEventSender(), batchFrequencySeconds, batchFrequencySeconds, SECONDS); } }
Networking(NodeEngine nodeEngine, JobExecutionService jobExecutionService, int flowControlPeriodMs) { this.nodeEngine = (NodeEngineImpl) nodeEngine; this.logger = nodeEngine.getLogger(getClass()); this.jobExecutionService = jobExecutionService; this.flowControlSender = nodeEngine.getExecutionService().scheduleWithRepetition( this::broadcastFlowControlPacket, 0, flowControlPeriodMs, MILLISECONDS); }
public void destroy() { for (ScheduledExecutorContainer container : containers.values()) { ((InternalExecutionService) nodeEngine.getExecutionService()).shutdownScheduledDurableExecutor(container.getName()); } }
private Executor initExecutor(NodeEngine nodeEngine, ReliableTopicConfig topicConfig) { Executor executor = topicConfig.getExecutor(); if (executor == null) { executor = nodeEngine.getExecutionService().getExecutor(ASYNC_EXECUTOR); } return executor; }
private ICompletableFuture<Object> invokeOnMemberWithDelay(Member member) { SimpleCompletableFuture<Object> future = new SimpleCompletableFuture<Object>(nodeEngine); InvokeOnMemberTask task = new InvokeOnMemberTask(member, future); nodeEngine.getExecutionService().schedule(task, retryDelayMillis, TimeUnit.MILLISECONDS); return future; }
@Override public void shutdown() { ExecutionService executionService = nodeEngine.getExecutionService(); executionService.shutdownExecutor(invalidationExecutorName); HazelcastInstance node = nodeEngine.getHazelcastInstance(); LifecycleService lifecycleService = node.getLifecycleService(); lifecycleService.removeLifecycleListener(nodeShutdownListenerId); invalidationQueues.clear(); super.shutdown(); }
private EntryTaskScheduler<Data, Integer> createScheduler(ObjectNamespace namespace) { NodeEngine nodeEngine = lockService.getNodeEngine(); LockEvictionProcessor entryProcessor = new LockEvictionProcessor(nodeEngine, namespace); TaskScheduler globalScheduler = nodeEngine.getExecutionService().getGlobalTaskScheduler(); return EntryTaskSchedulerFactory.newScheduler(globalScheduler, entryProcessor, ScheduleType.FOR_EACH); }
/** * Schedules a {@link CRDTMigrationTask} with a delay of {@code delaySeconds} * seconds. */ void scheduleMigrationTask(long delaySeconds) { if (nodeEngine.getLocalMember().isLiteMember()) { return; } nodeEngine.getExecutionService().schedule(CRDT_REPLICATION_MIGRATION_EXECUTOR, new CRDTMigrationTask(nodeEngine, this), delaySeconds, TimeUnit.SECONDS); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { for (int i = 0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) { partitionContainers[i] = new PartitionContainer(this, i); } antiEntropyFuture = nodeEngine.getExecutionService().getGlobalTaskScheduler() .scheduleWithRepetition(antiEntropyTask, 0, SYNC_INTERVAL_SECONDS, TimeUnit.SECONDS); }
public StoreWorker(MapStoreContext mapStoreContext, WriteBehindProcessor writeBehindProcessor) { this.mapName = mapStoreContext.getMapName(); this.mapServiceContext = mapStoreContext.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.partitionService = nodeEngine.getPartitionService(); this.executionService = nodeEngine.getExecutionService(); this.writeBehindProcessor = writeBehindProcessor; this.backupDelayMillis = getReplicaWaitTimeMillis(); this.lastHighestStoreTime = Clock.currentTimeMillis(); this.writeDelayMillis = SECONDS.toMillis(getWriteDelaySeconds(mapStoreContext)); this.partitionCount = partitionService.getPartitionCount(); }
protected QueryDispatcher(MapServiceContext mapServiceContext) { this.mapServiceContext = mapServiceContext; this.nodeEngine = mapServiceContext.getNodeEngine(); this.serializationService = (InternalSerializationService) nodeEngine.getSerializationService(); this.partitionService = nodeEngine.getPartitionService(); this.logger = nodeEngine.getLogger(getClass()); this.operationService = nodeEngine.getOperationService(); this.clusterService = nodeEngine.getClusterService(); this.localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider(); this.executor = nodeEngine.getExecutionService().getExecutor(QUERY_EXECUTOR); }
public StoreWorker(MapStoreContext mapStoreContext, WriteBehindProcessor writeBehindProcessor) { this.mapName = mapStoreContext.getMapName(); this.mapServiceContext = mapStoreContext.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.partitionService = nodeEngine.getPartitionService(); this.executionService = nodeEngine.getExecutionService(); this.writeBehindProcessor = writeBehindProcessor; this.backupDelayMillis = getReplicaWaitTimeMillis(); this.lastHighestStoreTime = Clock.currentTimeMillis(); this.writeDelayMillis = SECONDS.toMillis(getWriteDelaySeconds(mapStoreContext)); this.partitionCount = partitionService.getPartitionCount(); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { int partitionTableSendInterval = node.getProperties().getSeconds(GroupProperty.PARTITION_TABLE_SEND_INTERVAL); if (partitionTableSendInterval <= 0) { partitionTableSendInterval = 1; } ExecutionService executionService = nodeEngine.getExecutionService(); executionService.scheduleWithRepetition(new PublishPartitionRuntimeStateTask(node, this), partitionTableSendInterval, partitionTableSendInterval, SECONDS); migrationManager.start(); replicaManager.scheduleReplicaVersionSync(executionService); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { node.getConnectionManager().addConnectionListener(connectionListener); ClientHeartbeatMonitor heartbeatMonitor = new ClientHeartbeatMonitor( endpointManager, getLogger(ClientHeartbeatMonitor.class), nodeEngine.getExecutionService(), node.getProperties()); heartbeatMonitor.start(); }
private AggregationResultProcessor createAggregationResultProcessor(SerializationService ss) { boolean parallelAccumulation = nodeEngine.getProperties().getBoolean(AGGREGATION_ACCUMULATION_PARALLEL_EVALUATION); int opTimeoutInMillis = nodeEngine.getProperties().getInteger(OPERATION_CALL_TIMEOUT_MILLIS); AccumulationExecutor accumulationExecutor; if (parallelAccumulation) { ManagedExecutorService queryExecutorService = nodeEngine.getExecutionService().getExecutor(QUERY_EXECUTOR); accumulationExecutor = new ParallelAccumulationExecutor(queryExecutorService, ss, opTimeoutInMillis); } else { accumulationExecutor = new CallerRunsAccumulationExecutor(ss); } return new AggregationResultProcessor(accumulationExecutor, serializationService); }
private AggregationResultProcessor createAggregationResultProcessor(SerializationService ss) { boolean parallelAccumulation = nodeEngine.getProperties().getBoolean(AGGREGATION_ACCUMULATION_PARALLEL_EVALUATION); int opTimeoutInMillis = nodeEngine.getProperties().getInteger(OPERATION_CALL_TIMEOUT_MILLIS); AccumulationExecutor accumulationExecutor; if (parallelAccumulation) { ManagedExecutorService queryExecutorService = nodeEngine.getExecutionService().getExecutor(QUERY_EXECUTOR); accumulationExecutor = new ParallelAccumulationExecutor(queryExecutorService, ss, opTimeoutInMillis); } else { accumulationExecutor = new CallerRunsAccumulationExecutor(ss); } return new AggregationResultProcessor(accumulationExecutor, serializationService); }