Package org.apache.bookkeeper.client
Enum BookKeeper.DigestType
- java.lang.Object
-
- java.lang.Enum<BookKeeper.DigestType>
-
- org.apache.bookkeeper.client.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BookKeeper.DigestType
fromApiDigestType(DigestType digestType)
DigestType
toApiDigestType()
static org.apache.bookkeeper.proto.DataFormats.LedgerMetadataFormat.DigestType
toProtoDigestType(BookKeeper.DigestType digestType)
static BookKeeper.DigestType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static BookKeeper.DigestType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MAC
public static final BookKeeper.DigestType MAC
-
CRC32
public static final BookKeeper.DigestType CRC32
-
CRC32C
public static final BookKeeper.DigestType CRC32C
-
DUMMY
public static final BookKeeper.DigestType DUMMY
-
-
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 namejava.lang.NullPointerException
- if the argument is null
-
fromApiDigestType
public static BookKeeper.DigestType fromApiDigestType(DigestType digestType)
-
toProtoDigestType
public static org.apache.bookkeeper.proto.DataFormats.LedgerMetadataFormat.DigestType toProtoDigestType(BookKeeper.DigestType digestType)
-
toApiDigestType
public DigestType toApiDigestType()
-
-