Class LedgerLayout

java.lang.Object
org.apache.bookkeeper.meta.LedgerLayout

public class LedgerLayout extends Object
This class encapsulates ledger layout information that is persistently stored in registration service. It provides parsing and serialization methods of such information.
  • Field Details

    • LAYOUT_MIN_COMPAT_VERSION

      public static final int LAYOUT_MIN_COMPAT_VERSION
      See Also:
    • LAYOUT_FORMAT_VERSION

      public static final int LAYOUT_FORMAT_VERSION
      See Also:
  • Constructor Details

    • LedgerLayout

      public LedgerLayout(String managerFactoryCls, int managerVersion)
      Ledger Layout Constructor.
      Parameters:
      managerFactoryCls - Ledger Manager Factory Class
      managerVersion - Ledger Manager Version
    • LedgerLayout

      LedgerLayout(String managerFactoryCls, int managerVersion, int layoutVersion)
  • Method Details

    • serialize

      public byte[] serialize() throws IOException
      Generates a byte array based on the LedgerLayout object.
      Returns:
      byte[]
      Throws:
      IOException
    • parseLayout

      public static LedgerLayout parseLayout(byte[] bytes) throws IOException
      Parses a given byte array and transforms into a LedgerLayout object.
      Parameters:
      bytes - byte array to parse
      Returns:
      LedgerLayout
      Throws:
      IOException - if the given byte[] cannot be parsed
    • getManagerFactoryClass

      public String getManagerFactoryClass()
    • getManagerVersion

      public int getManagerVersion()
    • getLayoutFormatVersion

      public int getLayoutFormatVersion()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object