Search in sources :

Example 6 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 7 with SerializableList

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

the class XACollectTransactionsMessageTask method reduce.

@Override
protected Object reduce(Map<Member, Object> map) throws Throwable {
    List<Data> list = new ArrayList<Data>();
    for (Object o : map.values()) {
        SerializableList xidSet = (SerializableList) o;
        list.addAll(xidSet.getCollection());
    }
    return list;
}
Also used : SerializableList(com.hazelcast.spi.impl.SerializableList) ArrayList(java.util.ArrayList) Data(com.hazelcast.nio.serialization.Data)

Example 8 with SerializableList

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

the class QueueDrainMessageTask method encodeResponse.

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

Example 9 with SerializableList

use of com.hazelcast.spi.impl.SerializableList 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 10 with SerializableList

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

the class CollectionGetAllOperation method run.

@Override
public void run() throws Exception {
    CollectionContainer collectionContainer = getOrCreateContainer();
    List<Data> all = collectionContainer.getAll();
    response = new SerializableList(all);
}
Also used : SerializableList(com.hazelcast.spi.impl.SerializableList) CollectionContainer(com.hazelcast.collection.impl.collection.CollectionContainer) Data(com.hazelcast.nio.serialization.Data)

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