@Override public String toString() { return "AlgebricksMeta " + Arrays.toString(pipeline.getRuntimeFactories()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Subplan { \n"); for (AlgebricksPipeline pipeline : pipelines) { sb.append('{'); for (IPushRuntimeFactory f : pipeline.getRuntimeFactories()) { sb.append(" ").append(f).append(";\n"); } sb.append('}'); } sb.append("}"); return sb.toString(); }
@Override public ObjectNode toJSON() { ObjectNode json = super.toJSON(); json.put("micro-operators", Arrays.toString(pipeline.getRuntimeFactories())); return json; }
private boolean sendsOutput(IOperatorDescriptor src, IOperatorDescriptor trg) { AlgebricksPipeline srcPipeline = ((AlgebricksMetaOperatorDescriptor) src).getPipeline(); IPushRuntimeFactory[] srcOutRts = srcPipeline.getOutputRuntimeFactories(); if (srcOutRts == null) { return false; } IPushRuntimeFactory[] trgRts = ((AlgebricksMetaOperatorDescriptor) trg).getPipeline().getRuntimeFactories(); for (IPushRuntimeFactory srcOutRt : srcOutRts) { if (ArrayUtils.contains(trgRts, srcOutRt)) { return true; } ILogicalOperator srcOutOp = revMicroOpMap.get(srcOutRt); if (srcOutOp != null) { Integer k = algebraicOpBelongingToMetaAsterixOp.get(srcOutOp); if (k != null) { AlgebricksMetaOperatorDescriptor srcOutMetaOp = metaAsterixOps.get(k); if (srcOutMetaOp != null && sendsOutput(srcOutMetaOp, trg)) { return true; } } } } return false; }
public static IFrameWriter assemblePipeline(AlgebricksPipeline subplan, IFrameWriter writer, IHyracksTaskContext ctx) throws HyracksDataException { // should enforce protocol boolean enforce = ctx.getJobFlags().contains(JobFlag.ENFORCE_CONTRACT); // plug the operators IFrameWriter start = writer; IPushRuntimeFactory[] runtimeFactories = subplan.getRuntimeFactories(); RecordDescriptor[] recordDescriptors = subplan.getRecordDescriptors(); for (int i = runtimeFactories.length - 1; i >= 0; i--) { IPushRuntime newRuntime = runtimeFactories[i].createPushRuntime(ctx)[0]; newRuntime = enforce ? EnforcePushRuntime.enforce(newRuntime) : newRuntime; start = enforce ? EnforceFrameWriter.enforce(start) : start; newRuntime.setOutputFrameWriter(0, start, recordDescriptors[i]); if (i > 0) { newRuntime.setInputRecordDescriptor(0, recordDescriptors[i - 1]); } else { // the nts has the same input and output rec. desc. newRuntime.setInputRecordDescriptor(0, recordDescriptors[0]); } start = newRuntime; } return start; } }
IPushRuntimeFactory[] runtimeFactories = pipeline.getRuntimeFactories(); RecordDescriptor[] recordDescriptors = pipeline.getRecordDescriptors(); for (int i = runtimeFactories.length - 1; i >= 0; i--) {
if (opDesc instanceof AlgebricksMetaOperatorDescriptor) { AlgebricksMetaOperatorDescriptor algOp = (AlgebricksMetaOperatorDescriptor) opDesc; IPushRuntimeFactory[] runtimeFactories = algOp.getPipeline().getRuntimeFactories();