Package org.apache.bookkeeper.meta
Class LedgerLayout
- java.lang.Object
-
- org.apache.bookkeeper.meta.LedgerLayout
-
public class LedgerLayout extends java.lang.Object
This class encapsulates ledger layout information that is persistently stored in registration service. It provides parsing and serialization methods of such information.
-
-
Field Summary
Fields Modifier and Type Field Description static int
LAYOUT_FORMAT_VERSION
static int
LAYOUT_MIN_COMPAT_VERSION
-
Constructor Summary
Constructors Constructor Description LedgerLayout(java.lang.String managerFactoryCls, int managerVersion)
Ledger Layout Constructor.LedgerLayout(java.lang.String managerFactoryCls, int managerVersion, int layoutVersion)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
int
getLayoutFormatVersion()
java.lang.String
getManagerFactoryClass()
int
getManagerVersion()
int
hashCode()
static LedgerLayout
parseLayout(byte[] bytes)
Parses a given byte array and transforms into a LedgerLayout object.byte[]
serialize()
Generates a byte array based on the LedgerLayout object.java.lang.String
toString()
-
-
-
Field Detail
-
LAYOUT_MIN_COMPAT_VERSION
public static final int LAYOUT_MIN_COMPAT_VERSION
- See Also:
- Constant Field Values
-
LAYOUT_FORMAT_VERSION
public static final int LAYOUT_FORMAT_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LedgerLayout
public LedgerLayout(java.lang.String managerFactoryCls, int managerVersion)
Ledger Layout Constructor.- Parameters:
managerFactoryCls
- Ledger Manager Factory ClassmanagerVersion
- Ledger Manager Version
-
LedgerLayout
LedgerLayout(java.lang.String managerFactoryCls, int managerVersion, int layoutVersion)
-
-
Method Detail
-
serialize
public byte[] serialize() throws java.io.IOException
Generates a byte array based on the LedgerLayout object.- Returns:
- byte[]
- Throws:
java.io.IOException
-
parseLayout
public static LedgerLayout parseLayout(byte[] bytes) throws java.io.IOException
Parses a given byte array and transforms into a LedgerLayout object.- Parameters:
bytes
- byte array to parse- Returns:
- LedgerLayout
- Throws:
java.io.IOException
- if the given byte[] cannot be parsed
-
getManagerFactoryClass
public java.lang.String getManagerFactoryClass()
-
getManagerVersion
public int getManagerVersion()
-
getLayoutFormatVersion
public int getLayoutFormatVersion()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-