Search in sources :

Example 1 with ReplicatedMapValueCollection

use of com.hazelcast.replicatedmap.impl.client.ReplicatedMapValueCollection in project hazelcast by hazelcast.

the class ValuesOperation method run.

@Override
public void run() throws Exception {
    ReplicatedMapService service = getService();
    Collection<ReplicatedRecordStore> stores = service.getAllReplicatedRecordStores(name);
    Collection<ReplicatedRecord> values = new ArrayList<ReplicatedRecord>();
    for (ReplicatedRecordStore store : stores) {
        values.addAll(store.values(false));
    }
    Collection<Data> dataValues = new ArrayList<Data>(values.size());
    SerializationService serializationService = getNodeEngine().getSerializationService();
    for (ReplicatedRecord value : values) {
        dataValues.add(serializationService.toData(value.getValue()));
    }
    response = new ReplicatedMapValueCollection(dataValues);
}
Also used : ReplicatedRecord(com.hazelcast.replicatedmap.impl.record.ReplicatedRecord) ReplicatedRecordStore(com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) ArrayList(java.util.ArrayList) SerializationService(com.hazelcast.spi.serialization.SerializationService) Data(com.hazelcast.nio.serialization.Data) ReplicatedMapValueCollection(com.hazelcast.replicatedmap.impl.client.ReplicatedMapValueCollection)

Aggregations

Data (com.hazelcast.nio.serialization.Data)1 ReplicatedMapService (com.hazelcast.replicatedmap.impl.ReplicatedMapService)1 ReplicatedMapValueCollection (com.hazelcast.replicatedmap.impl.client.ReplicatedMapValueCollection)1 ReplicatedRecord (com.hazelcast.replicatedmap.impl.record.ReplicatedRecord)1 ReplicatedRecordStore (com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore)1 SerializationService (com.hazelcast.spi.serialization.SerializationService)1 ArrayList (java.util.ArrayList)1