Search in sources :

Example 1 with UnmodifiableLazySet

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

the class ClientReplicatedMapProxy method keySet.

@Nonnull
@Override
@SuppressWarnings("unchecked")
public Set<K> keySet() {
    ClientMessage request = ReplicatedMapKeySetCodec.encodeRequest(name);
    ClientMessage response = invokeOnPartition(request, targetPartitionId);
    return (Set<K>) new UnmodifiableLazySet(ReplicatedMapKeySetCodec.decodeResponse(response), getSerializationService());
}
Also used : Set(java.util.Set) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) Nonnull(javax.annotation.Nonnull)

Example 2 with UnmodifiableLazySet

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

the class ClientReplicatedMapProxy method entrySet.

@Nonnull
@Override
@SuppressWarnings("unchecked")
public Set<Entry<K, V>> entrySet() {
    ClientMessage request = ReplicatedMapEntrySetCodec.encodeRequest(name);
    ClientMessage response = invokeOnPartition(request, targetPartitionId);
    return (Set) new UnmodifiableLazySet(ReplicatedMapEntrySetCodec.decodeResponse(response), getSerializationService());
}
Also used : Set(java.util.Set) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) Nonnull(javax.annotation.Nonnull)

Example 3 with UnmodifiableLazySet

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

the class ClientMapProxy method keySet.

@Nonnull
@Override
public Set<K> keySet() {
    ClientMessage request = MapKeySetCodec.encodeRequest(name);
    ClientMessage response = invoke(request);
    return (Set<K>) new UnmodifiableLazySet(MapKeySetCodec.decodeResponse(response), getSerializationService());
}
Also used : Set(java.util.Set) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) ReadResultSet(com.hazelcast.ringbuffer.ReadResultSet) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) Nonnull(javax.annotation.Nonnull)

Example 4 with UnmodifiableLazySet

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

the class ClientMultiMapProxy method keySet.

@Nonnull
@Override
public Set<K> keySet() {
    ClientMessage request = MultiMapKeySetCodec.encodeRequest(name);
    ClientMessage response = invoke(request);
    return (Set<K>) new UnmodifiableLazySet(MultiMapKeySetCodec.decodeResponse(response), getSerializationService());
}
Also used : Set(java.util.Set) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) Nonnull(javax.annotation.Nonnull)

Example 5 with UnmodifiableLazySet

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

the class ClientMapProxy method keySet.

@SuppressWarnings("unchecked")
@Override
public Set<K> keySet(@Nonnull Predicate<K, V> predicate) {
    checkNotNull(predicate, NULL_PREDICATE_IS_NOT_ALLOWED);
    if (containsPagingPredicate(predicate)) {
        return keySetWithPagingPredicate(predicate);
    }
    ClientMessage request = MapKeySetWithPredicateCodec.encodeRequest(name, toData(predicate));
    ClientMessage response = invokeWithPredicate(request, predicate);
    return (Set<K>) new UnmodifiableLazySet(MapKeySetWithPredicateCodec.decodeResponse(response), getSerializationService());
}
Also used : Set(java.util.Set) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) ReadResultSet(com.hazelcast.ringbuffer.ReadResultSet) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet)

Aggregations

ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)7 UnmodifiableLazySet (com.hazelcast.spi.impl.UnmodifiableLazySet)7 Set (java.util.Set)6 Nonnull (javax.annotation.Nonnull)5 ReadResultSet (com.hazelcast.ringbuffer.ReadResultSet)2 MapKeySetWithPagingPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapKeySetWithPagingPredicateCodec)1 PagingPredicateHolder (com.hazelcast.client.impl.protocol.codec.holder.PagingPredicateHolder)1 SerializationService (com.hazelcast.internal.serialization.SerializationService)1 PagingPredicateImpl (com.hazelcast.query.impl.predicates.PagingPredicateImpl)1