@Override public boolean isIndexed(QueryContext queryContext) { for (Predicate predicate : predicates) { if (predicate instanceof IndexAwarePredicate) { IndexAwarePredicate iap = (IndexAwarePredicate) predicate; if (iap.isIndexed(queryContext)) { return true; } } } return false; }
@Override public boolean isIndexed(QueryContext queryContext) { if (predicate instanceof IndexAwarePredicate) { return ((IndexAwarePredicate) predicate).isIndexed(queryContext); } return false; }
@Override public boolean isIndexed(QueryContext queryContext) { for (Predicate predicate : predicates) { if (predicate instanceof IndexAwarePredicate) { IndexAwarePredicate iap = (IndexAwarePredicate) predicate; if (iap.isIndexed(queryContext)) { return true; } } } return false; }
@Override public boolean isIndexed(QueryContext queryContext) { if (predicate instanceof IndexAwarePredicate) { return ((IndexAwarePredicate) predicate).isIndexed(queryContext); } return false; }
/** * Used if inner predicate is instanceof {@link IndexAwarePredicate} for checking if indexed. * * @param queryContext * @return */ @Override public boolean isIndexed(QueryContext queryContext) { if (predicate instanceof IndexAwarePredicate) { return ((IndexAwarePredicate) predicate).isIndexed(queryContext); } return false; }
@Override public boolean isIndexed(QueryContext context) { if (predicate instanceof IndexAwarePredicate) { return ((IndexAwarePredicate) predicate).isIndexed(context); } return false; }
@Override public boolean isIndexed(QueryContext context) { if (predicate instanceof IndexAwarePredicate) { return ((IndexAwarePredicate) predicate).isIndexed(context); } return false; }
private static boolean isIndexedPredicate(Predicate predicate, QueryContext queryContext) { return predicate instanceof IndexAwarePredicate && ((IndexAwarePredicate) predicate).isIndexed(queryContext); }
/** * Used if inner predicate is instanceof {@link IndexAwarePredicate} for checking if indexed. * * @param queryContext * @return */ @Override public boolean isIndexed(QueryContext queryContext) { if (predicate instanceof IndexAwarePredicate) { return ((IndexAwarePredicate) predicate).isIndexed(queryContext); } return false; }
@Override public boolean isIndexed(QueryContext queryContext) { for (Predicate predicate : predicates) { if (predicate instanceof IndexAwarePredicate) { IndexAwarePredicate iap = (IndexAwarePredicate) predicate; if (!iap.isIndexed(queryContext)) { return false; } } else { return false; } } return true; }
@Override public boolean isIndexed(QueryContext queryContext) { for (Predicate predicate : predicates) { if (predicate instanceof IndexAwarePredicate) { IndexAwarePredicate iap = (IndexAwarePredicate) predicate; if (!iap.isIndexed(queryContext)) { return false; } } else { return false; } } return true; }
private static boolean isIndexedPredicate(Predicate predicate, QueryContext queryContext) { return predicate instanceof IndexAwarePredicate && ((IndexAwarePredicate) predicate).isIndexed(queryContext); }
@Override public boolean isIndexed(QueryContext queryContext) { Predicate p = lsPredicates.get(0); if (p instanceof IndexAwarePredicate) { return ((IndexAwarePredicate) p).isIndexed(queryContext); } return false; }
@Override public boolean isIndexed(QueryContext queryContext) { Predicate p = lsPredicates.get(0); if (p instanceof IndexAwarePredicate) { return ((IndexAwarePredicate) p).isIndexed(queryContext); } return false; }
@Override public Set<QueryableEntry> filter(QueryContext queryContext) { List<Set<QueryableEntry>> indexedResults = new LinkedList<Set<QueryableEntry>>(); for (Predicate predicate : predicates) { if (predicate instanceof IndexAwarePredicate) { IndexAwarePredicate iap = (IndexAwarePredicate) predicate; if (iap.isIndexed(queryContext)) { Set<QueryableEntry> s = iap.filter(queryContext); if (s != null) { indexedResults.add(s); } } else { return null; } } } return indexedResults.isEmpty() ? null : new OrResultSet(indexedResults); }
@Override public Set<QueryableEntry> filter(QueryContext queryContext) { List<Set<QueryableEntry>> indexedResults = new LinkedList<Set<QueryableEntry>>(); for (Predicate predicate : predicates) { if (predicate instanceof IndexAwarePredicate) { IndexAwarePredicate iap = (IndexAwarePredicate) predicate; if (iap.isIndexed(queryContext)) { Set<QueryableEntry> s = iap.filter(queryContext); if (s != null) { indexedResults.add(s); } } else { return null; } } } return indexedResults.isEmpty() ? null : new OrResultSet(indexedResults); }
/** * Performs a query on this indexes instance using the given predicate. * * @param predicate the predicate to evaluate. * @return the produced result set or {@code null} if the query can't be * performed using the indexes known to this indexes instance. */ @SuppressWarnings("unchecked") public Set<QueryableEntry> query(Predicate predicate) { stats.incrementQueryCount(); if (!hasIndex || !(predicate instanceof IndexAwarePredicate)) { return null; } IndexAwarePredicate indexAwarePredicate = (IndexAwarePredicate) predicate; QueryContext queryContext = queryContextProvider.obtainContextFor(this); if (!indexAwarePredicate.isIndexed(queryContext)) { return null; } Set<QueryableEntry> result = indexAwarePredicate.filter(queryContext); if (result != null) { stats.incrementIndexedQueryCount(); queryContext.applyPerQueryStats(); } return result; }
/** * Performs a query on this indexes instance using the given predicate. * * @param predicate the predicate to evaluate. * @return the produced result set or {@code null} if the query can't be * performed using the indexes known to this indexes instance. */ @SuppressWarnings("unchecked") public Set<QueryableEntry> query(Predicate predicate) { stats.incrementQueryCount(); if (!haveAtLeastOneIndex() || !(predicate instanceof IndexAwarePredicate)) { return null; } IndexAwarePredicate indexAwarePredicate = (IndexAwarePredicate) predicate; QueryContext queryContext = queryContextProvider.obtainContextFor(this); if (!indexAwarePredicate.isIndexed(queryContext)) { return null; } Set<QueryableEntry> result = indexAwarePredicate.filter(queryContext); if (result != null) { stats.incrementIndexedQueryCount(); queryContext.applyPerQueryStats(); } return result; }