Search in sources :

Example 1 with UnmodifiableLazyList

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

the class ClientTxnMultiMapProxy method remove.

@Override
public Collection<V> remove(Object key) {
    ClientMessage request = TransactionalMultiMapRemoveCodec.encodeRequest(name, getTransactionId(), getThreadId(), toData(key));
    ClientMessage response = invoke(request);
    List<Data> collection = TransactionalMultiMapRemoveCodec.decodeResponse(response).response;
    return new UnmodifiableLazyList<V>(collection, getSerializationService());
}
Also used : Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 2 with UnmodifiableLazyList

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

the class ClientMultiMapProxy method remove.

@Override
public Collection<V> remove(Object key) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    Data keyData = toData(key);
    ClientMessage request = MultiMapRemoveCodec.encodeRequest(name, keyData, ThreadUtil.getThreadId());
    ClientMessage response = invoke(request, keyData);
    MultiMapRemoveCodec.ResponseParameters resultParameters = MultiMapRemoveCodec.decodeResponse(response);
    return new UnmodifiableLazyList<V>(resultParameters.response, getSerializationService());
}
Also used : MultiMapRemoveCodec(com.hazelcast.client.impl.protocol.codec.MultiMapRemoveCodec) Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 3 with UnmodifiableLazyList

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

the class ClientMapProxy method values.

@Override
public Collection<V> values() {
    ClientMessage request = MapValuesCodec.encodeRequest(name);
    ClientMessage response = invoke(request);
    MapValuesCodec.ResponseParameters resultParameters = MapValuesCodec.decodeResponse(response);
    return new UnmodifiableLazyList<V>(resultParameters.response, getSerializationService());
}
Also used : MapValuesCodec(com.hazelcast.client.impl.protocol.codec.MapValuesCodec) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 4 with UnmodifiableLazyList

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

the class ClientMapProxy method values.

@Override
public Collection<V> values(Predicate predicate) {
    checkNotNull(predicate, NULL_PREDICATE_IS_NOT_ALLOWED);
    if (predicate instanceof PagingPredicate) {
        return valuesForPagingPredicate((PagingPredicate) predicate);
    }
    ClientMessage request = MapValuesWithPredicateCodec.encodeRequest(name, toData(predicate));
    ClientMessage response = invoke(request);
    MapValuesWithPredicateCodec.ResponseParameters resultParameters = MapValuesWithPredicateCodec.decodeResponse(response);
    return new UnmodifiableLazyList<V>(resultParameters.response, getSerializationService());
}
Also used : PagingPredicate(com.hazelcast.query.PagingPredicate) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) MapValuesWithPredicateCodec(com.hazelcast.client.impl.protocol.codec.MapValuesWithPredicateCodec)

Example 5 with UnmodifiableLazyList

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

the class ClientMapProxy method project.

@Override
public <R> Collection<R> project(Projection<Entry<K, V>, R> projection) {
    ClientMessage request = MapProjectCodec.encodeRequest(name, toData(projection));
    ClientMessage response = invoke(request);
    MapProjectCodec.ResponseParameters resultParameters = MapProjectCodec.decodeResponse(response);
    return new UnmodifiableLazyList<R>(resultParameters.response, getSerializationService());
}
Also used : MapProjectCodec(com.hazelcast.client.impl.protocol.codec.MapProjectCodec) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Aggregations

UnmodifiableLazyList (com.hazelcast.spi.impl.UnmodifiableLazyList)34 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)30 Data (com.hazelcast.internal.serialization.Data)9 Data (com.hazelcast.nio.serialization.Data)6 Nonnull (javax.annotation.Nonnull)4 SerializationService (com.hazelcast.internal.serialization.SerializationService)3 ArrayList (java.util.ArrayList)3 CollectionUtil.objectToDataCollection (com.hazelcast.internal.util.CollectionUtil.objectToDataCollection)2 SerializableList (com.hazelcast.spi.impl.SerializableList)2 SerializationService (com.hazelcast.spi.serialization.SerializationService)2 Collection (java.util.Collection)2 List (java.util.List)2 ListIterator (java.util.ListIterator)2 ListGetAllCodec (com.hazelcast.client.impl.protocol.codec.ListGetAllCodec)1 ListSubCodec (com.hazelcast.client.impl.protocol.codec.ListSubCodec)1 MapProjectCodec (com.hazelcast.client.impl.protocol.codec.MapProjectCodec)1 MapProjectWithPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapProjectWithPredicateCodec)1 MapValuesCodec (com.hazelcast.client.impl.protocol.codec.MapValuesCodec)1 MapValuesWithPagingPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapValuesWithPagingPredicateCodec)1 MapValuesWithPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapValuesWithPredicateCodec)1