Search in sources :

Example 1 with PagingPredicateHolder

use of com.hazelcast.client.impl.protocol.codec.holder.PagingPredicateHolder 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 2 with PagingPredicateHolder

use of com.hazelcast.client.impl.protocol.codec.holder.PagingPredicateHolder in project hazelcast by hazelcast.

the class ClientMapProxy method entrySetWithPagingPredicate.

private Set entrySetWithPagingPredicate(Predicate predicate) {
    PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate);
    pagingPredicate.setIterationType(IterationType.ENTRY);
    PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(predicate, getSerializationService());
    ClientMessage request = MapEntriesWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder);
    ClientMessage response = invokeWithPredicate(request, predicate);
    MapEntriesWithPagingPredicateCodec.ResponseParameters resultParameters = MapEntriesWithPagingPredicateCodec.decodeResponse(response);
    pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(getSerializationService()));
    return getEntriesAsImmutableLazySet(resultParameters.response);
}
Also used : PagingPredicateHolder(com.hazelcast.client.impl.protocol.codec.holder.PagingPredicateHolder) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) MapEntriesWithPagingPredicateCodec(com.hazelcast.client.impl.protocol.codec.MapEntriesWithPagingPredicateCodec) PagingPredicateImpl(com.hazelcast.query.impl.predicates.PagingPredicateImpl)

Example 3 with PagingPredicateHolder

use of com.hazelcast.client.impl.protocol.codec.holder.PagingPredicateHolder in project hazelcast by hazelcast.

the class ClientMapProxy method valuesForPagingPredicate.

@SuppressWarnings("unchecked")
private Collection<V> valuesForPagingPredicate(Predicate predicate) {
    PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate);
    pagingPredicate.setIterationType(IterationType.VALUE);
    PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(predicate, getSerializationService());
    ClientMessage request = MapValuesWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder);
    ClientMessage response = invokeWithPredicate(request, predicate);
    MapValuesWithPagingPredicateCodec.ResponseParameters resultParameters = MapValuesWithPagingPredicateCodec.decodeResponse(response);
    SerializationService serializationService = getSerializationService();
    pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(serializationService));
    return (Collection<V>) new UnmodifiableLazyList(resultParameters.response, serializationService);
}
Also used : PagingPredicateHolder(com.hazelcast.client.impl.protocol.codec.holder.PagingPredicateHolder) SerializationService(com.hazelcast.internal.serialization.SerializationService) Collection(java.util.Collection) CollectionUtil.objectToDataCollection(com.hazelcast.internal.util.CollectionUtil.objectToDataCollection) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) MapValuesWithPagingPredicateCodec(com.hazelcast.client.impl.protocol.codec.MapValuesWithPagingPredicateCodec) PagingPredicateImpl(com.hazelcast.query.impl.predicates.PagingPredicateImpl)

Aggregations

ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)3 PagingPredicateHolder (com.hazelcast.client.impl.protocol.codec.holder.PagingPredicateHolder)3 PagingPredicateImpl (com.hazelcast.query.impl.predicates.PagingPredicateImpl)3 SerializationService (com.hazelcast.internal.serialization.SerializationService)2 MapEntriesWithPagingPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapEntriesWithPagingPredicateCodec)1 MapKeySetWithPagingPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapKeySetWithPagingPredicateCodec)1 MapValuesWithPagingPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapValuesWithPagingPredicateCodec)1 CollectionUtil.objectToDataCollection (com.hazelcast.internal.util.CollectionUtil.objectToDataCollection)1 UnmodifiableLazyList (com.hazelcast.spi.impl.UnmodifiableLazyList)1 UnmodifiableLazySet (com.hazelcast.spi.impl.UnmodifiableLazySet)1 Collection (java.util.Collection)1