protected MatchEdgeTraverser createTraverser(OResult lastUpstreamRecord) { if (edge.edge.item instanceof OMultiMatchPathItem) { return new MatchMultiEdgeTraverser(lastUpstreamRecord, edge); } else if (edge.out) { return new MatchEdgeTraverser(lastUpstreamRecord, edge); } else { return new MatchReverseEdgeTraverser(lastUpstreamRecord, edge); } }
private void handleFetchFromTo(ODeleteExecutionPlan result, OCommandContext ctx, String fromAlias, String toAlias, OIdentifier targetClass, OIdentifier targetCluster, boolean profilingEnabled) { if (fromAlias != null && toAlias != null) { result.chain(new FetchEdgesFromToVerticesStep(fromAlias, toAlias, targetClass, targetCluster, ctx, profilingEnabled)); } else if (toAlias != null) { result.chain(new FetchEdgesToVerticesStep(toAlias, targetClass, targetCluster, ctx, profilingEnabled)); } }
private void handleResultForReturnAfter(OUpdateExecutionPlan result, OCommandContext ctx, boolean returnAfter, OProjection returnProjection, boolean profilingEnabled) { if (returnAfter) { //re-convert to normal step result.chain(new ConvertToResultInternalStep(ctx, profilingEnabled)); if (returnProjection != null) { result.chain(new ProjectionCalculationStep(returnProjection, ctx, profilingEnabled)); } } }
private void copy(OResult from, OResultInternal to) { for (String prop : from.getPropertyNames()) { to.setProperty(prop, from.getProperty(prop)); } }
@Override public OResult toResult() { OResultInternal res = (OResultInternal) super.toResult(); res.setProperty("type", "UpdateExecutionPlan"); return res; }
@Override public OResult serialize() { OResultInternal result = OExecutionStepInternal.basicSerialize(this); result.setProperty("className", className); result.setProperty("orderByRidAsc", orderByRidAsc); result.setProperty("orderByRidDesc", orderByRidDesc); return result; }
private void handleResultForReturnBefore(OUpdateExecutionPlan result, OCommandContext ctx, boolean returnBefore, OProjection returnProjection, boolean profilingEnabled) { if (returnBefore) { result.chain(new UnwrapPreviousValueStep(ctx, profilingEnabled)); if (returnProjection != null) { result.chain(new ProjectionCalculationStep(returnProjection, ctx, profilingEnabled)); } } }
public OUpdateExecutionPlan createExecutionPlan(OCommandContext ctx, boolean enableProfiling) { OUpdateExecutionPlanner planner = new OUpdateExecutionPlanner(this); OUpdateExecutionPlan result = planner.createExecutionPlan(ctx, enableProfiling); result.setStatement(this.originalStatement); return result; }
@Override public OExecutionStep copy(OCommandContext ctx) { FetchFromClusterExecutionStep result = new FetchFromClusterExecutionStep(this.clusterId, this.queryPlanning == null ? null : this.queryPlanning.copy(), ctx, profilingEnabled); return result; } }
private static void handleDistinct(OSelectExecutionPlan result, QueryPlanningInfo info, OCommandContext ctx, boolean profilingEnabled) { if (info.distinct) { result.chain(new DistinctExecutionStep(ctx, profilingEnabled)); } }
@Override public String prettyPrint(int depth, int indent) { String spaces = OExecutionStepInternal.getIndent(depth, indent); String result = spaces + "+ FETCH STORAGE METADATA"; if (profilingEnabled) { result += " (" + getCostFormatted() + ")"; } return result; }
private void handleReturnBefore(OUpdateExecutionPlan result, OCommandContext ctx, boolean returnBefore, boolean profilingEnabled) { if (returnBefore) { result.chain(new CopyRecordContentBeforeUpdateStep(ctx, profilingEnabled)); } }
private void handleUpsert(OUpdateExecutionPlan plan, OCommandContext ctx, OFromClause target, OWhereClause where, boolean upsert, boolean profilingEnabled) { if (upsert) { plan.chain(new UpsertStep(target, where, ctx, profilingEnabled)); } }
private void handleWhere(ODeleteExecutionPlan result, OCommandContext ctx, OWhereClause whereClause, boolean profilingEnabled) { if (whereClause != null) { result.chain(new FilterStep(whereClause, ctx, profilingEnabled)); } }
private void handleGlobalLet(ODeleteExecutionPlan result, OIdentifier name, OExpression expression, OCommandContext ctx, boolean profilingEnabled) { if (expression != null) { result.chain(new GlobalLetExpressionStep(name, expression, ctx, profilingEnabled)); } } }
private void handleTargetClass(OInsertExecutionPlan result, OIdentifier targetClass, OCommandContext ctx, boolean profilingEnabled) { if (targetClass != null) { result.chain(new SetDocumentClassStep(targetClass, ctx, profilingEnabled)); } }
@Override public String prettyPrint(int depth, int indent) { String result = OExecutionStepInternal.getIndent(depth, indent) + "+ UNWRAP PREVIOUS VALUE"; if (profilingEnabled) { result += " (" + getCostFormatted() + ")"; } return result; }
@Override public String prettyPrint(int depth, int indent) { String result = OExecutionStepInternal.getIndent(depth, indent) + "+ CONVERT TO UPDATABLE ITEM"; if (profilingEnabled) { result += " (" + getCostFormatted() + ")"; } return result; }