use of com.hazelcast.replicatedmap.impl.record.ResultSet in project hazelcast by hazelcast.
the class ReplicatedMapProxy method entrySet.
@Override
public Set<Entry<K, V>> entrySet() {
Collection<ReplicatedRecordStore> stores = service.getAllReplicatedRecordStores(getName());
List<Entry<K, V>> entries = new ArrayList<Entry<K, V>>();
for (ReplicatedRecordStore store : stores) {
entries.addAll(store.entrySet(true));
}
return new ResultSet<K, V>(entries, IterationType.ENTRY);
}
use of com.hazelcast.replicatedmap.impl.record.ResultSet in project hazelcast by hazelcast.
the class ClientReplicatedMapProxy method keySet.
@Override
public Set<K> keySet() {
ClientMessage request = ReplicatedMapKeySetCodec.encodeRequest(name);
ClientMessage response = invokeOnPartition(request, targetPartitionId);
ReplicatedMapKeySetCodec.ResponseParameters result = ReplicatedMapKeySetCodec.decodeResponse(response);
List<Entry<K, V>> keys = new ArrayList<Entry<K, V>>(result.response.size());
for (Data dataKey : result.response) {
keys.add(new AbstractMap.SimpleImmutableEntry<K, V>((K) toObject(dataKey), null));
}
return new ResultSet(keys, IterationType.KEY);
}
use of com.hazelcast.replicatedmap.impl.record.ResultSet in project hazelcast by hazelcast.
the class ClientReplicatedMapProxy method entrySet.
@Override
public Set<Entry<K, V>> entrySet() {
ClientMessage request = ReplicatedMapEntrySetCodec.encodeRequest(name);
ClientMessage response = invokeOnPartition(request, targetPartitionId);
ReplicatedMapEntrySetCodec.ResponseParameters result = ReplicatedMapEntrySetCodec.decodeResponse(response);
List<Entry<K, V>> entries = new ArrayList<Entry<K, V>>(result.response.size());
for (Entry<Data, Data> dataEntry : result.response) {
K key = toObject(dataEntry.getKey());
V value = toObject(dataEntry.getValue());
entries.add(new AbstractMap.SimpleImmutableEntry<K, V>(key, value));
}
return new ResultSet<K, V>(entries, IterationType.ENTRY);
}
Aggregations