use of com.hazelcast.map.impl.LazyMapEntry in project hazelcast by hazelcast.
the class ClientMapProxy method entrySet.
@Override
public Set<Entry<K, V>> entrySet() {
ClientMessage request = MapEntrySetCodec.encodeRequest(name);
ClientMessage response = invoke(request);
MapEntrySetCodec.ResponseParameters resultParameters = MapEntrySetCodec.decodeResponse(response);
InflatableSet.Builder<Entry<K, V>> setBuilder = InflatableSet.newBuilder(resultParameters.response.size());
InternalSerializationService serializationService = ((InternalSerializationService) getContext().getSerializationService());
for (Entry<Data, Data> row : resultParameters.response) {
LazyMapEntry entry = new LazyMapEntry(row.getKey(), row.getValue(), serializationService);
setBuilder.add(entry);
}
return setBuilder.build();
}
use of com.hazelcast.map.impl.LazyMapEntry in project hazelcast by hazelcast.
the class ClientMapProxy method entrySet.
@Override
@SuppressWarnings("unchecked")
public Set<Entry<K, V>> entrySet(Predicate predicate) {
if (predicate instanceof PagingPredicate) {
return entrySetWithPagingPredicate((PagingPredicate) predicate);
}
ClientMessage request = MapEntriesWithPredicateCodec.encodeRequest(name, toData(predicate));
ClientMessage response = invoke(request);
MapEntriesWithPredicateCodec.ResponseParameters resultParameters = MapEntriesWithPredicateCodec.decodeResponse(response);
InflatableSet.Builder<Entry<K, V>> setBuilder = InflatableSet.newBuilder(resultParameters.response.size());
InternalSerializationService serializationService = ((InternalSerializationService) getContext().getSerializationService());
for (Entry<Data, Data> row : resultParameters.response) {
LazyMapEntry entry = new LazyMapEntry(row.getKey(), row.getValue(), serializationService);
setBuilder.add(entry);
}
return setBuilder.build();
}
use of com.hazelcast.map.impl.LazyMapEntry in project hazelcast by hazelcast.
the class AbstractMapPartitionIterator method next.
public Map.Entry<K, V> next() {
while (hasNext()) {
currentIndex = index;
index++;
final Data keyData = getKey(currentIndex);
final Object value = getValue(currentIndex, keyData);
if (value != null) {
return new LazyMapEntry(keyData, value, (InternalSerializationService) getSerializationService());
}
}
throw new NoSuchElementException();
}
Aggregations