Search in sources :

Example 6 with UnmodifiableLazySet

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

the class ClientMapProxy method keySetWithPagingPredicate.

@SuppressWarnings("unchecked")
private Set keySetWithPagingPredicate(Predicate predicate) {
    PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate);
    pagingPredicate.setIterationType(IterationType.KEY);
    PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(predicate, getSerializationService());
    ClientMessage request = MapKeySetWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder);
    ClientMessage response = invokeWithPredicate(request, predicate);
    MapKeySetWithPagingPredicateCodec.ResponseParameters resultParameters = MapKeySetWithPagingPredicateCodec.decodeResponse(response);
    SerializationService serializationService = getSerializationService();
    pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(serializationService));
    return new UnmodifiableLazySet(resultParameters.response, serializationService);
}
Also used : PagingPredicateHolder(com.hazelcast.client.impl.protocol.codec.holder.PagingPredicateHolder) MapKeySetWithPagingPredicateCodec(com.hazelcast.client.impl.protocol.codec.MapKeySetWithPagingPredicateCodec) SerializationService(com.hazelcast.internal.serialization.SerializationService) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) UnmodifiableLazySet(com.hazelcast.spi.impl.UnmodifiableLazySet) PagingPredicateImpl(com.hazelcast.query.impl.predicates.PagingPredicateImpl)

Example 7 with UnmodifiableLazySet

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

the class ClientMultiMapProxy method entrySet.

@Nonnull
@Override
public Set<Map.Entry<K, V>> entrySet() {
    ClientMessage request = MultiMapEntrySetCodec.encodeRequest(name);
    ClientMessage response = invoke(request);
    return (Set) new UnmodifiableLazySet(MultiMapEntrySetCodec.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)

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