ve); left = applyQueryHints(new ConditionalRoutingOp(leftOrEmpty(left),// new NV(BOp.Annotations.BOP_ID, bopId), // new NV(ConditionalRoutingOp.Annotations.CONDITION, c)//
ve); left = applyQueryHints(new ConditionalRoutingOp(leftOrEmpty(left),// new NV(BOp.Annotations.BOP_ID, bopId), // new NV(ConditionalRoutingOp.Annotations.CONDITION, c)//
/** * Adds a {@link StartOp}. * <p> * Note: {@link StartOp} is not necessary in query plans. It is just a * convenient concept. When not using {@link StartOp}, the first operator in * the plan just needs to have an empty <code>args[]</code>. The only time * this is really necessary is when the top-level query plan would otherwise * be empty (a <code>null</code>). In this case, the {@link StartOp} just * copies its inputs to its outputs (which is all it ever does). * * @return The {@link StartOp}. */ private static final PipelineOp addStartOp(final QueryBase queryBase, final AST2BOpContext ctx) { final PipelineOp start = applyQueryHints( new StartOp(BOp.NOARGS, NV.asMap(new NV[] {// new NV(Predicate.Annotations.BOP_ID, ctx .nextId()), new NV(SliceOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER), })), queryBase, ctx); return start; }
/** * Adds a {@link StartOp}. * <p> * Note: {@link StartOp} is not necessary in query plans. It is just a * convenient concept. When not using {@link StartOp}, the first operator in * the plan just needs to have an empty <code>args[]</code>. The only time * this is really necessary is when the top-level query plan would otherwise * be empty (a <code>null</code>). In this case, the {@link StartOp} just * copies its inputs to its outputs (which is all it ever does). * * @return The {@link StartOp}. */ private static final PipelineOp addStartOp(final QueryBase queryBase, final AST2BOpContext ctx) { final PipelineOp start = applyQueryHints( new StartOp(BOp.NOARGS, NV.asMap(new NV[] {// new NV(Predicate.Annotations.BOP_ID, ctx .nextId()), new NV(SliceOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER), })), queryBase, ctx); return start; }
left = applyQueryHints(op, query, ctx);
left = applyQueryHints(// new ConditionalRoutingOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, bopId), //
left = applyQueryHints(// new ConditionalRoutingOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, bopId), //
left = applyQueryHints(// new ConditionalRoutingOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, bopId), //
left = applyQueryHints(// new ConditionalRoutingOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, bopId), //
left = applyQueryHints(op, query, ctx);
return (PipelineOp) applyQueryHints(new MockTermResolverOp(leftOrEmpty(left), new NV(MockTermResolverOp.Annotations.VARS, vars.toArray(new IVariable[nvars])),// new NV(MockTermResolverOp.Annotations.RELATION_NAME, new String[] { ns }), //
return (PipelineOp) applyQueryHints(new MockTermResolverOp(leftOrEmpty(left), new NV(MockTermResolverOp.Annotations.VARS, vars.toArray(new IVariable[nvars])),// new NV(MockTermResolverOp.Annotations.RELATION_NAME, new String[] { ns }), //
left = applyQueryHints( new MemorySortOp( leftOrEmpty(left),
/** * Generate the query plan for a zero length path. */ private static PipelineOp convertZeroLengthPath(PipelineOp left, final ZeroLengthPathNode zlpNode, final Set<IVariable<?>> doneSet, final AST2BOpContext ctx) { final IVariableOrConstant<?> leftTerm = (IVariableOrConstant<?>) zlpNode.left().getValueExpression(); final IVariableOrConstant<?> rightTerm = (IVariableOrConstant<?>) zlpNode.right().getValueExpression(); left = applyQueryHints(new ZeroLengthPathOp(leftOrEmpty(left),// new NV(ZeroLengthPathOp.Annotations.LEFT_TERM, leftTerm), new NV(ZeroLengthPathOp.Annotations.RIGHT_TERM, rightTerm), new NV(Predicate.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER)// ), zlpNode, ctx); return left; }
/** * Generate the query plan for a zero length path. */ private static PipelineOp convertZeroLengthPath(PipelineOp left, final ZeroLengthPathNode zlpNode, final Set<IVariable<?>> doneSet, final AST2BOpContext ctx) { final IVariableOrConstant<?> leftTerm = (IVariableOrConstant<?>) zlpNode.left().getValueExpression(); final IVariableOrConstant<?> rightTerm = (IVariableOrConstant<?>) zlpNode.right().getValueExpression(); left = applyQueryHints(new ZeroLengthPathOp(leftOrEmpty(left),// new NV(ZeroLengthPathOp.Annotations.LEFT_TERM, leftTerm), new NV(ZeroLengthPathOp.Annotations.RIGHT_TERM, rightTerm), new NV(Predicate.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER)// ), zlpNode, ctx); return left; }
left = applyQueryHints( new MemorySortOp( leftOrEmpty(left),
/** * Impose an OFFSET and/or LIMIT on a query. */ private static final PipelineOp addSlice(PipelineOp left, final QueryBase queryBase, final SliceNode slice, final AST2BOpContext ctx) { final int bopId = ctx.nextId(); left = applyQueryHints(new SliceOp(leftOrEmpty(left),// new NV(SliceOp.Annotations.BOP_ID, bopId),// new NV(SliceOp.Annotations.OFFSET, slice.getOffset()),// new NV(SliceOp.Annotations.LIMIT, slice.getLimit()),// new NV(SliceOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER),// new NV(SliceOp.Annotations.PIPELINED, true),// new NV(SliceOp.Annotations.MAX_PARALLEL, 1),// new NV(SliceOp.Annotations.REORDER_SOLUTIONS,false),// new NV(SliceOp.Annotations.SHARED_STATE, true)// ), queryBase, ctx); return left; }
/** * Impose an OFFSET and/or LIMIT on a query. */ private static final PipelineOp addSlice(PipelineOp left, final QueryBase queryBase, final SliceNode slice, final AST2BOpContext ctx) { final int bopId = ctx.nextId(); left = applyQueryHints(new SliceOp(leftOrEmpty(left),// new NV(SliceOp.Annotations.BOP_ID, bopId),// new NV(SliceOp.Annotations.OFFSET, slice.getOffset()),// new NV(SliceOp.Annotations.LIMIT, slice.getLimit()),// new NV(SliceOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER),// new NV(SliceOp.Annotations.PIPELINED, true),// new NV(SliceOp.Annotations.MAX_PARALLEL, 1),// new NV(SliceOp.Annotations.REORDER_SOLUTIONS,false),// new NV(SliceOp.Annotations.SHARED_STATE, true)// ), queryBase, ctx); return left; }
left = applyQueryHints(new HTreeNamedSubqueryOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, left = applyQueryHints(new JVMNamedSubqueryOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,
left = applyQueryHints(new HTreeNamedSubqueryOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, left = applyQueryHints(new JVMNamedSubqueryOp(leftOrEmpty(left), // new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,