private void invokeOnAllPartitions() { for (Map.Entry<Address, List<Integer>> mp : memberPartitions.entrySet()) { Address address = mp.getKey(); List<Integer> partitions = mp.getValue(); PartitionIteratingOperation op = new PartitionIteratingOperation(operationFactory, toIntArray(partitions)); Future future = operationService.createInvocationBuilder(serviceName, op, address) .setTryCount(TRY_COUNT) .setTryPauseMillis(TRY_PAUSE_MILLIS) .invoke(); futures.put(address, future); } }
private void notifyCaller() { OperationServiceImpl operationService = (OperationServiceImpl) getNodeEngine().getOperationService(); operationService.getBackupHandler().notifyBackupComplete(callId); }
@Override public <T> ICompletableFuture<Map<Integer, T>> invokeOnPartitionsAsync( String serviceName, OperationFactory operationFactory, Collection<Integer> partitions) { Map<Address, List<Integer>> memberPartitions = getMemberPartitions(partitions); InvokeOnPartitions invokeOnPartitions = new InvokeOnPartitions(this, serviceName, operationFactory, memberPartitions); return invokeOnPartitions.invokeAsync(); }
this.serviceManager = new ServiceManagerImpl(this); this.executionService = new ExecutionServiceImpl(this); this.operationService = new OperationServiceImpl(this); this.eventService = new EventServiceImpl(this); this.operationParker = new OperationParkerImpl(this); this.packetDispatcher = new PacketDispatcher( logger, operationService.getOperationExecutor(), operationService.getInboundResponseHandlerSupplier().get(), operationService.getInvocationMonitor(), eventService, new ConnectionManagerPacketConsumer(),
@Override public void afterRun() throws Exception { if (validationFailure != null || !sync || getCallId() == 0 || originalCaller == null) { return; } NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); long callId = getCallId(); OperationServiceImpl operationService = (OperationServiceImpl) nodeEngine.getOperationService(); if (nodeEngine.getThisAddress().equals(originalCaller)) { operationService.getBackupHandler().notifyBackupComplete(callId); } else { operationService.getOutboundResponseHandler().sendBackupAck(originalCaller, callId, backupOp.isUrgent()); } }
protected AbstractSplitBrainHandlerService(NodeEngine nodeEngine) { this.partitionService = nodeEngine.getPartitionService(); this.operationExecutor = ((OperationServiceImpl) nodeEngine.getOperationService()).getOperationExecutor(); }
public PendingInvocationsPlugin(NodeEngineImpl nodeEngine) { super(nodeEngine.getLogger(PendingInvocationsPlugin.class)); InternalOperationService operationService = nodeEngine.getOperationService(); this.invocationRegistry = ((OperationServiceImpl) operationService).getInvocationRegistry(); HazelcastProperties props = nodeEngine.getProperties(); this.periodMillis = props.getMillis(PERIOD_SECONDS); this.threshold = props.getInteger(THRESHOLD); }
public void start() { logger.finest("Starting OperationService"); initInvocationContext(); invocationMonitor.start(); operationExecutor.start(); inboundResponseHandlerSupplier.start(); slowOperationDetector.start(); }
public OperationHeartbeatPlugin(NodeEngineImpl nodeEngine) { super(nodeEngine.getLogger(OperationHeartbeatPlugin.class)); InvocationMonitor invocationMonitor = ((OperationServiceImpl) nodeEngine.getOperationService()).getInvocationMonitor(); HazelcastProperties properties = nodeEngine.getProperties(); this.periodMillis = properties.getMillis(PERIOD_SECONDS); this.maxDeviationPercentage = properties.getInteger(MAX_DEVIATION_PERCENTAGE); this.expectedIntervalMillis = invocationMonitor.getHeartbeatBroadcastPeriodMillis(); this.heartbeatPerMember = invocationMonitor.getHeartbeatPerMember(); }
this.serviceManager = new ServiceManagerImpl(this); this.executionService = new ExecutionServiceImpl(this); this.operationService = new OperationServiceImpl(this); this.eventService = new EventServiceImpl(this); this.operationParker = new OperationParkerImpl(this); this.packetDispatcher = new PacketDispatcher( logger, operationService.getOperationExecutor(), operationService.getInboundResponseHandlerSupplier().get(), operationService.getInvocationMonitor(), eventService, new ConnectionManagerPacketConsumer(),
@Override public void afterRun() throws Exception { if (validationFailure != null || !sync || getCallId() == 0 || originalCaller == null) { return; } NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); long callId = getCallId(); OperationServiceImpl operationService = (OperationServiceImpl) nodeEngine.getOperationService(); if (nodeEngine.getThisAddress().equals(originalCaller)) { operationService.getBackupHandler().notifyBackupComplete(callId); } else { operationService.getOutboundResponseHandler().sendBackupAck(originalCaller, callId, backupOp.isUrgent()); } }
protected AbstractSplitBrainHandlerService(NodeEngine nodeEngine) { this.partitionService = nodeEngine.getPartitionService(); this.operationExecutor = ((OperationServiceImpl) nodeEngine.getOperationService()).getOperationExecutor(); }
public PendingInvocationsPlugin(NodeEngineImpl nodeEngine) { super(nodeEngine.getLogger(PendingInvocationsPlugin.class)); InternalOperationService operationService = nodeEngine.getOperationService(); this.invocationRegistry = ((OperationServiceImpl) operationService).getInvocationRegistry(); HazelcastProperties props = nodeEngine.getProperties(); this.periodMillis = props.getMillis(PERIOD_SECONDS); this.threshold = props.getInteger(THRESHOLD); }
public void start() { logger.finest("Starting OperationService"); initInvocationContext(); invocationMonitor.start(); operationExecutor.start(); inboundResponseHandlerSupplier.start(); slowOperationDetector.start(); }
public OperationHeartbeatPlugin(NodeEngineImpl nodeEngine) { super(nodeEngine.getLogger(OperationHeartbeatPlugin.class)); InvocationMonitor invocationMonitor = ((OperationServiceImpl) nodeEngine.getOperationService()).getInvocationMonitor(); HazelcastProperties properties = nodeEngine.getProperties(); this.periodMillis = properties.getMillis(PERIOD_SECONDS); this.maxDeviationPercentage = properties.getInteger(MAX_DEVIATION_PERCENTAGE); this.expectedIntervalMillis = invocationMonitor.getHeartbeatBroadcastPeriodMillis(); this.heartbeatPerMember = invocationMonitor.getHeartbeatPerMember(); }
protected AbstractContainerCollector(NodeEngine nodeEngine) { this.operationExecutor = ((OperationServiceImpl) nodeEngine.getOperationService()).getOperationExecutor(); this.partitionService = nodeEngine.getPartitionService(); this.mergePolicyProvider = nodeEngine.getSplitBrainMergePolicyProvider(); }
private void retryFailedPartitions() throws InterruptedException, ExecutionException { List<Integer> failedPartitions = new LinkedList<Integer>(); for (Map.Entry<Integer, Object> partitionResult : partitionResults.entrySet()) { int partitionId = partitionResult.getKey(); Object result = partitionResult.getValue(); if (result instanceof Throwable) { failedPartitions.add(partitionId); } } for (Integer failedPartition : failedPartitions) { Operation operation; PartitionAwareOperationFactory partitionAwareFactory = extractPartitionAware(operationFactory); if (partitionAwareFactory != null) { operation = partitionAwareFactory.createPartitionOperation(failedPartition); } else { operation = operationFactory.createOperation(); } Future future = operationService.createInvocationBuilder(serviceName, operation, failedPartition).invoke(); partitionResults.put(failedPartition, future); } for (Integer failedPartition : failedPartitions) { Future future = (Future) partitionResults.get(failedPartition); Object result = future.get(); partitionResults.put(failedPartition, result); } } }
public InvocationPlugin(NodeEngineImpl nodeEngine) { super(nodeEngine.getLogger(PendingInvocationsPlugin.class)); InternalOperationService operationService = nodeEngine.getOperationService(); this.invocationRegistry = ((OperationServiceImpl) operationService).getInvocationRegistry(); HazelcastProperties props = nodeEngine.getProperties(); this.samplePeriodMillis = props.getMillis(SAMPLE_PERIOD_SECONDS); this.thresholdMillis = props.getMillis(SLOW_THRESHOLD_SECONDS); this.maxCount = props.getInteger(SLOW_MAX_COUNT); }
@Override public <T> Map<Integer, T> invokeOnPartitions(String serviceName, OperationFactory operationFactory, Collection<Integer> partitions) throws Exception { Map<Address, List<Integer>> memberPartitions = getMemberPartitions(partitions); InvokeOnPartitions invokeOnPartitions = new InvokeOnPartitions(this, serviceName, operationFactory, memberPartitions); return invokeOnPartitions.invoke(); }
private void notifyCaller() { OperationServiceImpl operationService = (OperationServiceImpl) getNodeEngine().getOperationService(); operationService.getBackupHandler().notifyBackupComplete(callId); }