Enum BookKeeper.DigestType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<BookKeeper.DigestType>
    Enclosing class:
    BookKeeper

    public static enum BookKeeper.DigestType
    extends java.lang.Enum<BookKeeper.DigestType>
    There are 3 digest types that can be used for verification. The CRC32 is cheap to compute but does not protect against byzantine bookies (i.e., a bookie might report fake bytes and a matching CRC32). The MAC code is more expensive to compute, but is protected by a password, i.e., a bookie can't report fake bytes with a mathching MAC unless it knows the password. The CRC32C, which use SSE processor instruction, has better performance than CRC32. Legacy DigestType for backward compatibility. If we want to add new DigestType, we should add it in here, client.api.DigestType and DigestType in DataFormats.proto. If the digest type is set/passed in as DUMMY, a dummy digest is added/checked. This DUMMY digest is mostly for test purposes or in situations/use-cases where digest is considered a overhead.
    • Method Detail

      • values

        public static BookKeeper.DigestType[] 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 (BookKeeper.DigestType c : BookKeeper.DigestType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BookKeeper.DigestType valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toApiDigestType

        public DigestType toApiDigestType()