if (entriesMap == null || result == null) { if (verifyLimit(result, limit)) { QueryObserver observer = QueryObserverHolder.getInstance(); if (observer != null) { observer.limitAppliedAtIndexLevel(this, limit, result); QueryObserver observer = QueryObserverHolder.getInstance(); if (entriesMap instanceof SortedMap) { Iterator entriesIter = ((Map) entriesMap).entrySet().iterator();
boolean applyOrderBy, boolean asc, long iteratorCreationTime) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { QueryObserver observer = QueryObserverHolder.getInstance(); if (result == null || limit != -1 && result.size() == limit) { return;
public QueryObserver startTrace() { QueryObserver queryObserver = null; if (this.traceOn && this.cache != null) { QueryObserver qo = QueryObserverHolder.getInstance(); if (qo instanceof IndexTrackingQueryObserver) { queryObserver = qo; } else if (!QueryObserverHolder.hasObserver()) { queryObserver = new IndexTrackingQueryObserver(); QueryObserverHolder.setInstance(queryObserver); } else { queryObserver = qo; } } return queryObserver; }
if (entriesMap == null || result == null) return; QueryObserver observer = QueryObserverHolder.getInstance(); if (verifyLimit(result, limit)) { observer.limitAppliedAtIndexLevel(this, limit, result);
/** * Asif : This function is invoked during clear operation on Region. It causes re execution of * Index Initialization query on the region & before doing this it makes theexisting data maps * null. This is needed so that index does not miss any entry being put in the region when the * Region.clear is in progress */ public void rerunIndexCreationQuery() throws QueryException { try { QueryObserver observer = QueryObserverHolder.getInstance(); observer.beforeRerunningIndexCreationQuery(); } catch (Exception e) { // Asif Ignore any exception as this should not hamper normal code flow if (logger.isDebugEnabled()) { logger.debug( "IndexMananger::rerunIndexCreationQuery: Exception in callback beforeRerunningIndexcreationQuery", e); } } if (isIndexMaintenanceTypeSynchronous()) { recreateAllIndexesForRegion(); } else { // System.out.println("Aynchronous update"); updater.addTask(RECREATE_INDEX, null, IndexProtocol.OTHER_OP); } }
if (entriesMap == null || result == null) return; QueryObserver observer = QueryObserverHolder.getInstance(); if (verifyLimit(result, limit)) { observer.limitAppliedAtIndexLevel(this, limit, result);
@Override public void hook(int spot) throws RuntimeException { QueryObserver observer = QueryObserverHolder.getInstance(); assertTrue(observer instanceof IndexTrackingQueryObserver); IndexTrackingQueryObserver gfObserver = (IndexTrackingQueryObserver) observer; if (spot == 1) { // before index lookup } else if (spot == 2) { // before key range index lookup } else if (spot == 3) { // End of afterIndexLookup call } else if (spot == 4) { // Before resetting indexInfoMap Map map = gfObserver.getUsedIndexes(); assertEquals(1, map.size()); assertTrue(map.get( INDEX_NAME) instanceof IndexTrackingQueryObserver.IndexInfo); rMap = (IndexTrackingQueryObserver.IndexInfo) map.get( INDEX_NAME); if (this.regn instanceof PartitionedRegion) { assertEquals(1, rMap.getResults().size()); } else if (this.regn instanceof LocalRegion) { assertEquals(1, rMap.getResults().size()); } } }
private SelectResults doIterationEvaluate(ExecutionContext context, boolean evaluateWhereClause) throws TypeMismatchException, FunctionDomainException, NameResolutionException, QueryInvocationTargetException { SelectResults results = prepareEmptyResultSet(context, false); // TODO: SELF : Work on limit implementation on bulk get // check for bulk get optimization if (evaluateWhereClause) { List tmpResults = optimizeBulkGet(context); if (tmpResults != null) { // (has only one iterator) RuntimeIterator rIter = (RuntimeIterator) context.getCurrentIterators().get(0); for (Iterator itr = tmpResults.iterator(); itr.hasNext();) { Object currObj = itr.next(); rIter.setCurrent(currObj); QueryObserver observer = QueryObserverHolder.getInstance(); observer.beforeIterationEvaluation(rIter, currObj); applyProjectionAndAddToResultSet(context, results, this.orderByAttrs == null); } return results; } } int numElementsInResult = 0; try { doNestedIterations(0, results, context, evaluateWhereClause, numElementsInResult); } catch (CompiledSelect.NullIteratorException ignore) { return null; } return results; }
return result; if (QueryObserverHolder.getInstance() != null) { QueryObserverHolder.getInstance().orderByColumnsEqual();
FunctionDomainException, NameResolutionException, QueryInvocationTargetException { QueryObserver observer = QueryObserverHolder.getInstance(); int limit = -1;
limit = (Integer) context.cacheGet(CompiledValue.RESULT_LIMIT); QueryObserver observer = QueryObserverHolder.getInstance(); if (limit != -1 && results.size() == limit) { observer.limitAppliedAtIndexLevel(this, limit, results);
/** * Return a SelectResults that is the union of c1 and c2. May or may not return a modified c1 or * c2. */ public static SelectResults union(SelectResults c1, SelectResults c2, ExecutionContext contextOrNull) { QueryObserverHolder.getInstance().invokedQueryUtilsUnion(c1, c2); assertCompatible(c1, c2); // iterate on the smallest one if (c1.size() < c2.size()) { return sizeSortedUnion(c1, c2, contextOrNull); } else { return sizeSortedUnion(c2, c1, contextOrNull); } }
QueryObserver observer = QueryObserverHolder.getInstance(); try { observer.startIteration(intermediateResults, operand);
QueryObserver observer = QueryObserverHolder.getInstance(); try { observer.startIteration(intermediateResults, operand);
/** * Return a SelectResults that is the intersection of c1 and c2. May or may not return a modified * c1 or c2. */ public static SelectResults intersection(SelectResults c1, SelectResults c2, ExecutionContext contextOrNull) { QueryObserverHolder.getInstance().invokedQueryUtilsIntersection(c1, c2); assertCompatible(c1, c2); if (c1.isEmpty()) { return c1; } if (c2.isEmpty()) { return c2; } // iterate on the smallest one if (c1.size() < c2.size()) { return sizeSortedIntersection(c1, c2, contextOrNull); } else { return sizeSortedIntersection(c2, c1, contextOrNull); } }
public Object executeUsingContext(ExecutionContext context) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { QueryObserver observer = QueryObserverHolder.getInstance();
QueryObserver observer = QueryObserverHolder.getInstance();
String otherObserver = null; if (this.traceOn) { QueryObserver qo = QueryObserverHolder.getInstance(); if (qo instanceof IndexTrackingQueryObserver) { indexObserver = (IndexTrackingQueryObserver) qo;
QueryObserver observer = QueryObserverHolder.getInstance();
QueryObserver observer = QueryObserverHolder.getInstance();