Class PulsarLedgerIdGenerator
java.lang.Object
org.apache.pulsar.metadata.bookkeeper.PulsarLedgerIdGenerator
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.bookkeeper.meta.LedgerIdGenerator
public class PulsarLedgerIdGenerator
extends Object
implements org.apache.bookkeeper.meta.LedgerIdGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidgenerateLedgerId(org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.GenericCallback<Long> genericCallback) generateLedgerIdImpl(String prefix) Checks the existence of the long ledger id gen path.
-
Constructor Details
-
PulsarLedgerIdGenerator
-
-
Method Details
-
generateLedgerId
public void generateLedgerId(org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.GenericCallback<Long> genericCallback) - Specified by:
generateLedgerIdin interfaceorg.apache.bookkeeper.meta.LedgerIdGenerator
-
generateLedgerIdImpl
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
ledgerIdGenPathPresent
Checks the existence of the long ledger id gen path. Existence indicates we have switched from the legacy algorithm to the new method of generating 63-bit ids. If the existence is UNKNOWN, it looks in zk to find out. If it previously checked in zk, it returns that value. This value changes when we run out of ids < Integer.MAX_VALUE, and try to create the long ledger id gen path.
-