IndexCreationHelper(String fromClause, String projectionAttributes, InternalCache cache) throws IndexInvalidException { this.cache = cache; // The fromClause,indexedExpression & projectionAttributes // will get modified with the canonicalized value , once the // constructor of derived class is over. this.fromClause = fromClause; this.projectionAttributes = projectionAttributes; this.compiler = new QCompiler(true); }
private Set<String> compileQuery(final String query) throws QueryInvalidException { QCompiler compiler = new QCompiler(); Set<String> regionsInQuery; try { CompiledValue compiledQuery = compiler.compileQuery(query); Set<String> regions = new HashSet<>(); compiledQuery.getRegionsInQuery(regions, null); regionsInQuery = Collections.unmodifiableSet(regions); return regionsInQuery; } catch (QueryInvalidException qe) { logger.error("{} Failed, Error {}", query, qe.getMessage(), qe); throw qe; } }
PartitionedIndex index = (PartitionedIndex) indexEntry.getValue(); IndexCreationData icd = new IndexCreationData(index.getName()); new QCompiler(); String imports = index.getImports(); icd.setIndexData(index.getType(), index.getCanonicalizedFromClause(),
private Region getRegionFromPath(String imports, String fromClause) throws RegionNotFoundException { QCompiler compiler = new QCompiler(); if (imports != null) { compiler.compileImports(imports); } List list = compiler.compileFromClause(fromClause); CompiledValue cv = QueryUtils .obtainTheBottomMostCompiledValue(((CompiledIteratorDef) list.get(0)).getCollectionExpr()); String regionPath = null; if (cv.getType() == OQLLexerTokenTypes.RegionPath) { regionPath = ((CompiledRegion) cv).getRegionPath(); } else { throw new RegionNotFoundException( String.format( "DefaultQueryService::createIndex:First Iterator of Index >From Clause does not evaluate to a Region Path. The from clause used for Index creation is %s", fromClause)); } Region region = cache.getRegion(regionPath); if (region == null) { throw new RegionNotFoundException( String.format("Region ' %s ' not found: from %s", new Object[] {regionPath, fromClause})); } return region; }
QCompiler compiler = new QCompiler(); if (imports != null) { compiler.compileImports(imports);
/** * Should be constructed from DefaultQueryService * * @see QueryService#newQuery */ public DefaultQuery(String queryString, InternalCache cache, boolean isForRemote) { this.queryString = queryString; QCompiler compiler = new QCompiler(); this.compiledQuery = compiler.compileQuery(queryString); CompiledSelect cs = getSimpleSelect(); if (cs != null && !isForRemote && (cs.isGroupBy() || cs.isOrderBy())) { QueryExecutionContext ctx = new QueryExecutionContext(null, cache); try { cs.computeDependencies(ctx); } catch (QueryException qe) { throw new QueryInvalidException("", qe); } } this.traceOn = compiler.isTraceRequested() || QUERY_VERBOSE; this.cache = cache; this.stats = new DefaultQueryStatistics(); this.cancelationTask = Optional.empty(); }
QCompiler compiler = new QCompiler(); Set<String> regionsInQuery; try {