@Override @SuppressWarnings("unchecked") public <E> InternalCompletableFuture<E> invokeOnTarget(String serviceName, Operation op, Address target) { op.setServiceName(serviceName); return new TargetInvocation(invocationContext, op, target, invocationMaxRetryCount, invocationRetryPauseMillis, DEFAULT_CALL_TIMEOUT, DEFAULT_DESERIALIZE_RESULT).invoke(); }
@Override @SuppressWarnings("unchecked") public <E> InternalCompletableFuture<E> invokeOnTarget(String serviceName, Operation op, Address target) { op.setServiceName(serviceName); return new TargetInvocation(invocationContext, op, target, invocationMaxRetryCount, invocationRetryPauseMillis, DEFAULT_CALL_TIMEOUT, DEFAULT_DESERIALIZE_RESULT).invoke(); }
@Override @SuppressWarnings("unchecked") public <E> InternalCompletableFuture<E> invokeOnPartition(String serviceName, Operation op, int partitionId) { op.setServiceName(serviceName) .setPartitionId(partitionId) .setReplicaIndex(DEFAULT_REPLICA_INDEX); return new PartitionInvocation( invocationContext, op, invocationMaxRetryCount, invocationRetryPauseMillis, DEFAULT_CALL_TIMEOUT, DEFAULT_DESERIALIZE_RESULT, failOnIndeterminateOperationState).invoke(); }
@Override @SuppressWarnings("unchecked") public <E> InternalCompletableFuture<E> invokeOnPartition(String serviceName, Operation op, int partitionId) { op.setServiceName(serviceName) .setPartitionId(partitionId) .setReplicaIndex(DEFAULT_REPLICA_INDEX); return new PartitionInvocation( invocationContext, op, invocationMaxRetryCount, invocationRetryPauseMillis, DEFAULT_CALL_TIMEOUT, DEFAULT_DESERIALIZE_RESULT, failOnIndeterminateOperationState).invoke(); }
@Override protected final Operation prepareOperation() { Operation operation = createOperation(); return operation.setPartitionId(getPartitionId()).setServiceName(getServiceName()); }
@Override @SuppressWarnings("unchecked") public <V> void asyncInvokeOnPartition(String serviceName, Operation op, int partitionId, ExecutionCallback<V> callback) { op.setServiceName(serviceName).setPartitionId(partitionId).setReplicaIndex(DEFAULT_REPLICA_INDEX); InvocationFuture future = new PartitionInvocation(invocationContext, op, invocationMaxRetryCount, invocationRetryPauseMillis, DEFAULT_CALL_TIMEOUT, DEFAULT_DESERIALIZE_RESULT, failOnIndeterminateOperationState).invokeAsync(); if (callback != null) { future.andThen(callback); } }
@Override @SuppressWarnings("unchecked") public <V> void asyncInvokeOnPartition(String serviceName, Operation op, int partitionId, ExecutionCallback<V> callback) { op.setServiceName(serviceName).setPartitionId(partitionId).setReplicaIndex(DEFAULT_REPLICA_INDEX); InvocationFuture future = new PartitionInvocation(invocationContext, op, invocationMaxRetryCount, invocationRetryPauseMillis, DEFAULT_CALL_TIMEOUT, DEFAULT_DESERIALIZE_RESULT, failOnIndeterminateOperationState).invokeAsync(); if (callback != null) { future.andThen(callback); } }
@Override protected Operation newPrimaryExpiryOp(int expirationPercentage, PartitionContainer container) { int partitionId = container.getPartitionId(); return new ClearExpiredOperation(expirationPercentage) .setNodeEngine(nodeEngine) .setCallerUuid(nodeEngine.getLocalMember().getUuid()) .setPartitionId(partitionId) .setValidateTarget(false) .setServiceName(SERVICE_NAME); }
@Override protected Operation newPrimaryExpiryOp(int expirationPercentage, CachePartitionSegment container) { return new CacheClearExpiredOperation(expirationPercentage) .setNodeEngine(nodeEngine) .setCallerUuid(nodeEngine.getLocalMember().getUuid()) .setPartitionId(container.getPartitionId()) .setValidateTarget(false) .setServiceName(SERVICE_NAME); }
@Override protected Operation newPrimaryExpiryOp(int expirationPercentage, CachePartitionSegment container) { return new CacheClearExpiredOperation(expirationPercentage) .setNodeEngine(nodeEngine) .setCallerUuid(nodeEngine.getLocalMember().getUuid()) .setPartitionId(container.getPartitionId()) .setValidateTarget(false) .setServiceName(SERVICE_NAME); }
@Override protected Operation newPrimaryExpiryOp(int expirationPercentage, PartitionContainer container) { int partitionId = container.getPartitionId(); return new ClearExpiredOperation(expirationPercentage) .setNodeEngine(nodeEngine) .setCallerUuid(nodeEngine.getLocalMember().getUuid()) .setPartitionId(partitionId) .setValidateTarget(false) .setServiceName(SERVICE_NAME); }
@Override public void run() throws Exception { for (Operation op : opList) { op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId()); op.beforeRun(); op.run(); op.afterRun(); } // changed to forceUnlock because replica-sync of lock causes problems, same as IMap // real solution is to make 'lock-and-get' backup-aware getOrCreateContainerWithoutAccess().forceUnlock(dataKey); }
@Override public void run() throws Exception { for (Operation op : opList) { op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId()); op.beforeRun(); op.run(); op.afterRun(); } // changed to forceUnlock because replica-sync of lock causes problems, same as IMap // real solution is to make 'lock-and-get' backup-aware getOrCreateContainerWithoutAccess().forceUnlock(dataKey); }
public static void before(List<Operation> operationList, Operation wrapper) throws Exception { for (Operation operation : operationList) { operation.setService(wrapper.getService()); operation.setServiceName(wrapper.getServiceName()); operation.setCallerUuid(wrapper.getCallerUuid()); operation.setNodeEngine(wrapper.getNodeEngine()); operation.setPartitionId(wrapper.getPartitionId()); operation.beforeRun(); } }
public static void before(List<Operation> operationList, Operation wrapper) throws Exception { for (Operation operation : operationList) { operation.setService(wrapper.getService()); operation.setServiceName(wrapper.getServiceName()); operation.setCallerUuid(wrapper.getCallerUuid()); operation.setNodeEngine(wrapper.getNodeEngine()); operation.setPartitionId(wrapper.getPartitionId()); operation.beforeRun(); } }
@Override public void run() throws Exception { for (Operation op : opList) { op.setNodeEngine(getNodeEngine()) .setServiceName(getServiceName()) .setPartitionId(getPartitionId()); op.beforeRun(); op.run(); op.afterRun(); } getOrCreateContainer().unlock(dataKey, getCallerUuid(), threadId, getCallId()); }
@Override public void run() throws Exception { for (Operation op : opList) { op.setNodeEngine(getNodeEngine()) .setServiceName(getServiceName()) .setPartitionId(getPartitionId()); op.beforeRun(); op.run(); op.afterRun(); } getOrCreateContainer().unlock(dataKey, getCallerUuid(), threadId, getCallId()); }
protected void sendUpdateCallerOperation(boolean isRemove) { OperationService operationService = getNodeEngine().getOperationService(); Operation op = new ReplicateUpdateToCallerOperation(name, getCallId(), key, value, response, ttl, isRemove) .setPartitionId(getPartitionId()) .setValidateTarget(false) .setServiceName(getServiceName()); operationService .createInvocationBuilder(getServiceName(), op, getCallerAddress()) .setTryCount(INVOCATION_TRY_COUNT) .invoke(); }
protected void sendUpdateCallerOperation(boolean isRemove) { OperationService operationService = getNodeEngine().getOperationService(); Operation op = new ReplicateUpdateToCallerOperation(name, getCallId(), key, value, response, ttl, isRemove) .setPartitionId(getPartitionId()) .setValidateTarget(false) .setServiceName(getServiceName()); operationService .createInvocationBuilder(getServiceName(), op, getCallerAddress()) .setTryCount(INVOCATION_TRY_COUNT) .invoke(); }
private void executeNotifyOperation(Sequence flushSequence) { if (!flushSequence.isFullFlush() || !nodeEngine.getPartitionService().isPartitionOwner(partitionId)) { return; } Operation operation = new NotifyMapFlushOperation(mapName, flushSequence.getSequence()); operation.setServiceName(SERVICE_NAME) .setNodeEngine(nodeEngine) .setPartitionId(partitionId) .setCallerUuid(nodeEngine.getLocalMember().getUuid()) .setOperationResponseHandler(createEmptyResponseHandler()); operationService.execute(operation); }