AST2BOpContext getAST2BOpContext(QueryRoot given) { return new AST2BOpContext(new ASTContainer(given), store); }
/** * Return the {@link IDescribeCache} iff it is enabled. * * @return The {@link IDescribeCache} iff enabled and otherwise * <code>null</code>. */ protected IDescribeCache getDescribeCache(final ASTContainer astContainer, final AbstractTripleStore store) { final IDescribeCache describeCache; final AST2BOpContext context = new AST2BOpContext(astContainer, store); if (context.describeCache != null && astContainer.getOriginalAST().getQueryType() == QueryType.DESCRIBE) { /* * The DESCRIBE cache is enabled. */ describeCache = context.getDescribeCache(); } else { // DESCRIBE cache is not enabled. describeCache = null; } return describeCache; }
return left; final long timestamp = ctx.getLexiconReadTimestamp(); final String ns = ctx.getLexiconNamespace(); new NV(MockTermResolverOp.Annotations.RELATION_NAME, new String[] { ns }), // new NV(MockTermResolverOp.Annotations.TIMESTAMP, timestamp), // new NV(PipelineOp.Annotations.SHARED_STATE, !ctx.isCluster()),// live stats, but not on the cluster. new NV(BOp.Annotations.BOP_ID, ctx.nextId())// ), queryHints, ctx);
@Override public ISolutionSetStats getSolutionSetStats(final String localName) { @SuppressWarnings("rawtypes") final IVariable[] joinVars = IVariable.EMPTY; /* * Note: Will throw RuntimeException if named solution set can not be * found. Handles case where [solutionSetManager == null] gracefully. */ return NamedSolutionSetRefUtility.getSolutionSetStats(// solutionSetManager,// (IBTreeManager) queryEngine.getIndexManager(),// localIndexManager getNamespace(),// getTimestamp(),// localName,// joinVars// ); }
@Override public QueryNodeWithBindingSet optimize( final AST2BOpContext context, final QueryNodeWithBindingSet input) { final IQueryNode queryNode = input.getQueryNode(); final IBindingSet[] bindingSets = input.getBindingSets(); final QueryRoot query = (QueryRoot) queryNode; final GlobalAnnotations globals = new GlobalAnnotations( context.getLexiconNamespace(), context.getTimestamp() ); // final String lex = context.db.getLexiconRelation().getNamespace(); // convert1(lex, query); // Works around a concurrent modification. convert2(context.context, globals, query); // Should be faster. return new QueryNodeWithBindingSet(query, bindingSets); }
new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(new QueryRoot(QueryType.SELECT), context); final GlobalAnnotations globals = new GlobalAnnotations( context.getLexiconNamespace(), context.getTimestamp()); AST2BOpUtility.toVE(getBOpContext(), globals, fn.getValueExpressionNode());
final AST2BOpContext context = new AST2BOpContext(astContainer, store); new String[] { context.getNamespace() }); new NV(ChunkedResolutionOp.Annotations.TIMESTAMP, txId),// new NV(ChunkedResolutionOp.Annotations.RELATION_NAME, new String[] { context.getLexiconNamespace() })// )); new String[] { context.getNamespace() })// ));
.parseQuery2(queryStr, baseURI); final AST2BOpContext context = new AST2BOpContext(astContainer, store); globallyScopedVars.add(Var.var("v")); context.setSolutionSetStats(SolutionSetStatserator.get(bindingSets)); context.setGloballyScopedVariables(globallyScopedVars);
ctx.setSolutionSetStats(SolutionSetStatserator.get(globallyScopedBindings)); stats.registerParserCall(astContainer); ctx.setStaticAnalysisStats(stats); ctx.setGloballyScopedVariables(ctx.getSolutionSetStats().getAlwaysBound()); QueryEngine.Annotations.QUERY_ID, ctx.queryId); if (!ctx.isCluster()) {
final Dataset dataset) throws QueryEvaluationException { final AST2BOpContext context = new AST2BOpContext(astContainer, store); describeCache = context.getDescribeCache(); .getDescribeMode(optimizedQuery.getProjection()); .getDescribeIterationLimit(optimizedQuery.getProjection()); .getDescribeStatementLimit(optimizedQuery.getProjection());
.newInstance(ctx.getNamespace(), ctx.getTimestamp(), name, BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,
@Override public ISolutionSetStats getSolutionSetStats(final String localName) { if ("solutionSet".equals(localName)) { return sss; } return super.getSolutionSetStats(localName); } };
.parseQuery2(queryStr, baseURI); final AST2BOpContext context = new AST2BOpContext(astContainer, store); context.setSolutionSetStats(SolutionSetStatserator.get(bindingSets));
ctx.getLexiconNamespace(), ctx.getTimestamp()); final RangeBOp bop = toRangeBOp(ctx.getBOpContext(), range, globals);
subqueryPlan = (PipelineOp) subqueryPlan.setProperty(BOp.Annotations.NAMESPACE, ctx.getNamespace()); new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, new NV(PipelineOp.Annotations.MAX_MEMORY, Long.MAX_VALUE),// at-once evaluation new NV(PipelineOp.Annotations.SHARED_STATE, true),// live stats. new NV(HTreeNamedSubqueryOp.Annotations.RELATION_NAME, new String[]{ctx.getLexiconNamespace()}),// new NV(HTreeNamedSubqueryOp.Annotations.SUBQUERY, subqueryPlan),// new NV(HTreeNamedSubqueryOp.Annotations.JOIN_VARS, joinVars),// } else { left = applyQueryHints(new JVMNamedSubqueryOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,
new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, new NV(JoinGraph.Annotations.SAMPLE_TYPE, sampleType.name()),// new NV(JoinGraph.Annotations.DONE_SET, doneSetIn),// new NV(JoinGraph.Annotations.NT, new NT(ctx.getNamespace(),
if (ctx.isCluster() && BOpUtility.visitAll((BOp) subgroup, NamedSubqueryInclude.class).hasNext()) { new NV(Predicate.Annotations.BOP_ID, ctx.nextId()),// new NV(SliceOp.Annotations.EVALUATION_CONTEXT, final String solutionSetName = "--set-" + ctx.nextId(); // Unique name. subqueryPlan = (PipelineOp) subqueryPlan.setProperty(BOp.Annotations.NAMESPACE, ctx.getNamespace()); left = applyQueryHints(new HTreeSolutionSetHashJoinOp( new BOp[] { left },// new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,
JVMDistinctBindingSetsOp.Annotations.BOP_ID, ctx.nextId())); anns.add(new NV( JVMDistinctBindingSetsOp.Annotations.VARIABLES, projectionVars)); ctx.queryId, "--distinct-"+ctx.nextId(), projectionVars); HTreeDistinctBindingSetsOp.Annotations.BOP_ID, ctx.nextId())); anns.add(new NV( HTreeDistinctBindingSetsOp.Annotations.VARIABLES, projectionVars)); namedSolutionSet)); anns.add(new NV(IPredicate.Annotations.RELATION_NAME, new String[]{ctx.getLexiconNamespace()}));
left = (PipelineOp) left.setProperty(BOp.Annotations.NAMESPACE, ctx.getNamespace());
context.setSolutionSetStats(SolutionSetStatserator.get(bindingSetsOut));