T - the element type of the PCollection.public class OutputSampler<T>
extends java.lang.Object
| Constructor and Description |
|---|
OutputSampler(org.apache.beam.sdk.coders.Coder<?> coder,
int maxElements,
int sampleEveryN,
boolean onlySampleExceptions) |
| Modifier and Type | Method and Description |
|---|---|
void |
exception(ElementSample<T> elementSample,
java.lang.Exception e,
java.lang.String ptransformId,
java.lang.String processBundleId)
Samples an exceptional element to be later queried.
|
ElementSample<T> |
sample(org.apache.beam.sdk.util.WindowedValue<T> element)
Samples every
sampleEveryNth element or if it is part of the first 10 in the (local)
PCollection. |
java.util.List<org.apache.beam.model.fnexecution.v1.BeamFnApi.SampledElement> |
samples()
Clears samples at end of call.
|
public OutputSampler(org.apache.beam.sdk.coders.Coder<?> coder,
int maxElements,
int sampleEveryN,
boolean onlySampleExceptions)
public ElementSample<T> sample(org.apache.beam.sdk.util.WindowedValue<T> element)
sampleEveryNth element or if it is part of the first 10 in the (local)
PCollection.
This method is invoked in parallel by multiple bundle processing threads and in parallel to
any samples() being returned to a thread handling a sample request.
element - the element to sample.public void exception(ElementSample<T> elementSample, java.lang.Exception e, java.lang.String ptransformId, java.lang.String processBundleId)
elementSample - the sampled element to add an exception to.e - the exception.ptransformId - the source of the exception.processBundleId - the failing bundle.public java.util.List<org.apache.beam.model.fnexecution.v1.BeamFnApi.SampledElement> samples()
throws java.io.IOException
This method is invoked by a thread handling a data sampling request in parallel to any calls
to sample(org.apache.beam.sdk.util.WindowedValue<T>).
java.io.IOException