Search in sources :

Example 36 with NodeEngine

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

the class ObjectMultiMapProxy method lock.

@Override
public void lock(K key, long leaseTime, TimeUnit timeUnit) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    checkPositive(leaseTime, "leaseTime should be positive");
    final NodeEngine nodeEngine = getNodeEngine();
    Data dataKey = nodeEngine.toData(key);
    lockSupport.lock(nodeEngine, dataKey, timeUnit.toMillis(leaseTime));
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) Data(com.hazelcast.nio.serialization.Data)

Example 37 with NodeEngine

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

the class ObjectMultiMapProxy method toObjectSet.

private Set<K> toObjectSet(Set<Data> dataSet) {
    final NodeEngine nodeEngine = getNodeEngine();
    Set<K> keySet = new HashSet<K>(dataSet.size());
    for (Data dataKey : dataSet) {
        keySet.add((K) nodeEngine.toObject(dataKey));
    }
    return keySet;
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) Data(com.hazelcast.nio.serialization.Data) HashSet(java.util.HashSet)

Example 38 with NodeEngine

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

the class ObjectMultiMapProxy method containsEntry.

@Override
public boolean containsEntry(K key, V value) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    checkNotNull(value, NULL_VALUE_IS_NOT_ALLOWED);
    final NodeEngine nodeEngine = getNodeEngine();
    Data dataKey = nodeEngine.toData(key);
    Data valueKey = nodeEngine.toData(value);
    return containsInternal(dataKey, valueKey);
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) Data(com.hazelcast.nio.serialization.Data)

Example 39 with NodeEngine

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

the class ObjectMultiMapProxy method containsValue.

@Override
public boolean containsValue(Object value) {
    checkNotNull(value, NULL_VALUE_IS_NOT_ALLOWED);
    final NodeEngine nodeEngine = getNodeEngine();
    Data valueKey = nodeEngine.toData(value);
    return containsInternal(null, valueKey);
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) Data(com.hazelcast.nio.serialization.Data)

Example 40 with NodeEngine

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

the class ObjectMultiMapProxy method lock.

@Override
public void lock(K key) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    final NodeEngine nodeEngine = getNodeEngine();
    Data dataKey = nodeEngine.toData(key);
    lockSupport.lock(nodeEngine, dataKey);
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) Data(com.hazelcast.nio.serialization.Data)

Aggregations

NodeEngine (com.hazelcast.spi.NodeEngine)157 Data (com.hazelcast.nio.serialization.Data)50 OperationService (com.hazelcast.spi.OperationService)30 Address (com.hazelcast.nio.Address)20 ILogger (com.hazelcast.logging.ILogger)14 Operation (com.hazelcast.spi.Operation)14 Member (com.hazelcast.core.Member)12 Future (java.util.concurrent.Future)12 InternalCompletableFuture (com.hazelcast.spi.InternalCompletableFuture)11 IPartitionService (com.hazelcast.spi.partition.IPartitionService)11 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)10 Test (org.junit.Test)10 InitializingObject (com.hazelcast.spi.InitializingObject)9 ParallelTest (com.hazelcast.test.annotation.ParallelTest)9 QuickTest (com.hazelcast.test.annotation.QuickTest)9 AbstractDistributedObject (com.hazelcast.spi.AbstractDistributedObject)8 HazelcastInstance (com.hazelcast.core.HazelcastInstance)7 InternalPartitionServiceImpl (com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl)7 Config (com.hazelcast.config.Config)6 ArrayList (java.util.ArrayList)6