@Override public OExecutionStep copy(OCommandContext ctx) { FetchFromClusterExecutionStep result = new FetchFromClusterExecutionStep(this.clusterId, this.queryPlanning == null ? null : this.queryPlanning.copy(), ctx, profilingEnabled); return result; } }
/** * iterates over a class and its subclasses * * @param clusterIds the clusters * @param ctx the query context * @param ridOrder true to sort by RID asc, false to sort by RID desc, null for no sort. */ public FetchFromClustersExecutionStep(int[] clusterIds, OCommandContext ctx, Boolean ridOrder, boolean profilingEnabled) { super(ctx, profilingEnabled); if (Boolean.TRUE.equals(ridOrder)) { orderByRidAsc = true; } else if (Boolean.FALSE.equals(ridOrder)) { orderByRidDesc = true; } subSteps = new ArrayList<OExecutionStep>(); sortClusers(clusterIds); for (int i = 0; i < clusterIds.length; i++) { FetchFromClusterExecutionStep step = new FetchFromClusterExecutionStep(clusterIds[i], ctx, profilingEnabled); if (orderByRidAsc) { step.setOrder(FetchFromClusterExecutionStep.ORDER_ASC); } else if (orderByRidDesc) { step.setOrder(FetchFromClusterExecutionStep.ORDER_DESC); } subSteps.add(step); } }
private void handleTargetCluster(ODeleteExecutionPlan result, OCommandContext ctx, OIdentifier targetClusterName, boolean profilingEnabled) { if (targetClusterName != null) { String name = targetClusterName.getStringValue(); int clusterId = ctx.getDatabase().getClusterIdByName(name); if (clusterId < 0) { throw new OCommandExecutionException("Cluster not found: " + name); } result.chain(new FetchFromClusterExecutionStep(clusterId, ctx, profilingEnabled)); } }
throw new OCommandExecutionException("Cluster " + cluster + " does not exist"); FetchFromClusterExecutionStep step = new FetchFromClusterExecutionStep(clusterId, ctx, profilingEnabled); if (Boolean.TRUE.equals(orderByRidAsc)) { step.setOrder(FetchFromClusterExecutionStep.ORDER_ASC);
int clusterId = clusterIds[i]; if (clusterId > 0) { FetchFromClusterExecutionStep step = new FetchFromClusterExecutionStep(clusterId, planningInfo, ctx, profilingEnabled); if (orderByRidAsc) { step.setOrder(FetchFromClusterExecutionStep.ORDER_ASC);
throw new OCommandExecutionException("Cluster " + cluster + " does not exist"); FetchFromClusterExecutionStep step = new FetchFromClusterExecutionStep(clusterId, ctx, profilingEnabled); if (Boolean.TRUE.equals(orderByRidAsc)) { step.setOrder(FetchFromClusterExecutionStep.ORDER_ASC);