Search in sources :

Example 1 with SerializableList

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

the class QueueProxySupport method listInternal.

List<Data> listInternal() {
    IteratorOperation operation = new IteratorOperation(name);
    SerializableList collectionContainer = invokeAndGet(operation);
    return (List<Data>) collectionContainer.getCollection();
}
Also used : IteratorOperation(com.hazelcast.collection.impl.queue.operations.IteratorOperation) SerializableList(com.hazelcast.spi.impl.SerializableList) SerializableList(com.hazelcast.spi.impl.SerializableList) List(java.util.List)

Example 2 with SerializableList

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

the class DrainOperation method run.

@Override
public void run() throws Exception {
    QueueContainer queueContainer = getContainer();
    dataMap = queueContainer.drain(maxSize);
    response = new SerializableList(new ArrayList<Data>(dataMap.values()));
}
Also used : SerializableList(com.hazelcast.spi.impl.SerializableList) QueueContainer(com.hazelcast.collection.impl.queue.QueueContainer) ArrayList(java.util.ArrayList)

Example 3 with SerializableList

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

the class QueueDrainMaxSizeMessageTask method encodeResponse.

@Override
protected ClientMessage encodeResponse(Object response) {
    SerializableList serializableList = (SerializableList) response;
    List<Data> coll = serializableList.getCollection();
    return QueueDrainToMaxSizeCodec.encodeResponse(coll);
}
Also used : SerializableList(com.hazelcast.spi.impl.SerializableList) Data(com.hazelcast.nio.serialization.Data)

Example 4 with SerializableList

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

the class QueueIteratorMessageTask method encodeResponse.

@Override
protected ClientMessage encodeResponse(Object response) {
    SerializableList serializableList = (SerializableList) response;
    List<Data> coll = serializableList.getCollection();
    return QueueIteratorCodec.encodeResponse(coll);
}
Also used : SerializableList(com.hazelcast.spi.impl.SerializableList) Data(com.hazelcast.nio.serialization.Data)

Example 5 with SerializableList

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

the class AbstractCollectionProxyImpl method getAll.

private Collection<E> getAll() {
    CollectionGetAllOperation operation = new CollectionGetAllOperation(name);
    SerializableList result = invoke(operation);
    List<Data> collection = result.getCollection();
    SerializationService serializationService = getNodeEngine().getSerializationService();
    return new UnmodifiableLazyList<E>(collection, serializationService);
}
Also used : CollectionGetAllOperation(com.hazelcast.collection.impl.collection.operations.CollectionGetAllOperation) SerializableList(com.hazelcast.spi.impl.SerializableList) SerializationService(com.hazelcast.spi.serialization.SerializationService) Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList)

Aggregations

SerializableList (com.hazelcast.spi.impl.SerializableList)14 Data (com.hazelcast.nio.serialization.Data)11 ArrayList (java.util.ArrayList)4 QueueContainer (com.hazelcast.collection.impl.queue.QueueContainer)2 NodeEngine (com.hazelcast.spi.NodeEngine)2 UnmodifiableLazyList (com.hazelcast.spi.impl.UnmodifiableLazyList)2 SerializationService (com.hazelcast.spi.serialization.SerializationService)2 CollectionContainer (com.hazelcast.collection.impl.collection.CollectionContainer)1 CollectionGetAllOperation (com.hazelcast.collection.impl.collection.operations.CollectionGetAllOperation)1 ListContainer (com.hazelcast.collection.impl.list.ListContainer)1 ListSubOperation (com.hazelcast.collection.impl.list.operations.ListSubOperation)1 DrainOperation (com.hazelcast.collection.impl.queue.operations.DrainOperation)1 IteratorOperation (com.hazelcast.collection.impl.queue.operations.IteratorOperation)1 HazelcastInstanceNotActiveException (com.hazelcast.core.HazelcastInstanceNotActiveException)1 Member (com.hazelcast.core.Member)1 MemberLeftException (com.hazelcast.core.MemberLeftException)1 ClusterService (com.hazelcast.internal.cluster.ClusterService)1 Address (com.hazelcast.nio.Address)1 InternalCompletableFuture (com.hazelcast.spi.InternalCompletableFuture)1 OperationService (com.hazelcast.spi.OperationService)1