abstract class DigestManager extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
DigestManager.RecoveryData |
Modifier and Type | Field and Description |
---|---|
(package private) static int |
LAC_METADATA_LENGTH |
(package private) long |
ledgerId |
(package private) static org.slf4j.Logger |
logger |
(package private) int |
macCodeLength |
(package private) static int |
METADATA_LENGTH |
Constructor and Description |
---|
DigestManager(long ledgerId) |
Modifier and Type | Method and Description |
---|---|
io.netty.buffer.ByteBuf |
computeDigestAndPackageForSending(long entryId,
long lastAddConfirmed,
long length,
io.netty.buffer.ByteBuf data)
Computes the digest for an entry and put bytes together for sending.
|
io.netty.buffer.ByteBuf |
computeDigestAndPackageForSendingLac(long lac)
Computes the digest for writeLac for sending.
|
(package private) abstract int |
getMacCodeLength() |
(package private) static DigestManager |
instantiate(long ledgerId,
byte[] passwd,
BookKeeper.DigestType digestType) |
(package private) abstract void |
populateValueAndReset(io.netty.buffer.ByteBuf buffer) |
(package private) void |
update(byte[] data) |
(package private) abstract void |
update(io.netty.buffer.ByteBuf buffer) |
(package private) io.netty.buffer.ByteBuf |
verifyDigestAndReturnData(long entryId,
io.netty.buffer.ByteBuf dataReceived)
Verify that the digest matches and returns the data in the entry.
|
(package private) long |
verifyDigestAndReturnLac(io.netty.buffer.ByteBuf dataReceived) |
(package private) DigestManager.RecoveryData |
verifyDigestAndReturnLastConfirmed(io.netty.buffer.ByteBuf dataReceived) |
static final org.slf4j.Logger logger
static final int METADATA_LENGTH
static final int LAC_METADATA_LENGTH
long ledgerId
final int macCodeLength
abstract int getMacCodeLength()
void update(byte[] data)
abstract void update(io.netty.buffer.ByteBuf buffer)
abstract void populateValueAndReset(io.netty.buffer.ByteBuf buffer)
static DigestManager instantiate(long ledgerId, byte[] passwd, BookKeeper.DigestType digestType) throws GeneralSecurityException
GeneralSecurityException
public io.netty.buffer.ByteBuf computeDigestAndPackageForSending(long entryId, long lastAddConfirmed, long length, io.netty.buffer.ByteBuf data)
entryId
- lastAddConfirmed
- length
- data
- public io.netty.buffer.ByteBuf computeDigestAndPackageForSendingLac(long lac)
lac
- long verifyDigestAndReturnLac(io.netty.buffer.ByteBuf dataReceived) throws BKException.BKDigestMatchException
io.netty.buffer.ByteBuf verifyDigestAndReturnData(long entryId, io.netty.buffer.ByteBuf dataReceived) throws BKException.BKDigestMatchException
entryId
- dataReceived
- BKException.BKDigestMatchException
DigestManager.RecoveryData verifyDigestAndReturnLastConfirmed(io.netty.buffer.ByteBuf dataReceived) throws BKException.BKDigestMatchException
Copyright © 2011–2017 The Apache Software Foundation. All rights reserved.