Enum HashPartitionFunction

java.lang.Object
java.lang.Enum<HashPartitionFunction>
org.apache.druid.timeline.partition.HashPartitionFunction
All Implemented Interfaces:
Serializable, Comparable<HashPartitionFunction>

public enum HashPartitionFunction extends Enum<HashPartitionFunction>
An enum of supported hash partition functions. This enum should be updated when we want to use a new function for hash partitioning. All partition functions listed in this enum must be backwards-compatible as the hash function should apply to all segments in the same way no matter what Druid version was used to create those segments. This function is a part of HashBasedNumberedShardSpec which is stored in the metadata store.
  • Enum Constant Details

  • Method Details

    • values

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

      public static HashPartitionFunction valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • hash

      public abstract int hash(byte[] serializedRow, int numBuckets)
      Returns an ID of a hash bucket for the given serializedRow.
    • fromString

      public static HashPartitionFunction fromString(String type)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<HashPartitionFunction>