use of com.hazelcast.spi.OperationService in project hazelcast by hazelcast.
the class ManagementCenterService method callOnAddress.
public Object callOnAddress(Address address, Operation operation) {
// TODO: why are we always executing on the MapService?
OperationService operationService = instance.node.nodeEngine.getOperationService();
Future future = operationService.invokeOnTarget(MapService.SERVICE_NAME, operation, address);
try {
return future.get();
} catch (Throwable t) {
return ExceptionUtil.toString(t);
}
}
use of com.hazelcast.spi.OperationService in project hazelcast by hazelcast.
the class ManagementCenterService method send.
public void send(Address address, Operation operation) {
OperationService operationService = instance.node.nodeEngine.getOperationService();
operationService.createInvocationBuilder(MapService.SERVICE_NAME, operation, address).invoke();
}
use of com.hazelcast.spi.OperationService in project hazelcast by hazelcast.
the class MasterConfirmationOperation method run.
@Override
public void run() {
final Address endpoint = getCallerAddress();
if (endpoint == null) {
return;
}
final ClusterServiceImpl clusterService = getService();
final ILogger logger = getLogger();
final MemberImpl member = clusterService.getMember(endpoint);
if (member == null) {
logger.warning("MasterConfirmation has been received from " + endpoint + ", but it is not a member of this cluster!");
OperationService operationService = getNodeEngine().getOperationService();
operationService.send(new MemberRemoveOperation(clusterService.getThisAddress()), endpoint);
} else {
if (clusterService.isMaster()) {
clusterService.getClusterHeartbeatManager().acceptMasterConfirmation(member, timestamp);
} else {
logger.warning(endpoint + " has sent MasterConfirmation, but this node is not master!");
}
}
}
use of com.hazelcast.spi.OperationService in project hazelcast by hazelcast.
the class ReplicaSyncRequest method sendRetryResponse.
/** Send a response to the replica to retry the replica sync */
private void sendRetryResponse() {
NodeEngine nodeEngine = getNodeEngine();
int partitionId = getPartitionId();
int replicaIndex = getReplicaIndex();
ReplicaSyncRetryResponse response = new ReplicaSyncRetryResponse();
response.setPartitionId(partitionId).setReplicaIndex(replicaIndex);
Address target = getCallerAddress();
OperationService operationService = nodeEngine.getOperationService();
operationService.send(response, target);
}
use of com.hazelcast.spi.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 logger = nodeEngine.getLogger(RepairingTask.class);
MetaDataFetcher metaDataFetcher = new MemberMapMetaDataFetcher(clusterService, operationService, logger);
String localUuid = nodeEngine.getLocalMember().getUuid();
return new RepairingTask(metaDataFetcher, executionService.getGlobalTaskScheduler(), partitionService, properties, localUuid, logger);
}
Aggregations