Search in sources :

Example 11 with UnmodifiableLazyList

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

the class ClientReplicatedMapProxy method values.

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

Example 12 with UnmodifiableLazyList

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

the class ClientTxnMultiMapProxy method get.

@Override
public Collection<V> get(K key) {
    ClientMessage request = TransactionalMultiMapGetCodec.encodeRequest(name, getTransactionId(), getThreadId(), toData(key));
    ClientMessage response = invoke(request);
    List<Data> collection = TransactionalMultiMapGetCodec.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 13 with UnmodifiableLazyList

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

the class ListProxyImpl method subList.

@Override
public List<E> subList(int fromIndex, int toIndex) {
    ListSubOperation operation = new ListSubOperation(name, fromIndex, toIndex);
    SerializableList result = invoke(operation);
    List<Data> collection = result.getCollection();
    SerializationService serializationService = getNodeEngine().getSerializationService();
    return new UnmodifiableLazyList<E>(collection, serializationService);
}
Also used : ListSubOperation(com.hazelcast.collection.impl.list.operations.ListSubOperation) SerializableList(com.hazelcast.spi.impl.SerializableList) SerializationService(com.hazelcast.spi.serialization.SerializationService) Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList)

Example 14 with UnmodifiableLazyList

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

the class ClientListProxy method getAll.

private Collection<E> getAll() {
    ClientMessage request = ListGetAllCodec.encodeRequest(name);
    ClientMessage response = invokeOnPartition(request);
    ListGetAllCodec.ResponseParameters resultParameters = ListGetAllCodec.decodeResponse(response);
    return new UnmodifiableLazyList<E>(resultParameters.response, getSerializationService());
}
Also used : ListGetAllCodec(com.hazelcast.client.impl.protocol.codec.ListGetAllCodec) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 15 with UnmodifiableLazyList

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

the class ClientListProxy method subList.

@Override
public List<E> subList(int fromIndex, int toIndex) {
    ClientMessage request = ListSubCodec.encodeRequest(name, fromIndex, toIndex);
    ClientMessage response = invokeOnPartition(request);
    ListSubCodec.ResponseParameters resultParameters = ListSubCodec.decodeResponse(response);
    List<Data> resultCollection = resultParameters.response;
    SerializationService serializationService = getContext().getSerializationService();
    return new UnmodifiableLazyList<E>(resultCollection, serializationService);
}
Also used : ListSubCodec(com.hazelcast.client.impl.protocol.codec.ListSubCodec) SerializationService(com.hazelcast.spi.serialization.SerializationService) Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Aggregations

UnmodifiableLazyList (com.hazelcast.spi.impl.UnmodifiableLazyList)16 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)14 Data (com.hazelcast.nio.serialization.Data)8 SerializationService (com.hazelcast.spi.serialization.SerializationService)4 SerializableList (com.hazelcast.spi.impl.SerializableList)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 MapValuesWithPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapValuesWithPredicateCodec)1 MultiMapGetCodec (com.hazelcast.client.impl.protocol.codec.MultiMapGetCodec)1 MultiMapRemoveCodec (com.hazelcast.client.impl.protocol.codec.MultiMapRemoveCodec)1 MultiMapValuesCodec (com.hazelcast.client.impl.protocol.codec.MultiMapValuesCodec)1 ReplicatedMapValuesCodec (com.hazelcast.client.impl.protocol.codec.ReplicatedMapValuesCodec)1 SetGetAllCodec (com.hazelcast.client.impl.protocol.codec.SetGetAllCodec)1 CollectionGetAllOperation (com.hazelcast.collection.impl.collection.operations.CollectionGetAllOperation)1 ListSubOperation (com.hazelcast.collection.impl.list.operations.ListSubOperation)1 PagingPredicate (com.hazelcast.query.PagingPredicate)1 ArrayList (java.util.ArrayList)1