Class LedgerMetadataIndex
java.lang.Object
org.apache.bookkeeper.bookie.storage.ldb.LedgerMetadataIndex
- All Implemented Interfaces:
Closeable,AutoCloseable
Maintains an index for the ledgers metadata.
The key is the ledgerId and the value is the DbLedgerStorageDataFormats.LedgerData content.
-
Constructor Summary
ConstructorsConstructorDescriptionLedgerMetadataIndex(ServerConfiguration conf, KeyValueStorageFactory storageFactory, String basePath, StatsLogger stats) -
Method Summary
Modifier and TypeMethodDescriptionbooleanclearLimbo(long ledgerId) voidclose()voiddelete(long ledgerId) voidflush()Flushes all pending changes.get(long ledgerId) getActiveLedgersInRange(long firstLedgerId, long lastLedgerId) (package private) intvoidvoidset(long ledgerId, DbLedgerStorageDataFormats.LedgerData ledgerData) (package private) voidsetExplicitLac(long ledgerId, io.netty.buffer.ByteBuf lac) booleansetFenced(long ledgerId) booleansetLimbo(long ledgerId) voidsetMasterKey(long ledgerId, byte[] masterKey) (package private) booleansetStorageStateFlags(int expected, int newFlags)
-
Constructor Details
-
LedgerMetadataIndex
public LedgerMetadataIndex(ServerConfiguration conf, KeyValueStorageFactory storageFactory, String basePath, StatsLogger stats) throws IOException - Throws:
IOException
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
get
- Throws:
IOException
-
set
- Throws:
IOException
-
delete
- Throws:
IOException
-
getActiveLedgersInRange
public Iterable<Long> getActiveLedgersInRange(long firstLedgerId, long lastLedgerId) throws IOException - Throws:
IOException
-
setFenced
- Throws:
IOException
-
setLimbo
- Throws:
IOException
-
clearLimbo
- Throws:
IOException
-
setMasterKey
- Throws:
IOException
-
flush
Flushes all pending changes.- Throws:
IOException
-
removeDeletedLedgers
- Throws:
IOException
-
getStorageStateFlags
- Throws:
IOException
-
setStorageStateFlags
- Throws:
IOException
-
setExplicitLac
- Throws:
IOException
-