Search in sources :

Example 41 with ClusterServiceImpl

use of com.hazelcast.internal.cluster.impl.ClusterServiceImpl in project hazelcast by hazelcast.

the class InternalPartitionServiceImpl method firePartitionStateOperation.

private List<Future<Boolean>> firePartitionStateOperation(Collection<MemberImpl> members, PartitionRuntimeState partitionState, OperationService operationService) {
    final ClusterServiceImpl clusterService = node.clusterService;
    List<Future<Boolean>> calls = new ArrayList<Future<Boolean>>(members.size());
    for (MemberImpl member : members) {
        if (!(member.localMember() || clusterService.isMemberRemovedWhileClusterIsNotActive(member.getAddress()))) {
            try {
                Address address = member.getAddress();
                PartitionStateOperation operation = new PartitionStateOperation(partitionState, true);
                Future<Boolean> f = operationService.invokeOnTarget(SERVICE_NAME, operation, address);
                calls.add(f);
            } catch (Exception e) {
                logger.finest(e);
            }
        }
    }
    return calls;
}
Also used : Address(com.hazelcast.nio.Address) MemberImpl(com.hazelcast.instance.MemberImpl) ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) ArrayList(java.util.ArrayList) Future(java.util.concurrent.Future) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) FetchPartitionStateOperation(com.hazelcast.internal.partition.operation.FetchPartitionStateOperation) PartitionStateOperation(com.hazelcast.internal.partition.operation.PartitionStateOperation) HazelcastInstanceNotActiveException(com.hazelcast.core.HazelcastInstanceNotActiveException) TargetNotMemberException(com.hazelcast.spi.exception.TargetNotMemberException) NoDataMemberInClusterException(com.hazelcast.partition.NoDataMemberInClusterException) MemberLeftException(com.hazelcast.core.MemberLeftException) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ClusterServiceImpl (com.hazelcast.internal.cluster.impl.ClusterServiceImpl)41 Node (com.hazelcast.instance.Node)13 Address (com.hazelcast.nio.Address)13 ILogger (com.hazelcast.logging.ILogger)9 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)8 ClusterState (com.hazelcast.cluster.ClusterState)6 MemberImpl (com.hazelcast.instance.MemberImpl)5 HazelcastInstance (com.hazelcast.core.HazelcastInstance)4 OperationService (com.hazelcast.spi.OperationService)4 Member (com.hazelcast.core.Member)3 MemberLeftException (com.hazelcast.core.MemberLeftException)3 ClusterStateManager (com.hazelcast.internal.cluster.impl.ClusterStateManager)3 Config (com.hazelcast.config.Config)2 InternalPartition (com.hazelcast.internal.partition.InternalPartition)2 Connection (com.hazelcast.nio.Connection)2 Operation (com.hazelcast.spi.Operation)2 InternalOperationService (com.hazelcast.spi.impl.operationservice.InternalOperationService)2 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)2 ParallelTest (com.hazelcast.test.annotation.ParallelTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2