use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class MapProxySupport method removeMapInterceptorInternal.
public void removeMapInterceptorInternal(String id) {
NodeEngine nodeEngine = getNodeEngine();
mapServiceContext.removeInterceptor(name, id);
Collection<Member> members = nodeEngine.getClusterService().getMembers();
for (Member member : members) {
try {
if (member.localMember()) {
continue;
}
RemoveInterceptorOperation op = new RemoveInterceptorOperation(name, id);
Future future = operationService.invokeOnTarget(SERVICE_NAME, op, member.getAddress());
future.get();
} catch (Throwable t) {
throw rethrow(t);
}
}
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class AbstractPromotionOperation method sendMigrationEvent.
void sendMigrationEvent(final MigrationStatus status) {
final int partitionId = getPartitionId();
final NodeEngine nodeEngine = getNodeEngine();
final Member localMember = nodeEngine.getLocalMember();
final MigrationEvent event = new MigrationEvent(partitionId, null, localMember, status);
final EventService eventService = nodeEngine.getEventService();
final Collection<EventRegistration> registrations = eventService.getRegistrations(SERVICE_NAME, MIGRATION_EVENT_TOPIC);
eventService.publishEvent(SERVICE_NAME, registrations, event, partitionId);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ReplicaSyncRequest method createResponse.
private ReplicaSyncResponse createResponse(List<Operation> data) throws IOException {
int partitionId = getPartitionId();
NodeEngine nodeEngine = getNodeEngine();
InternalPartitionService partitionService = (InternalPartitionService) nodeEngine.getPartitionService();
long[] replicaVersions = partitionService.getPartitionReplicaVersions(partitionId);
ReplicaSyncResponse syncResponse = new ReplicaSyncResponse(data, replicaVersions);
syncResponse.setPartitionId(partitionId).setReplicaIndex(getReplicaIndex());
return syncResponse;
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ReplicaSyncRequest method sendResponse.
/** Send a synchronization response to the caller replica containing the replication operations to be executed */
private void sendResponse(List<Operation> data) throws IOException {
NodeEngine nodeEngine = getNodeEngine();
ReplicaSyncResponse syncResponse = createResponse(data);
Address target = getCallerAddress();
ILogger logger = getLogger();
if (logger.isFinestEnabled()) {
logger.finest("Sending sync response to -> " + target + " for partitionId=" + getPartitionId() + ", replicaIndex=" + getReplicaIndex());
}
OperationService operationService = nodeEngine.getOperationService();
operationService.send(syncResponse, target);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ReplicaSyncResponse method prepareOperation.
private void prepareOperation(Operation op) {
int partitionId = getPartitionId();
int replicaIndex = getReplicaIndex();
NodeEngine nodeEngine = getNodeEngine();
ILogger opLogger = nodeEngine.getLogger(op.getClass());
OperationResponseHandler responseHandler = createErrorLoggingResponseHandler(opLogger);
op.setNodeEngine(nodeEngine).setPartitionId(partitionId).setReplicaIndex(replicaIndex).setOperationResponseHandler(responseHandler);
}
Aggregations