Class LedgerMetadataIndex
- java.lang.Object
-
- org.apache.bookkeeper.bookie.storage.ldb.LedgerMetadataIndex
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class LedgerMetadataIndex extends java.lang.Object implements java.io.CloseableMaintains an index for the ledgers metadata.The key is the ledgerId and the value is the
DbLedgerStorageDataFormats.LedgerDatacontent.
-
-
Constructor Summary
Constructors Constructor Description LedgerMetadataIndex(ServerConfiguration conf, KeyValueStorageFactory storageFactory, java.lang.String basePath, StatsLogger stats)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclearLimbo(long ledgerId)voidclose()voiddelete(long ledgerId)voidflush()Flushes all pending changes.DbLedgerStorageDataFormats.LedgerDataget(long ledgerId)java.lang.Iterable<java.lang.Long>getActiveLedgersInRange(long firstLedgerId, long lastLedgerId)(package private) intgetStorageStateFlags()voidremoveDeletedLedgers()voidset(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 Detail
-
LedgerMetadataIndex
public LedgerMetadataIndex(ServerConfiguration conf, KeyValueStorageFactory storageFactory, java.lang.String basePath, StatsLogger stats) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
get
public DbLedgerStorageDataFormats.LedgerData get(long ledgerId) throws java.io.IOException
- Throws:
java.io.IOException
-
set
public void set(long ledgerId, DbLedgerStorageDataFormats.LedgerData ledgerData) throws java.io.IOException- Throws:
java.io.IOException
-
delete
public void delete(long ledgerId) throws java.io.IOException- Throws:
java.io.IOException
-
getActiveLedgersInRange
public java.lang.Iterable<java.lang.Long> getActiveLedgersInRange(long firstLedgerId, long lastLedgerId) throws java.io.IOException- Throws:
java.io.IOException
-
setFenced
public boolean setFenced(long ledgerId) throws java.io.IOException- Throws:
java.io.IOException
-
setLimbo
public boolean setLimbo(long ledgerId) throws java.io.IOException- Throws:
java.io.IOException
-
clearLimbo
public boolean clearLimbo(long ledgerId) throws java.io.IOException- Throws:
java.io.IOException
-
setMasterKey
public void setMasterKey(long ledgerId, byte[] masterKey) throws java.io.IOException- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionFlushes all pending changes.- Throws:
java.io.IOException
-
removeDeletedLedgers
public void removeDeletedLedgers() throws java.io.IOException- Throws:
java.io.IOException
-
getStorageStateFlags
int getStorageStateFlags() throws java.io.IOException- Throws:
java.io.IOException
-
setStorageStateFlags
boolean setStorageStateFlags(int expected, int newFlags) throws java.io.IOException- Throws:
java.io.IOException
-
setExplicitLac
void setExplicitLac(long ledgerId, io.netty.buffer.ByteBuf lac) throws java.io.IOException- Throws:
java.io.IOException
-
-