// iterate over the txMap and see if the values are updated or removed
@Override
    @SuppressWarnings("unchecked")
    public Collection values(Predicate predicate) {
        checkTransactionState();
        checkNotNull(predicate, "Predicate can not be null!");
        checkNotInstanceOf(PagingPredicate.class, predicate, "Paging is not supported for Transactional queries");
        MapQueryEngine queryEngine = mapServiceContext.getMapQueryEngine(name);
        SerializationService serializationService = getNodeEngine().getSerializationService();
        QueryResult result = queryEngine.invokeQueryAllPartitions(name, predicate, IterationType.ENTRY);
        QueryResultCollection<Map.Entry> queryResult
                = new QueryResultCollection<Map.Entry>(serializationService, IterationType.ENTRY, false, true, result);
        // TODO: Can't we just use the original set?
        List<Object> valueSet = new ArrayList<Object>();
        Set<Object> keyWontBeIncluded = new HashSet<Object>();
        Extractors extractors = mapServiceContext.getExtractors(name);
        // iterate over the txMap and see if the values are updated or removed
        for (Map.Entry<Data, TxnValueWrapper> entry : txMap.entrySet()) {
            boolean isRemoved = Type.REMOVED.equals(entry.getValue().type);
            boolean isUpdated = Type.UPDATED.equals(entry.getValue().type);
            Object keyObject = serializationService.toObject(entry.getKey());
            if (isRemoved) {
                keyWontBeIncluded.add(keyObject);
            } else {
                if (isUpdated) {
                    keyWontBeIncluded.add(keyObject);
                }
                Object entryValue = entry.getValue().value;
                QueryableEntry queryEntry = new CachedQueryEntry((InternalSerializationService) serializationService,
                        entry.getKey(), entryValue, extractors);
                if (predicate.apply(queryEntry)) {
                    valueSet.add(queryEntry.getValue());
                }
            }
        }
        removeFromResultSet(queryResult, valueSet, keyWontBeIncluded);
        return valueSet;
    }
Set<Object> keyWontBeIncluded = new HashSet<Object>();
Extractors extractors = mapServiceContext.getExtractors(name);
// iterate over the txMap and see if the values are updated or removed
for (Map.Entry<Data, TxnValueWrapper> entry : txMap.entrySet()) {
boolean isRemoved = Type.REMOVED.equals(entry.getValue().type);
checkNotInstanceOf(PagingPredicate.class, predicate, "Paging is not supported for Transactional queries");
MapQueryEngine queryEngine = mapServiceContext.getMapQueryEngine(name);
SerializationService serializationService = getNodeEngine().getSerializationService();
QueryResult result = queryEngine.invokeQueryAllPartitions(name, predicate, IterationType.ENTRY);
QueryResultCollection<Map.Entry> queryResult
= new QueryResultCollection<Map.Entry>(serializationService, IterationType.ENTRY, false, true, result);
// TODO: Can't we just use the original set?
List<Object> valueSet = new ArrayList<Object>();
Set<Object> keyWontBeIncluded = new HashSet<Object>();
Extractors extractors = mapServiceContext.getExtractors(name);
// iterate over the txMap and see if the values are updated or removed
for (Map.Entry<Data, TxnValueWrapper> entry : txMap.entrySet()) {
boolean isRemoved = Type.REMOVED.equals(entry.getValue().type);
boolean isUpdated = Type.UPDATED.equals(entry.getValue().type);
Object keyObject = serializationService.toObject(entry.getKey());
if (isRemoved) {
keyWontBeIncluded.add(keyObject);
} else {
if (isUpdated) {
keyWontBeIncluded.add(keyObject);
}
@Override
@SuppressWarnings("unchecked")
public Collection values(Predicate predicate) {
checkTransactionState();
checkNotNull(predicate, "Predicate can not be null!");
checkNotInstanceOf(PagingPredicate.class, predicate, "Paging is not supported for Transactional queries");
MapQueryEngine queryEngine = mapServiceContext.getMapQueryEngine(name);
SerializationService serializationService = getNodeEngine().getSerializationService();
QueryResult result = queryEngine.invokeQueryAllPartitions(name, predicate, IterationType.ENTRY);
QueryResultCollection<Map.Entry> queryResult
= new QueryResultCollection<Map.Entry>(serializationService, IterationType.ENTRY, false, true, result);
// TODO: Can't we just use the original set?
List<Object> valueSet = new ArrayList<Object>();
Set<Object> keyWontBeIncluded = new HashSet<Object>();
Extractors extractors = mapServiceContext.getExtractors(name);
// iterate over the txMap and see if the values are updated or removed
for (Map.Entry<Data, TxnValueWrapper> entry : txMap.entrySet()) {
boolean isRemoved = Type.REMOVED.equals(entry.getValue().type);
boolean isUpdated = Type.UPDATED.equals(entry.getValue().type);
Object keyObject = serializationService.toObject(entry.getKey());
if (isRemoved) {
keyWontBeIncluded.add(keyObject);
} else {
if (isUpdated) {
keyWontBeIncluded.add(keyObject);
}
Object entryValue = entry.getValue().value;
QueryableEntry queryEntry = new CachedQueryEntry((InternalSerializationService) serializationService,
entry.getKey(), entryValue, extractors);
if (predicate.apply(queryEntry)) {
valueSet.add(queryEntry.getValue());
}
}
}
removeFromResultSet(queryResult, valueSet, keyWontBeIncluded);
return valueSet;