Search in sources :

Example 1 with SplitBrainHandlerService

use of com.hazelcast.spi.SplitBrainHandlerService in project hazelcast by hazelcast.

the class ClusterMergeTask method collectMergeTasks.

private Collection<Runnable> collectMergeTasks() {
    // gather merge tasks from services
    Collection<SplitBrainHandlerService> services = node.nodeEngine.getServices(SplitBrainHandlerService.class);
    Collection<Runnable> tasks = new LinkedList<Runnable>();
    for (SplitBrainHandlerService service : services) {
        Runnable runnable = service.prepareMergeRunnable();
        if (runnable != null) {
            tasks.add(runnable);
        }
    }
    return tasks;
}
Also used : SplitBrainHandlerService(com.hazelcast.spi.SplitBrainHandlerService) LinkedList(java.util.LinkedList)

Example 2 with SplitBrainHandlerService

use of com.hazelcast.spi.SplitBrainHandlerService in project hazelcast by hazelcast.

the class AbstractMapServiceFactory method createMapService.

/**
     * Returns a {@link MapService} object by populating it with required
     * auxiliary services.
     *
     * @return {@link MapService} object
     */
@Override
public MapService createMapService() {
    MapServiceContext mapServiceContext = getMapServiceContext();
    ManagedService managedService = createManagedService();
    CountingMigrationAwareService migrationAwareService = createMigrationAwareService();
    TransactionalService transactionalService = createTransactionalService();
    RemoteService remoteService = createRemoteService();
    EventPublishingService eventPublishingService = createEventPublishingService();
    PostJoinAwareService postJoinAwareService = createPostJoinAwareService();
    SplitBrainHandlerService splitBrainHandlerService = createSplitBrainHandlerService();
    ReplicationSupportingService replicationSupportingService = createReplicationSupportingService();
    StatisticsAwareService statisticsAwareService = createStatisticsAwareService();
    PartitionAwareService partitionAwareService = createPartitionAwareService();
    QuorumAwareService quorumAwareService = createQuorumAwareService();
    ClientAwareService clientAwareService = createClientAwareService();
    checkNotNull(mapServiceContext, "mapServiceContext should not be null");
    checkNotNull(managedService, "managedService should not be null");
    checkNotNull(migrationAwareService, "migrationAwareService should not be null");
    checkNotNull(transactionalService, "transactionalService should not be null");
    checkNotNull(remoteService, "remoteService should not be null");
    checkNotNull(eventPublishingService, "eventPublishingService should not be null");
    checkNotNull(postJoinAwareService, "postJoinAwareService should not be null");
    checkNotNull(splitBrainHandlerService, "splitBrainHandlerService should not be null");
    checkNotNull(replicationSupportingService, "replicationSupportingService should not be null");
    checkNotNull(statisticsAwareService, "statisticsAwareService should not be null");
    checkNotNull(partitionAwareService, "partitionAwareService should not be null");
    checkNotNull(quorumAwareService, "quorumAwareService should not be null");
    checkNotNull(clientAwareService, "clientAwareService should not be null");
    MapService mapService = new MapService();
    mapService.managedService = managedService;
    mapService.migrationAwareService = migrationAwareService;
    mapService.transactionalService = transactionalService;
    mapService.remoteService = remoteService;
    mapService.eventPublishingService = eventPublishingService;
    mapService.postJoinAwareService = postJoinAwareService;
    mapService.splitBrainHandlerService = splitBrainHandlerService;
    mapService.replicationSupportingService = replicationSupportingService;
    mapService.statisticsAwareService = statisticsAwareService;
    mapService.mapServiceContext = mapServiceContext;
    mapService.partitionAwareService = partitionAwareService;
    mapService.quorumAwareService = quorumAwareService;
    mapService.clientAwareService = clientAwareService;
    mapServiceContext.setService(mapService);
    return mapService;
}
Also used : ManagedService(com.hazelcast.spi.ManagedService) StatisticsAwareService(com.hazelcast.spi.StatisticsAwareService) TransactionalService(com.hazelcast.spi.TransactionalService) QuorumAwareService(com.hazelcast.spi.QuorumAwareService) CountingMigrationAwareService(com.hazelcast.spi.impl.CountingMigrationAwareService) ClientAwareService(com.hazelcast.spi.ClientAwareService) PostJoinAwareService(com.hazelcast.spi.PostJoinAwareService) RemoteService(com.hazelcast.spi.RemoteService) ReplicationSupportingService(com.hazelcast.spi.ReplicationSupportingService) SplitBrainHandlerService(com.hazelcast.spi.SplitBrainHandlerService) PartitionAwareService(com.hazelcast.spi.PartitionAwareService) EventPublishingService(com.hazelcast.spi.EventPublishingService)

Aggregations

SplitBrainHandlerService (com.hazelcast.spi.SplitBrainHandlerService)2 ClientAwareService (com.hazelcast.spi.ClientAwareService)1 EventPublishingService (com.hazelcast.spi.EventPublishingService)1 ManagedService (com.hazelcast.spi.ManagedService)1 PartitionAwareService (com.hazelcast.spi.PartitionAwareService)1 PostJoinAwareService (com.hazelcast.spi.PostJoinAwareService)1 QuorumAwareService (com.hazelcast.spi.QuorumAwareService)1 RemoteService (com.hazelcast.spi.RemoteService)1 ReplicationSupportingService (com.hazelcast.spi.ReplicationSupportingService)1 StatisticsAwareService (com.hazelcast.spi.StatisticsAwareService)1 TransactionalService (com.hazelcast.spi.TransactionalService)1 CountingMigrationAwareService (com.hazelcast.spi.impl.CountingMigrationAwareService)1 LinkedList (java.util.LinkedList)1