public class LedgerMetadata extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CURRENT_METADATA_FORMAT_VERSION |
static int |
LOWEST_COMPAT_METADATA_FORMAT_VERSION |
static String |
VERSION_KEY |
Constructor and Description |
---|
LedgerMetadata(int ensembleSize,
int writeQuorumSize,
int ackQuorumSize,
BookKeeper.DigestType digestType,
byte[] password) |
Modifier and Type | Method and Description |
---|---|
int |
getAckQuorumSize() |
SortedMap<Long,ArrayList<org.apache.bookkeeper.net.BookieSocketAddress>> |
getEnsembles()
Get the Map of bookie ensembles for the various ledger fragments
that make up the ledger.
|
int |
getEnsembleSize() |
long |
getLastEntryId() |
long |
getLength() |
org.apache.bookkeeper.versioning.Version |
getVersion()
Returns the last version.
|
int |
getWriteQuorumSize() |
boolean |
isClosed() |
boolean |
isInRecovery() |
static LedgerMetadata |
parseConfig(byte[] bytes,
org.apache.bookkeeper.versioning.Version version)
Parses a given byte array and transforms into a LedgerConfig object
|
byte[] |
serialize()
Generates a byte array of this object
|
void |
setVersion(org.apache.bookkeeper.versioning.Version v)
Updates the version of this metadata.
|
String |
toString() |
public static final int LOWEST_COMPAT_METADATA_FORMAT_VERSION
public static final int CURRENT_METADATA_FORMAT_VERSION
public static final String VERSION_KEY
public LedgerMetadata(int ensembleSize, int writeQuorumSize, int ackQuorumSize, BookKeeper.DigestType digestType, byte[] password)
public SortedMap<Long,ArrayList<org.apache.bookkeeper.net.BookieSocketAddress>> getEnsembles()
public int getEnsembleSize()
public int getWriteQuorumSize()
public int getAckQuorumSize()
public long getLastEntryId()
public long getLength()
public boolean isClosed()
public boolean isInRecovery()
public byte[] serialize()
public static LedgerMetadata parseConfig(byte[] bytes, org.apache.bookkeeper.versioning.Version version) throws IOException
bytes
- byte array to parseversion
- version of the ledger metadataIOException
- if the given byte[] cannot be parsedpublic void setVersion(org.apache.bookkeeper.versioning.Version v)
v
- Versionpublic org.apache.bookkeeper.versioning.Version getVersion()
Copyright © 2011-2014 The Apache Software Foundation. All Rights Reserved.