Class MacDigestManager
java.lang.Object
org.apache.bookkeeper.proto.checksum.DigestManager
org.apache.bookkeeper.proto.checksum.MacDigestManager
A
SHA-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
FieldsModifier and TypeFieldDescriptionstatic final String(package private) static final byte[]static final Stringstatic final int(package private) final byte[]Fields inherited from class org.apache.bookkeeper.proto.checksum.DigestManager
LAC_METADATA_LENGTH, ledgerId, macCodeLength, METADATA_LENGTH, useV2Protocol -
Constructor Summary
ConstructorsConstructorDescriptionMacDigestManager(long ledgerId, byte[] passwd, boolean useV2Protocol, io.netty.buffer.ByteBufAllocator allocator) -
Method Summary
Modifier and TypeMethodDescription(package private) booleanstatic byte[](package private) int(package private) intinternalUpdate(int digest, byte[] buffer, int offset, int len) (package private) intinternalUpdate(int digest, io.netty.buffer.ByteBuf data, int offset, int len) (package private) boolean(package private) voidpopulateValueAndReset(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 Details
-
DIGEST_ALGORITHM
- See Also:
-
KEY_ALGORITHM
- See Also:
-
MAC_CODE_LENGTH
public static final int MAC_CODE_LENGTH- See Also:
-
passwd
final byte[] passwd -
EMPTY_LEDGER_KEY
static final byte[] EMPTY_LEDGER_KEY
-
-
Constructor Details
-
MacDigestManager
public MacDigestManager(long ledgerId, byte[] passwd, boolean useV2Protocol, io.netty.buffer.ByteBufAllocator allocator) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
-
Method Details
-
genDigest
- Throws:
NoSuchAlgorithmException
-
getMacCodeLength
int getMacCodeLength()- Specified by:
getMacCodeLengthin classDigestManager
-
populateValueAndReset
void populateValueAndReset(int digest, io.netty.buffer.ByteBuf buffer) - Specified by:
populateValueAndResetin classDigestManager
-
internalUpdate
int internalUpdate(int digest, io.netty.buffer.ByteBuf data, int offset, int len) - Specified by:
internalUpdatein classDigestManager
-
internalUpdate
int internalUpdate(int digest, byte[] buffer, int offset, int len) - Specified by:
internalUpdatein classDigestManager
-
isInt32Digest
boolean isInt32Digest()- Specified by:
isInt32Digestin classDigestManager
-
acceptsMemoryAddressBuffer
boolean acceptsMemoryAddressBuffer()- Specified by:
acceptsMemoryAddressBufferin classDigestManager
-