Class DisplayData
java.lang.Object
org.apache.beam.sdk.transforms.display.DisplayData
- All Implemented Interfaces:
Serializable
Static display data associated with a pipeline component. Display data is useful for pipeline
runner UIs and diagnostic dashboards to display details about
PTransforms that
make up a pipeline.
Components specify their display data by implementing the HasDisplayData interface.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceUtility to build up display data from a component and its included subcomponents.static classUnique identifier for a display data item within a component.static classItemsare the unit of display data.static classSpecifies anDisplayData.Itemto register as display data.static classStructured path of registered display data within a component hierarchy.static enumDisplay data type. -
Method Summary
Modifier and TypeMethodDescriptionasMap()booleanstatic DisplayDatafrom(HasDisplayData component) Collect theDisplayDatafrom a component.inthashCode()static @Nullable DisplayData.TypeInfer theDisplayData.Typefor the given object.static DisplayData.ItemSpec<Boolean> Create a display item for the specified key and boolean value.static <T> DisplayData.ItemSpec<Class<T>> Create a display item for the specified key and class value.static DisplayData.ItemSpec<Double> Create a display item for the specified key and floating point value.static DisplayData.ItemSpec<Float> Create a display item for the specified key and floating point value.static DisplayData.ItemSpec<Integer> Create a display item for the specified key and integer value.static DisplayData.ItemSpec<Long> Create a display item for the specified key and integer value.static DisplayData.ItemSpec<String> Create a display item for the specified key and string value.static DisplayData.ItemSpec<?> item(String key, @Nullable ValueProvider<?> value) Create a display item for the specified key andValueProvider.static <T> DisplayData.ItemSpec<T> item(String key, DisplayData.Type type, @Nullable T value) Create a display item for the specified key, type, and value.static DisplayData.ItemSpec<Duration> Create a display item for the specified key and duration value.static DisplayData.ItemSpec<Instant> Create a display item for the specified key and timestamp value.items()static DisplayDatanone()Default emptyDisplayDatainstance.toString()
-
Method Details
-
none
Default emptyDisplayDatainstance. -
from
Collect theDisplayDatafrom a component. This will traverse all subcomponents specified viaDisplayData.Builder.include(java.lang.String, org.apache.beam.sdk.transforms.display.HasDisplayData)in the given component. Data in this component will be in a namespace derived from the component. -
inferType
Infer theDisplayData.Typefor the given object.Use this method if the type of metadata is not known at compile time. For example:
@Override public void populateDisplayData(DisplayData.Builder builder) { Optional<DisplayData.Type> type = DisplayData.inferType(foo); if (type.isPresent()) { builder.add(DisplayData.item("foo", type.get(), foo)); } }- Returns:
- The inferred
DisplayData.Type, or null if the type cannot be inferred,
-
items
-
asMap
-
hashCode
public int hashCode() -
equals
-
toString
-
item
Create a display item for the specified key and string value. -
item
Create a display item for the specified key andValueProvider. -
item
Create a display item for the specified key and integer value. -
item
Create a display item for the specified key and integer value. -
item
Create a display item for the specified key and floating point value. -
item
Create a display item for the specified key and floating point value. -
item
Create a display item for the specified key and boolean value. -
item
Create a display item for the specified key and timestamp value. -
item
Create a display item for the specified key and duration value. -
item
Create a display item for the specified key and class value. -
item
public static <T> DisplayData.ItemSpec<T> item(String key, DisplayData.Type type, @Nullable T value) Create a display item for the specified key, type, and value. This method should be used if the type of the input value can only be determined at runtime. Otherwise,HasDisplayDataimplementors should call one of the typed factory methods, such asitem(String, String)oritem(String, Integer).- Throws:
ClassCastException- if the value cannot be formatted as the given type.- See Also:
-