}
if (predicate instanceof PagingPredicate) {
throw new IllegalArgumentException("Paging is not supported for Transactional queries");
}
final MapService service = getService();
final MapServiceContext mapServiceContext = service.getMapServiceContext();
final QueryResultSet queryResultSet = (QueryResultSet) queryInternal(predicate, IterationType.ENTRY, false);
//todo: Can't we just use the original set?
final Set<Object> valueSet = new HashSet<Object>();
final Set<Object> keyWontBeIncluded = new HashSet<Object>();
// iterate over the txMap and see if the values are updated or removed.
for (final Map.Entry<Object, TxnValueWrapper> entry : txMap.entrySet()) {
final boolean isRemoved = TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type);
final boolean isUpdated = TxnValueWrapper.Type.UPDATED.equals(entry.getValue().type);
Object objectKey = entry.getKey();
if (isRemoved) {
keyWontBeIncluded.add(objectKey);
} else {
if (isUpdated) {
keyWontBeIncluded.add(objectKey);
}
Object entryValue = entry.getValue().value;
final Object objectValue = entryValue instanceof Data
? mapServiceContext.toObject(entryValue) : entryValue;
Data dataKey = mapServiceContext.toData(objectKey);
final SerializationService serializationService = getNodeEngine().getSerializationService();
final QueryEntry queryEntry = new QueryEntry(serializationService, dataKey, objectKey, objectValue);
if (predicate.apply(queryEntry)) {
valueSet.add(entryValue);
}