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 interface
Utility to build up display data from a component and its included subcomponents.static class
Unique identifier for a display data item within a component.static class
Items
are the unit of display data.static class
Specifies anDisplayData.Item
to register as display data.static class
Structured path of registered display data within a component hierarchy.static enum
Display data type. -
Method Summary
Modifier and TypeMethodDescriptionasMap()
boolean
static DisplayData
from
(HasDisplayData component) Collect theDisplayData
from a component.int
hashCode()
static @Nullable DisplayData.Type
Infer theDisplayData.Type
for 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 DisplayData
none()
Default emptyDisplayData
instance.toString()
-
Method Details
-
none
Default emptyDisplayData
instance. -
from
Collect theDisplayData
from 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.Type
for 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,HasDisplayData
implementors 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:
-