use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class LockEvictionProcessor method submit.
private void submit(UnlockOperation operation, Data key) {
int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
OperationService operationService = nodeEngine.getOperationService();
operation.setPartitionId(partitionId);
operation.setOperationResponseHandler(unlockResponseHandler);
operation.setValidateTarget(false);
operation.setAsyncBackup(true);
operationService.invokeOnTarget(SERVICE_NAME, operation, nodeEngine.getThisAddress());
}
use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class PartitionReplicaSyncRequestOffloadable method readReplicaVersions.
private void readReplicaVersions() {
InternalPartitionServiceImpl partitionService = getService();
OperationService operationService = getNodeEngine().getOperationService();
PartitionReplicaVersionManager versionManager = partitionService.getPartitionReplicaVersionManager();
UrgentPartitionRunnable<Void> gatherReplicaVersionsRunnable = new UrgentPartitionRunnable<>(partitionId(), () -> {
for (ServiceNamespace ns : namespaces) {
// make a copy because
// getPartitionReplicaVersions
// returns references to the internal
// replica versions data structures
// that may change under our feet
long[] versions = Arrays.copyOf(versionManager.getPartitionReplicaVersions(partitionId(), ns), IPartition.MAX_BACKUP_COUNT);
replicaVersions.put(BiTuple.of(partitionId(), ns), versions);
}
});
operationService.execute(gatherReplicaVersionsRunnable);
gatherReplicaVersionsRunnable.future.joinInternal();
}
use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class PartitionReplicaSyncRequest method sendResponse.
/**
* Send a synchronization response to the caller replica containing the replication operations to be executed
*/
private void sendResponse(Collection<Operation> operations, Collection<ChunkSupplier> chunkSuppliers, ServiceNamespace ns) {
NodeEngine nodeEngine = getNodeEngine();
PartitionReplicaSyncResponse syncResponse = createResponse(operations, chunkSuppliers, ns);
Address target = getCallerAddress();
ILogger logger = getLogger();
if (logger.isFinestEnabled()) {
logger.finest("Sending sync response to -> " + target + " for partitionId=" + partitionId() + ", replicaIndex=" + getReplicaIndex() + ", namespaces=" + ns);
}
// PartitionReplicaSyncResponse is TargetAware and sent directly without invocation system.
syncResponse.setTarget(target);
OperationService operationService = nodeEngine.getOperationService();
operationService.send(syncResponse, target);
}
use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class MapNearCacheManager method createRepairingInvalidationTask.
private RepairingTask createRepairingInvalidationTask() {
ExecutionService executionService = nodeEngine.getExecutionService();
ClusterService clusterService = nodeEngine.getClusterService();
OperationService operationService = nodeEngine.getOperationService();
HazelcastProperties properties = nodeEngine.getProperties();
ILogger metadataFetcherLogger = nodeEngine.getLogger(MemberMapInvalidationMetaDataFetcher.class);
InvalidationMetaDataFetcher invalidationMetaDataFetcher = new MemberMapInvalidationMetaDataFetcher(clusterService, operationService, metadataFetcherLogger);
ILogger repairingTaskLogger = nodeEngine.getLogger(RepairingTask.class);
UUID localUuid = nodeEngine.getLocalMember().getUuid();
return new RepairingTask(properties, invalidationMetaDataFetcher, executionService.getGlobalTaskScheduler(), serializationService, partitionService, localUuid, repairingTaskLogger);
}
use of com.hazelcast.spi.impl.operationservice.OperationService in project hazelcast by hazelcast.
the class ReplicatedMapProxy method clear.
@Override
public void clear() {
OperationService operationService = nodeEngine.getOperationService();
try {
Map<Integer, Object> results = operationService.invokeOnAllPartitions(SERVICE_NAME, new ClearOperationFactory(name));
int deletedEntrySize = 0;
for (Object deletedEntryPerPartition : results.values()) {
deletedEntrySize += (Integer) deletedEntryPerPartition;
}
eventPublishingService.fireMapClearedEvent(deletedEntrySize, name);
} catch (Throwable t) {
throw rethrow(t);
}
}
Aggregations