Search in sources :

Example 21 with NodeEngine

use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.

the class MapClearExpiredOperation method isOwner.

private boolean isOwner() {
    final NodeEngine nodeEngine = getNodeEngine();
    final Address owner = nodeEngine.getPartitionService().getPartitionOwner(getPartitionId());
    return nodeEngine.getThisAddress().equals(owner);
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) Address(com.hazelcast.cluster.Address)

Example 22 with NodeEngine

use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.

the class ConsumeAccumulatorOperation method isLocal.

private boolean isLocal() {
    NodeEngine nodeEngine = getNodeEngine();
    IPartitionService partitionService = nodeEngine.getPartitionService();
    IPartition partition = partitionService.getPartition(getPartitionId());
    return partition.isLocal();
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) IPartitionService(com.hazelcast.internal.partition.IPartitionService) IPartition(com.hazelcast.internal.partition.IPartition)

Example 23 with NodeEngine

use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.

the class MultiMapProxyImpl method get.

@Nonnull
@Override
public Collection<V> get(@Nonnull K key) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    NodeEngine nodeEngine = getNodeEngine();
    Data dataKey = nodeEngine.toData(key);
    MultiMapResponse result = getAllInternal(dataKey);
    return result.getObjectCollection(nodeEngine);
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) MultiMapResponse(com.hazelcast.multimap.impl.operations.MultiMapResponse) Data(com.hazelcast.internal.serialization.Data) Nonnull(javax.annotation.Nonnull)

Example 24 with NodeEngine

use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.

the class MultiMapProxyImpl method values.

@Nonnull
@Override
public Collection<V> values() {
    NodeEngine nodeEngine = getNodeEngine();
    Map map = valuesInternal();
    Collection values = new LinkedList();
    for (Object obj : map.values()) {
        if (obj == null) {
            continue;
        }
        MultiMapResponse response = nodeEngine.toObject(obj);
        values.addAll(response.getObjectCollection(nodeEngine));
    }
    return values;
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) MultiMapResponse(com.hazelcast.multimap.impl.operations.MultiMapResponse) DataCollection(com.hazelcast.map.impl.DataCollection) Collection(java.util.Collection) InitializingObject(com.hazelcast.spi.impl.InitializingObject) HashMap(java.util.HashMap) MultiMap(com.hazelcast.multimap.MultiMap) Map(java.util.Map) LinkedList(java.util.LinkedList) Nonnull(javax.annotation.Nonnull)

Example 25 with NodeEngine

use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.

the class MultiMapProxyImpl method remove.

@Nonnull
@Override
public Collection<V> remove(@Nonnull Object key) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    NodeEngine nodeEngine = getNodeEngine();
    Data dataKey = nodeEngine.toData(key);
    MultiMapResponse result = removeInternal(dataKey);
    return result.getObjectCollection(nodeEngine);
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) MultiMapResponse(com.hazelcast.multimap.impl.operations.MultiMapResponse) Data(com.hazelcast.internal.serialization.Data) Nonnull(javax.annotation.Nonnull)

Aggregations

NodeEngine (com.hazelcast.spi.impl.NodeEngine)165 Data (com.hazelcast.internal.serialization.Data)48 OperationService (com.hazelcast.spi.impl.operationservice.OperationService)30 Address (com.hazelcast.cluster.Address)22 Test (org.junit.Test)21 ILogger (com.hazelcast.logging.ILogger)20 HazelcastInstance (com.hazelcast.core.HazelcastInstance)18 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)18 QuickTest (com.hazelcast.test.annotation.QuickTest)18 Config (com.hazelcast.config.Config)17 Operation (com.hazelcast.spi.impl.operationservice.Operation)16 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)15 IPartitionService (com.hazelcast.internal.partition.IPartitionService)12 Nonnull (javax.annotation.Nonnull)12 ArrayList (java.util.ArrayList)11 Future (java.util.concurrent.Future)11 Member (com.hazelcast.cluster.Member)10 UUID (java.util.UUID)10 InitializingObject (com.hazelcast.spi.impl.InitializingObject)9 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)9