public class PCollectionConsumerRegistry
extends java.lang.Object
PCollectionConsumerRegistry is used to maintain a collection of consuming
FnDataReceiver for each pCollectionId. Registering with this class allows inserting an element
count counter for every pCollection. A combined MultiplexingConsumer (Wrapped with an
ElementCountFnDataReceiver) is returned by calling getMultiplexingConsumer.| Constructor and Description |
|---|
PCollectionConsumerRegistry(ExecutionStateSampler.ExecutionStateTracker stateTracker,
org.apache.beam.runners.core.metrics.ShortIdMap shortIdMap,
BundleProgressReporter.Registrar bundleProgressReporterRegistrar,
org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor processBundleDescriptor) |
PCollectionConsumerRegistry(ExecutionStateSampler.ExecutionStateTracker stateTracker,
org.apache.beam.runners.core.metrics.ShortIdMap shortIdMap,
BundleProgressReporter.Registrar bundleProgressReporterRegistrar,
org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor processBundleDescriptor,
DataSampler dataSampler) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<?>> |
getMultiplexingConsumer(java.lang.String pCollectionId)
New consumers should not be register()-ed after calling this method.
|
<T> void |
register(java.lang.String pCollectionId,
java.lang.String pTransformId,
java.lang.String pTransformUniqueName,
org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> consumer)
Register the specified consumer to handle the elements in the pCollection associated with
pCollectionId.
|
public PCollectionConsumerRegistry(ExecutionStateSampler.ExecutionStateTracker stateTracker, org.apache.beam.runners.core.metrics.ShortIdMap shortIdMap, BundleProgressReporter.Registrar bundleProgressReporterRegistrar, org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor processBundleDescriptor)
public PCollectionConsumerRegistry(ExecutionStateSampler.ExecutionStateTracker stateTracker, org.apache.beam.runners.core.metrics.ShortIdMap shortIdMap, BundleProgressReporter.Registrar bundleProgressReporterRegistrar, org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor processBundleDescriptor, @Nullable DataSampler dataSampler)
public <T> void register(java.lang.String pCollectionId,
java.lang.String pTransformId,
java.lang.String pTransformUniqueName,
org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> consumer)
This will cause both Element Count and Process Bundle Execution time metrics to be collected.
T - the element type of the PCollectionpCollectionId - pTransformId - pTransformUniqueName - consumer - java.lang.RuntimeException - if register() is called after getMultiplexingConsumer() is called.public org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<?>> getMultiplexingConsumer(java.lang.String pCollectionId)
FnDataReceiver which directly wraps all the registered consumers.