Enum 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.
    • Method Detail

      • values

        public static HashPartitionFunction[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HashPartitionFunction c : HashPartitionFunction.values())
            System.out.println(c);
        
        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.