InvokeOnMemberFunction(Supplier<? extends Operation> operationSupplier, NodeEngine nodeEngine, RestartingMemberIterator memberIterator) { this.operationSupplier = operationSupplier; this.nodeEngine = nodeEngine; this.memberIterator = memberIterator; this.retryDelayMillis = nodeEngine.getProperties().getMillis(GroupProperty.INVOCATION_RETRY_PAUSE); }
/** * Returns the size of the key batch for which values are loaded. * Each partition may load this many values at any moment independently * of other value loading tasks on other partitions. */ private int getLoadBatchSize() { return mapServiceContext.getNodeEngine().getProperties().getInteger(GroupProperty.MAP_LOAD_CHUNK_SIZE); } }
/** * Returns the size of the key batch for which values are loaded. * Each partition may load this many values at any moment independently * of other value loading tasks on other partitions. */ private int getLoadBatchSize() { return mapServiceContext.getNodeEngine().getProperties().getInteger(GroupProperty.MAP_LOAD_CHUNK_SIZE); } }
LocalRetryableExecution(NodeEngine nodeEngine, Operation op) { this.nodeEngine = nodeEngine; this.logger = nodeEngine.getLogger(LocalRetryableExecution.class); this.invocationMaxRetryCount = nodeEngine.getProperties().getInteger(GroupProperty.INVOCATION_MAX_RETRY_COUNT); this.invocationRetryPauseMillis = nodeEngine.getProperties().getMillis(GroupProperty.INVOCATION_RETRY_PAUSE); this.op = op; op.setOperationResponseHandler(this); }
private long getReplicaWaitTimeMillis() { HazelcastProperties hazelcastProperties = mapServiceContext.getNodeEngine().getProperties(); return hazelcastProperties.getMillis(GroupProperty.MAP_REPLICA_SCHEDULED_TASK_DELAY_SECONDS); }
private Thread shutdownHookThread(NodeEngine nodeEngine) { return new Thread(() -> { String policy = nodeEngine.getProperties().getString(SHUTDOWNHOOK_POLICY); if (policy.equals("TERMINATE")) { jetInstance.getHazelcastInstance().getLifecycleService().terminate(); } else { jetInstance.shutdown(); } }, "jet.ShutdownThread"); } }
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); }
public QueryResultSizeLimiter(MapServiceContext mapServiceContext, ILogger logger) { NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.mapServiceContext = mapServiceContext; this.logger = logger; HazelcastProperties hazelcastProperties = nodeEngine.getProperties(); this.maxResultLimit = getMaxResultLimit(hazelcastProperties); this.maxLocalPartitionsLimitForPreCheck = getMaxLocalPartitionsLimitForPreCheck(hazelcastProperties); this.resultLimitPerPartition = maxResultLimit * MAX_RESULT_LIMIT_FACTOR / (float) getPartitionCount(nodeEngine); this.isQueryResultLimitEnabled = (maxResultLimit != DISABLED); this.isPreCheckEnabled = (isQueryResultLimitEnabled && maxLocalPartitionsLimitForPreCheck != DISABLED); }
public LockServiceImpl(NodeEngine nodeEngine) { this.nodeEngine = nodeEngine; this.containers = new LockStoreContainer[nodeEngine.getPartitionService().getPartitionCount()]; for (int i = 0; i < containers.length; i++) { containers[i] = new LockStoreContainer(this, i); } maxLeaseTimeInMillis = getMaxLeaseTimeInMillis(nodeEngine.getProperties()); }
protected MultiMapProxySupport(MultiMapConfig config, MultiMapService service, NodeEngine nodeEngine, String name) { super(nodeEngine, service); this.config = config; this.name = name; lockSupport = new LockProxySupport(new DistributedObjectNamespace(MultiMapService.SERVICE_NAME, name), LockServiceImpl.getMaxLeaseTimeInMillis(nodeEngine.getProperties())); }
public QueryResultSizeLimiter(MapServiceContext mapServiceContext, ILogger logger) { NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.mapServiceContext = mapServiceContext; this.logger = logger; HazelcastProperties hazelcastProperties = nodeEngine.getProperties(); this.maxResultLimit = getMaxResultLimit(hazelcastProperties); this.maxLocalPartitionsLimitForPreCheck = getMaxLocalPartitionsLimitForPreCheck(hazelcastProperties); this.resultLimitPerPartition = maxResultLimit * MAX_RESULT_LIMIT_FACTOR / (float) getPartitionCount(nodeEngine); this.isQueryResultLimitEnabled = (maxResultLimit != DISABLED); this.isPreCheckEnabled = (isQueryResultLimitEnabled && maxLocalPartitionsLimitForPreCheck != DISABLED); }
protected MultiMapProxySupport(MultiMapConfig config, MultiMapService service, NodeEngine nodeEngine, String name) { super(nodeEngine, service); this.config = config; this.name = name; lockSupport = new LockProxySupport(new DistributedObjectNamespace(MultiMapService.SERVICE_NAME, name), LockServiceImpl.getMaxLeaseTimeInMillis(nodeEngine.getProperties())); }
private Invalidator createInvalidator() { HazelcastProperties hazelcastProperties = nodeEngine.getProperties(); int batchSize = hazelcastProperties.getInteger(MAP_INVALIDATION_MESSAGE_BATCH_SIZE); int batchFrequencySeconds = hazelcastProperties.getInteger(MAP_INVALIDATION_MESSAGE_BATCH_FREQUENCY_SECONDS); boolean batchingEnabled = hazelcastProperties.getBoolean(MAP_INVALIDATION_MESSAGE_BATCH_ENABLED) && batchSize > 1; if (batchingEnabled) { return new BatchInvalidator(SERVICE_NAME, batchSize, batchFrequencySeconds, INVALIDATION_ACCEPTOR, nodeEngine); } else { return new NonStopInvalidator(SERVICE_NAME, INVALIDATION_ACCEPTOR, nodeEngine); } }
private Invalidator createInvalidator() { HazelcastProperties hazelcastProperties = nodeEngine.getProperties(); int batchSize = hazelcastProperties.getInteger(CACHE_INVALIDATION_MESSAGE_BATCH_SIZE); int batchFrequencySeconds = hazelcastProperties.getInteger(CACHE_INVALIDATION_MESSAGE_BATCH_FREQUENCY_SECONDS); boolean batchingEnabled = hazelcastProperties.getBoolean(CACHE_INVALIDATION_MESSAGE_BATCH_ENABLED) && batchSize > 1; if (batchingEnabled) { return new BatchInvalidator(SERVICE_NAME, batchSize, batchFrequencySeconds, TRUE_FILTER, nodeEngine); } else { return new NonStopInvalidator(SERVICE_NAME, TRUE_FILTER, nodeEngine); } }
private static WriteBehindQueue newWriteBehindQueue(MapServiceContext mapServiceContext, boolean writeCoalescing) { HazelcastProperties hazelcastProperties = mapServiceContext.getNodeEngine().getProperties(); final int capacity = hazelcastProperties.getInteger(GroupProperty.MAP_WRITE_BEHIND_QUEUE_CAPACITY); final AtomicInteger counter = mapServiceContext.getWriteBehindQueueItemCounter(); return (writeCoalescing ? createDefaultWriteBehindQueue() : createBoundedWriteBehindQueue(capacity, counter)); }
private static WriteBehindQueue newWriteBehindQueue(MapServiceContext mapServiceContext, boolean writeCoalescing) { HazelcastProperties hazelcastProperties = mapServiceContext.getNodeEngine().getProperties(); final int capacity = hazelcastProperties.getInteger(GroupProperty.MAP_WRITE_BEHIND_QUEUE_CAPACITY); final AtomicInteger counter = mapServiceContext.getWriteBehindQueueItemCounter(); return (writeCoalescing ? createDefaultWriteBehindQueue() : createBoundedWriteBehindQueue(capacity, counter)); }
private Invalidator createInvalidator() { HazelcastProperties hazelcastProperties = nodeEngine.getProperties(); int batchSize = hazelcastProperties.getInteger(MAP_INVALIDATION_MESSAGE_BATCH_SIZE); int batchFrequencySeconds = hazelcastProperties.getInteger(MAP_INVALIDATION_MESSAGE_BATCH_FREQUENCY_SECONDS); boolean batchingEnabled = hazelcastProperties.getBoolean(MAP_INVALIDATION_MESSAGE_BATCH_ENABLED) && batchSize > 1; if (batchingEnabled) { return new BatchInvalidator(SERVICE_NAME, batchSize, batchFrequencySeconds, INVALIDATION_ACCEPTOR, nodeEngine); } else { return new NonStopInvalidator(SERVICE_NAME, INVALIDATION_ACCEPTOR, nodeEngine); } }
protected AbstractEvictableRecordStore(MapContainer mapContainer, int partitionId) { super(mapContainer, partitionId); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); HazelcastProperties hazelcastProperties = nodeEngine.getProperties(); expiryDelayMillis = hazelcastProperties.getMillis(GroupProperty.MAP_EXPIRY_DELAY_SECONDS); eventService = nodeEngine.getEventService(); mapEventPublisher = mapServiceContext.getMapEventPublisher(); thisAddress = nodeEngine.getThisAddress(); clearExpiredRecordsTask = mapServiceContext.getExpirationManager().getTask(); }
protected AbstractEvictableRecordStore(MapContainer mapContainer, int partitionId) { super(mapContainer, partitionId); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); HazelcastProperties hazelcastProperties = nodeEngine.getProperties(); expiryDelayMillis = hazelcastProperties.getMillis(GroupProperty.MAP_EXPIRY_DELAY_SECONDS); eventService = nodeEngine.getEventService(); mapEventPublisher = mapServiceContext.getMapEventPublisher(); thisAddress = nodeEngine.getThisAddress(); clearExpiredRecordsTask = mapServiceContext.getExpirationManager().getTask(); }
public MapNearCacheManager(MapServiceContext mapServiceContext) { super(mapServiceContext.getNodeEngine().getSerializationService(), mapServiceContext.getNodeEngine().getExecutionService().getGlobalTaskScheduler(), null, mapServiceContext.getNodeEngine().getProperties()); this.nodeEngine = mapServiceContext.getNodeEngine(); this.mapServiceContext = mapServiceContext; this.partitionService = new MemberMinimalPartitionService(nodeEngine.getPartitionService()); this.partitionCount = partitionService.getPartitionCount(); this.invalidator = createInvalidator(); this.repairingTask = createRepairingInvalidationTask(); }