Search in sources :

Example 36 with MemberImpl

use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.

the class MapPublisherCreateMessageTask method call.

@Override
protected Object call() throws Exception {
    ClusterService clusterService = clientEngine.getClusterService();
    Collection<MemberImpl> members = clusterService.getMemberImpls();
    List<Future> futures = new ArrayList<Future>(members.size());
    createInvocations(members, futures);
    return getQueryResults(futures);
}
Also used : ClusterService(com.hazelcast.internal.cluster.ClusterService) MemberImpl(com.hazelcast.instance.MemberImpl) ArrayList(java.util.ArrayList) Future(java.util.concurrent.Future)

Example 37 with MemberImpl

use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.

the class MapPublisherCreateWithValueMessageTask method call.

@Override
protected Object call() throws Exception {
    ClusterService clusterService = clientEngine.getClusterService();
    Collection<MemberImpl> members = clusterService.getMemberImpls();
    List<Future> futures = new ArrayList<Future>(members.size());
    createInvocations(members, futures);
    return getQueryResults(futures);
}
Also used : ClusterService(com.hazelcast.internal.cluster.ClusterService) MemberImpl(com.hazelcast.instance.MemberImpl) ArrayList(java.util.ArrayList) Future(java.util.concurrent.Future)

Example 38 with MemberImpl

use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.

the class CollectionService method dispatchEvent.

@Override
public void dispatchEvent(CollectionEvent event, ItemListener listener) {
    final MemberImpl member = nodeEngine.getClusterService().getMember(event.getCaller());
    ItemEvent itemEvent = new DataAwareItemEvent(event.getName(), event.getEventType(), event.getData(), member, nodeEngine.getSerializationService());
    if (member == null) {
        if (logger.isInfoEnabled()) {
            logger.info("Dropping event " + itemEvent + " from unknown address:" + event.getCaller());
        }
        return;
    }
    if (event.getEventType().equals(ItemEventType.ADDED)) {
        listener.itemAdded(itemEvent);
    } else {
        listener.itemRemoved(itemEvent);
    }
}
Also used : ItemEvent(com.hazelcast.core.ItemEvent) DataAwareItemEvent(com.hazelcast.collection.impl.common.DataAwareItemEvent) DataAwareItemEvent(com.hazelcast.collection.impl.common.DataAwareItemEvent) MemberImpl(com.hazelcast.instance.MemberImpl)

Example 39 with MemberImpl

use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.

the class LockServiceImpl method memberRemoved.

@Override
public void memberRemoved(MembershipServiceEvent event) {
    final MemberImpl member = event.getMember();
    final String uuid = member.getUuid();
    releaseLocksOwnedBy(uuid);
}
Also used : MemberImpl(com.hazelcast.instance.MemberImpl)

Example 40 with MemberImpl

use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.

the class MemberAttributeEvent method readData.

@Override
public void readData(ObjectDataInput in) throws IOException {
    key = in.readUTF();
    member = new MemberImpl();
    member.readData(in);
    operationType = MemberAttributeOperationType.getValue(in.readByte());
    if (operationType == PUT) {
        value = IOUtil.readAttributeValue(in);
    }
    this.source = member;
}
Also used : MemberImpl(com.hazelcast.instance.MemberImpl)

Aggregations

MemberImpl (com.hazelcast.instance.MemberImpl)86 Address (com.hazelcast.nio.Address)37 Test (org.junit.Test)18 Member (com.hazelcast.core.Member)17 QuickTest (com.hazelcast.test.annotation.QuickTest)16 ParallelTest (com.hazelcast.test.annotation.ParallelTest)14 ArrayList (java.util.ArrayList)12 InetAddress (java.net.InetAddress)9 Future (java.util.concurrent.Future)9 HashSet (java.util.HashSet)8 HazelcastInstance (com.hazelcast.core.HazelcastInstance)7 MemberInfo (com.hazelcast.internal.cluster.MemberInfo)7 ClusterService (com.hazelcast.internal.cluster.ClusterService)5 MemberInfoUpdateOperation (com.hazelcast.internal.cluster.impl.operations.MemberInfoUpdateOperation)5 PartitionRuntimeState (com.hazelcast.internal.partition.PartitionRuntimeState)5 ILogger (com.hazelcast.logging.ILogger)5 OperationService (com.hazelcast.spi.OperationService)5 InternalOperationService (com.hazelcast.spi.impl.operationservice.InternalOperationService)5 Before (org.junit.Before)5 ClusterServiceImpl (com.hazelcast.internal.cluster.impl.ClusterServiceImpl)4