Enum Class PartitionSplitStrategy

java.lang.Object
java.lang.Enum<PartitionSplitStrategy>
com.linkedin.venice.vpj.pubsub.input.PartitionSplitStrategy
All Implemented Interfaces:
PubSubTopicPartitionSplitStrategy, Serializable, Comparable<PartitionSplitStrategy>, Constable

public enum PartitionSplitStrategy extends Enum<PartitionSplitStrategy> implements PubSubTopicPartitionSplitStrategy
Defines the available strategies for splitting a PubSubTopicPartition into one or more PubSubPartitionSplit instances.

Each enum constant encapsulates a specific implementation of PubSubTopicPartitionSplitStrategy. This allows the enum itself to serve as the strategy selector, removing the need for a separate factory or switch statement.

Usage example:


 List<PubSubPartitionSplit> splits =
     PartitionSplitStrategy.SINGLE_SPLIT_PER_PARTITION.split(request);
 
  • Enum Constant Details

    • FIXED_RECORD_COUNT

      public static final PartitionSplitStrategy FIXED_RECORD_COUNT
      Splits a PubSubTopicPartition into multiple splits, each containing a fixed target number of records.
    • CAPPED_SPLIT_COUNT

      public static final PartitionSplitStrategy CAPPED_SPLIT_COUNT
      Splits a PubSubTopicPartition into multiple splits, with the total number of splits capped at a configured maximum. The size of each split is calculated by dividing the total record count by this maximum.
    • SINGLE_SPLIT_PER_PARTITION

      public static final PartitionSplitStrategy SINGLE_SPLIT_PER_PARTITION
      Produces exactly one split per PubSubTopicPartition. This strategy returns a single continuous range from the start position to the end position without further segmentation.
  • Method Details

    • values

      public static PartitionSplitStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PartitionSplitStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • split

      public List<PubSubPartitionSplit> split(SplitRequest request)
      Specified by:
      split in interface PubSubTopicPartitionSplitStrategy