Interface BoundedTrie

All Superinterfaces:
Metric, Serializable
All Known Implementing Classes:
BoundedTrieImpl

@Internal public interface BoundedTrie extends Metric
Internal: For internal use only and not for public consumption. This API is subject to incompatible changes, or even removal, in a future release.

A metric that represents a bounded trie data structure. This interface extends the Metric interface and provides methods for adding string sequences (paths) to the trie.

The trie is bounded in size (max=100), meaning it has a maximum capacity for storing paths. When the trie reaches its capacity, it truncates paths. This is useful for tracking and aggregating a large number of distinct paths while limiting memory usage. It is not necessary but recommended that parts of paths provided as strings are hierarchical in nature so the truncation reduces granularity rather than complete data loss.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Iterable<String> values)
    Adds a path to the trie.
    default void
    add(String... values)
    Adds a path to the trie.

    Methods inherited from interface org.apache.beam.sdk.metrics.Metric

    getName
  • Method Details

    • add

      void add(Iterable<String> values)
      Adds a path to the trie. The path is represented as an iterable of string segments.
      Parameters:
      values - The segments of the path to add.
    • add

      default void add(String... values)
      Adds a path to the trie. The path is represented as a variable number of string arguments.
      Parameters:
      values - The segments of the path to add.