public interface ModelEnforcement<T>
ModelEnforcement is performed on a per-element and per-bundle basis. The
ModelEnforcement is provided with the input bundle as part of
ModelEnforcementFactory#forBundle(CommittedBundle, AppliedPTransform), each element
before and after that element is provided to an underlying TransformEvaluator, and the
output TransformResult and committed output bundles after the
TransformEvaluator has completed.
Typically, ModelEnforcement will obtain required metadata (such as the Coder
of the input PCollection on construction, and then enforce per-element behavior
(such as the immutability of input elements). When the element is output or the bundle is
completed, the required conditions can be enforced across all elements.
| Modifier and Type | Method and Description |
|---|---|
void |
afterElement(WindowedValue<T> element)
Called after a call to
TransformEvaluator.processElement(WindowedValue) on the
provided WindowedValue. |
void |
afterFinish(org.apache.beam.runners.direct.DirectRunner.CommittedBundle<T> input,
TransformResult<T> result,
Iterable<? extends org.apache.beam.runners.direct.DirectRunner.CommittedBundle<?>> outputs)
Called after a bundle has been completed and
TransformEvaluator.finishBundle() has been
called, producing the provided TransformResult and
output bundles. |
void |
beforeElement(WindowedValue<T> element)
Called before a call to
TransformEvaluator.processElement(WindowedValue) on the
provided WindowedValue. |
void beforeElement(WindowedValue<T> element)
TransformEvaluator.processElement(WindowedValue) on the
provided WindowedValue.void afterElement(WindowedValue<T> element)
TransformEvaluator.processElement(WindowedValue) on the
provided WindowedValue.void afterFinish(org.apache.beam.runners.direct.DirectRunner.CommittedBundle<T> input, TransformResult<T> result, Iterable<? extends org.apache.beam.runners.direct.DirectRunner.CommittedBundle<?>> outputs)
TransformEvaluator.finishBundle() has been
called, producing the provided TransformResult and
output bundles.Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.