Package org.apache.bookkeeper.client
Enum Class BookKeeper.DigestType
- All Implemented Interfaces:
Serializable,Comparable<BookKeeper.DigestType>,Constable
- Enclosing class:
- BookKeeper
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 matching 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic BookKeeper.DigestTypefromApiDigestType(DigestType digestType) toProtoDigestType(BookKeeper.DigestType digestType) static BookKeeper.DigestTypeReturns the enum constant of this class with the specified name.static BookKeeper.DigestType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MAC
-
CRC32
-
CRC32C
-
DUMMY
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
fromApiDigestType
-
toProtoDigestType
public static DataFormats.LedgerMetadataFormat.DigestType toProtoDigestType(BookKeeper.DigestType digestType) -
toApiDigestType
-