public interface HasDisplayData
PTransforms
and components to specify display data used
within UIs and diagnostic tools.
Display data is registered by overriding
populateDisplayData(DisplayData.Builder)
in a component which implements
HasDisplayData
. Display data is available for PipelineOptions
and
PTransform
implementations.
@Override
public void populateDisplayData(DisplayData.Builder builder) {
super.populateDisplayData(builder);
builder
.include(subComponent)
.add(DisplayData.item("minFilter", 42))
.addIfNotDefault(DisplayData.item("useTransactions", this.txn), false)
.add(DisplayData.item("topic", "projects/myproject/topics/mytopic")
.withLabel("Pub/Sub Topic"))
.add(DisplayData.item("serviceInstance", "myservice.com/fizzbang")
.withLinkUrl("http://www.myservice.com/fizzbang"));
}
Display data is optional and may be collected during pipeline construction. It should only be used for informational purposes. Tools and components should not assume that display data will always be collected, or that collected display data will always be displayed.
populateDisplayData(DisplayData.Builder)
Modifier and Type | Method and Description |
---|---|
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
void populateDisplayData(DisplayData.Builder builder)
populateDisplayData(DisplayData.Builder)
is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData)
. Implementations may call
super.populateDisplayData(builder)
in order to register display data in the current
namespace, but should otherwise use subcomponent.populateDisplayData(builder)
to use
the namespace of the subcomponent.
builder
- The builder to populate with display data.HasDisplayData