Search in sources :

Example 6 with FragmentedMigrationAwareService

use of com.hazelcast.internal.partition.FragmentedMigrationAwareService in project hazelcast by hazelcast.

the class AbstractPartitionOperation method createReplicationOperations.

private Collection<Operation> createReplicationOperations(PartitionReplicationEvent event, boolean nonFragmentedOnly) {
    Collection<Operation> operations = new ArrayList<>();
    NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
    Collection<ServiceInfo> services = nodeEngine.getServiceInfos(MigrationAwareService.class);
    for (ServiceInfo serviceInfo : services) {
        MigrationAwareService service = serviceInfo.getService();
        if (nonFragmentedOnly && service instanceof FragmentedMigrationAwareService) {
            // skip fragmented services
            continue;
        }
        Operation op = service.prepareReplicationOperation(event);
        if (op != null) {
            op.setServiceName(serviceInfo.getName());
            operations.add(op);
        }
    }
    return operations;
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) ServiceInfo(com.hazelcast.spi.impl.servicemanager.ServiceInfo) ArrayList(java.util.ArrayList) MigrationAwareService(com.hazelcast.internal.partition.MigrationAwareService) ChunkedMigrationAwareService(com.hazelcast.internal.partition.ChunkedMigrationAwareService) FragmentedMigrationAwareService(com.hazelcast.internal.partition.FragmentedMigrationAwareService) Operation(com.hazelcast.spi.impl.operationservice.Operation) FragmentedMigrationAwareService(com.hazelcast.internal.partition.FragmentedMigrationAwareService)

Aggregations

FragmentedMigrationAwareService (com.hazelcast.internal.partition.FragmentedMigrationAwareService)6 Operation (com.hazelcast.spi.impl.operationservice.Operation)5 NonFragmentedServiceNamespace (com.hazelcast.internal.partition.NonFragmentedServiceNamespace)4 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)4 ServiceInfo (com.hazelcast.spi.impl.servicemanager.ServiceInfo)3 ChunkedMigrationAwareService (com.hazelcast.internal.partition.ChunkedMigrationAwareService)1 MigrationAwareService (com.hazelcast.internal.partition.MigrationAwareService)1 PartitionReplicationEvent (com.hazelcast.internal.partition.PartitionReplicationEvent)1 ServiceNamespace (com.hazelcast.internal.services.ServiceNamespace)1 ServiceNamespaceAware (com.hazelcast.internal.services.ServiceNamespaceAware)1 ILogger (com.hazelcast.logging.ILogger)1 BackupAwareOperation (com.hazelcast.spi.impl.operationservice.BackupAwareOperation)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1