Class MacDigestManager
- java.lang.Object
-
- org.apache.bookkeeper.proto.checksum.DigestManager
-
- org.apache.bookkeeper.proto.checksum.MacDigestManager
-
public class MacDigestManager extends DigestManager
ASHA-1
based digest manager.NOTE: This class is tended to be used by this project only. External users should not rely on it directly.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.bookkeeper.proto.checksum.DigestManager
DigestManager.RecoveryData
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DIGEST_ALGORITHM
(package private) static byte[]
EMPTY_LEDGER_KEY
static java.lang.String
KEY_ALGORITHM
static int
MAC_CODE_LENGTH
(package private) byte[]
passwd
-
Fields inherited from class org.apache.bookkeeper.proto.checksum.DigestManager
LAC_METADATA_LENGTH, ledgerId, macCodeLength, METADATA_LENGTH, useV2Protocol
-
-
Constructor Summary
Constructors Constructor Description MacDigestManager(long ledgerId, byte[] passwd, boolean useV2Protocol, io.netty.buffer.ByteBufAllocator allocator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
acceptsMemoryAddressBuffer()
static byte[]
genDigest(java.lang.String pad, byte[] passwd)
(package private) int
getMacCodeLength()
(package private) int
internalUpdate(int digest, byte[] buffer, int offset, int len)
(package private) int
internalUpdate(int digest, io.netty.buffer.ByteBuf data, int offset, int len)
(package private) boolean
isInt32Digest()
(package private) void
populateValueAndReset(int digest, io.netty.buffer.ByteBuf buffer)
-
Methods inherited from class org.apache.bookkeeper.proto.checksum.DigestManager
computeDigestAndPackageForSending, computeDigestAndPackageForSendingLac, generateMasterKey, instantiate, update, verifyDigestAndReturnData, verifyDigestAndReturnLac, verifyDigestAndReturnLastConfirmed
-
-
-
-
Field Detail
-
DIGEST_ALGORITHM
public static final java.lang.String DIGEST_ALGORITHM
- See Also:
- Constant Field Values
-
KEY_ALGORITHM
public static final java.lang.String KEY_ALGORITHM
- See Also:
- Constant Field Values
-
MAC_CODE_LENGTH
public static final int MAC_CODE_LENGTH
- See Also:
- Constant Field Values
-
passwd
final byte[] passwd
-
EMPTY_LEDGER_KEY
static final byte[] EMPTY_LEDGER_KEY
-
-
Method Detail
-
genDigest
public static byte[] genDigest(java.lang.String pad, byte[] passwd) throws java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchAlgorithmException
-
getMacCodeLength
int getMacCodeLength()
- Specified by:
getMacCodeLength
in classDigestManager
-
populateValueAndReset
void populateValueAndReset(int digest, io.netty.buffer.ByteBuf buffer)
- Specified by:
populateValueAndReset
in classDigestManager
-
internalUpdate
int internalUpdate(int digest, io.netty.buffer.ByteBuf data, int offset, int len)
- Specified by:
internalUpdate
in classDigestManager
-
internalUpdate
int internalUpdate(int digest, byte[] buffer, int offset, int len)
- Specified by:
internalUpdate
in classDigestManager
-
isInt32Digest
boolean isInt32Digest()
- Specified by:
isInt32Digest
in classDigestManager
-
acceptsMemoryAddressBuffer
boolean acceptsMemoryAddressBuffer()
- Specified by:
acceptsMemoryAddressBuffer
in classDigestManager
-
-