use of com.hazelcast.cache.impl.CacheEntriesWithCursor in project hazelcast by hazelcast.
the class CacheIterateEntriesMessageTask method encodeResponse.
@Override
protected ClientMessage encodeResponse(Object response) {
if (response == null) {
return CacheIterateEntriesCodec.encodeResponse(Collections.emptyList(), Collections.emptyList());
}
CacheEntriesWithCursor iteratorResult = (CacheEntriesWithCursor) response;
IterationPointer[] pointers = iteratorResult.getPointers();
return CacheIterateEntriesCodec.encodeResponse(encodePointers(pointers), iteratorResult.getEntries());
}
use of com.hazelcast.cache.impl.CacheEntriesWithCursor in project hazelcast by hazelcast.
the class CacheRecordHashMap method fetchEntries.
@Override
public CacheEntriesWithCursor fetchEntries(IterationPointer[] pointers, int size) {
List<Map.Entry<Data, CacheRecord>> entries = new ArrayList<>(size);
IterationPointer[] newIterationPointers = fetchEntries(pointers, size, entries);
List<Map.Entry<Data, Data>> entriesData = new ArrayList<>(entries.size());
for (Map.Entry<Data, CacheRecord> entry : entries) {
CacheRecord record = entry.getValue();
Data dataValue = serializationService.toData(record.getValue());
entriesData.add(new AbstractMap.SimpleEntry<>(entry.getKey(), dataValue));
}
return new CacheEntriesWithCursor(entriesData, newIterationPointers);
}
Aggregations