@Override public void generateCanonicalizedExpression(StringBuilder clauseBuffer, ExecutionContext context) throws AmbiguousNameException, TypeMismatchException, NameResolutionException { // When compiling a new query, a context is created where there are no bind arguments at this // point if (context.isBindArgsSet()) { Object bindArgumentValue = context.getBindArgument(this.index); if (bindArgumentValue instanceof Region) { clauseBuffer.insert(0, ((Region) bindArgumentValue).getFullPath()); } else if (bindArgumentValue instanceof String) { clauseBuffer.insert(0, '\'').insert(0, bindArgumentValue).insert(0, '\''); } else { super.generateCanonicalizedExpression(clauseBuffer, context); } } }
RegionEntry entry = ((DummyQRegion) context.getBindArgument(1)).getEntry();
@Override public Object evaluate(ExecutionContext context) { if (!context.isBindArgsSet()) { return null; } Object obj = context.getBindArgument(this.index); // check for BucketRegion substitution if (obj instanceof Region) { PartitionedRegion pr = context.getPartitionedRegion(); if (pr != null) { if (pr.getFullPath().equals(((Region) obj).getFullPath())) { obj = context.getBucketRegion(); } } } return obj; }
private void applyProjection(ExecutionContext context) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException, IMQException { List currrentRuntimeIters = context.getCurrentIterators(); Object indexKey = this.indexedExpr.evaluate(context); // based on the first key convert the rest to PdxString or String if (!AbstractIndex.this.isIndexedPdxKeysFlagSet) { setPdxStringFlag(indexKey); } indexKey = getPdxStringForIndexedPdxKeys(indexKey); Object indxResultSet; if (this.iteratorSize == 1) { RuntimeIterator iter = (RuntimeIterator) currrentRuntimeIters.get(0); indxResultSet = iter.evaluate(context); } else { Object tuple[] = new Object[this.iteratorSize]; for (int i = 0; i < this.iteratorSize; i++) { RuntimeIterator iter = (RuntimeIterator) currrentRuntimeIters.get(i); tuple[i] = iter.evaluate(context); } Support.Assert(this.indexResultSetType instanceof StructTypeImpl, "The Index ResultType should have been an instance of StructTypeImpl rather than ObjectTypeImpl. The indxeResultType is " + this.indexResultSetType); indxResultSet = new StructImpl((StructTypeImpl) this.indexResultSetType, tuple); } // Keep Entry value in fly until all keys are evaluated RegionEntry entry = ((DummyQRegion) context.getBindArgument(1)).getEntry(); saveMapping(indexKey, indxResultSet, entry); }
RegionEntry entry = ((DummyQRegion) context.getBindArgument(1)).getEntry();