/** * Convenience for {@link #peekOutputP(DistributedFunction, * DistributedPredicate, ProcessorMetaSupplier) peekOutput(toStringFn, * shouldLogFn, metaSupplier} with a pass-through filter and {@code * Object#toString} as the formatting function. */ @Nonnull public static ProcessorMetaSupplier peekOutputP(@Nonnull ProcessorMetaSupplier wrapped) { return peekOutputP(Object::toString, alwaysTrue(), wrapped); }
/** * Convenience for {@link #peekOutputP(DistributedFunction, * DistributedPredicate, ProcessorMetaSupplier) peekOutput(toStringFn, * shouldLogFn, metaSupplier} with a pass-through filter and {@code * Object#toString} as the formatting function. This variant accepts a * {@code ProcessorSupplier} instead of a meta-supplier. */ @Nonnull public static ProcessorSupplier peekOutputP(@Nonnull ProcessorSupplier wrapped) { return peekOutputP(Object::toString, alwaysTrue(), wrapped); }
/** * Convenience for {@link #peekOutputP(DistributedFunction, * DistributedPredicate, ProcessorMetaSupplier) peekOutput(toStringFn, * shouldLogFn, metaSupplier} with a pass-through filter and {@code * Object#toString} as the formatting function. This variant accepts a * {@code DistributedSupplier} of processors instead of a meta-supplier. */ @Nonnull public static DistributedSupplier<Processor> peekOutputP(@Nonnull DistributedSupplier<Processor> wrapped) { return peekOutputP(Object::toString, alwaysTrue(), wrapped); }
@Override public void addToDag(Planner p) { PlannerVertex peekedPv = p.xform2vertex.get(this.upstream().get(0)); // Peeking transform doesn't add a vertex, so point to the upstream // transform's vertex: p.xform2vertex.put(this, peekedPv); peekedPv.v.updateMetaSupplier(sup -> peekOutputP(toStringFn, shouldLogFn, sup)); } }