Class LedgerIdFormatter

java.lang.Object
org.apache.bookkeeper.util.LedgerIdFormatter
Direct Known Subclasses:
LedgerIdFormatter.HexLedgerIdFormatter, LedgerIdFormatter.LongLedgerIdFormatter, LedgerIdFormatter.UUIDLedgerIdFormatter

public abstract class LedgerIdFormatter extends Object
Formatter to format a ledgerId.
  • Field Details

    • LONG_LEDGERID_FORMATTER

      public static final LedgerIdFormatter LONG_LEDGERID_FORMATTER
  • Constructor Details

    • LedgerIdFormatter

      public LedgerIdFormatter()
  • Method Details

    • formatLedgerId

      public abstract String formatLedgerId(long ledgerId)
      Formats the LedgerId according to the type of the Formatter and return it in String format.
      Parameters:
      ledgerId -
      Returns:
    • readLedgerId

      public abstract long readLedgerId(String ledgerIdString)
      converts the ledgeridString, which is in format of the type of formatter, to the long value.
      Parameters:
      ledgerIdString -
      Returns:
    • newLedgerIdFormatter

      public static LedgerIdFormatter newLedgerIdFormatter(AbstractConfiguration<?> conf)
    • newLedgerIdFormatter

      public static LedgerIdFormatter newLedgerIdFormatter(String opt, AbstractConfiguration conf)