use of com.hazelcast.spi.PartitionReplicationEvent in project hazelcast by hazelcast.
the class MigrationRequestOperation method prepareMigrationOperations.
private Collection<Operation> prepareMigrationOperations() {
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
PartitionReplicationEvent replicationEvent = new PartitionReplicationEvent(migrationInfo.getPartitionId(), migrationInfo.getDestinationNewReplicaIndex());
Collection<Operation> tasks = new LinkedList<Operation>();
for (ServiceInfo serviceInfo : nodeEngine.getServiceInfos(MigrationAwareService.class)) {
MigrationAwareService service = (MigrationAwareService) serviceInfo.getService();
Operation op = service.prepareReplicationOperation(replicationEvent);
if (op != null) {
op.setServiceName(serviceInfo.getName());
tasks.add(op);
}
}
return tasks;
}
use of com.hazelcast.spi.PartitionReplicationEvent in project hazelcast by hazelcast.
the class ReplicaSyncRequest method createReplicationOperations.
private List<Operation> createReplicationOperations() {
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
Collection<ServiceInfo> services = nodeEngine.getServiceInfos(MigrationAwareService.class);
PartitionReplicationEvent event = new PartitionReplicationEvent(getPartitionId(), getReplicaIndex());
List<Operation> tasks = new LinkedList<Operation>();
for (ServiceInfo serviceInfo : services) {
MigrationAwareService service = (MigrationAwareService) serviceInfo.getService();
Operation op = service.prepareReplicationOperation(event);
if (op != null) {
op.setServiceName(serviceInfo.getName());
tasks.add(op);
}
}
return tasks;
}
Aggregations