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(org.apache.beam.runners.core.metrics.MetricsContainerStepMap metricsContainerRegistry,
org.apache.beam.runners.core.metrics.ExecutionStateTracker stateTracker) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,org.apache.beam.vendor.grpc.v1p43p2.com.google.protobuf.ByteString> |
getExecutionTimeMonitoringData(org.apache.beam.runners.core.metrics.ShortIdMap shortIds) |
java.util.List<org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo> |
getExecutionTimeMonitoringInfos() |
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.
|
java.util.Set<java.lang.String> |
keySet() |
<T> void |
register(java.lang.String pCollectionId,
java.lang.String pTransformId,
org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> consumer,
org.apache.beam.sdk.coders.Coder<T> valueCoder)
Register the specified consumer to handle the elements in the pCollection associated with
pCollectionId.
|
void |
reset()
Reset the execution states of the registered functions.
|
public PCollectionConsumerRegistry(org.apache.beam.runners.core.metrics.MetricsContainerStepMap metricsContainerRegistry,
org.apache.beam.runners.core.metrics.ExecutionStateTracker stateTracker)
public <T> void register(java.lang.String pCollectionId,
java.lang.String pTransformId,
org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> consumer,
org.apache.beam.sdk.coders.Coder<T> valueCoder)
This will cause both Element Count and Process Bundle Execution time metrics to be collected.
T - the element type of the PCollectionpCollectionId - pTransformId - consumer - java.lang.RuntimeException - if register() is called after getMultiplexingConsumer() is called.public void reset()
public java.util.Set<java.lang.String> keySet()
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.public java.util.List<org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo> getExecutionTimeMonitoringInfos()
public java.util.Map<java.lang.String,org.apache.beam.vendor.grpc.v1p43p2.com.google.protobuf.ByteString> getExecutionTimeMonitoringData(org.apache.beam.runners.core.metrics.ShortIdMap shortIds)