Class EntryLocationIndex
- java.lang.Object
-
- org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class EntryLocationIndex extends java.lang.Object implements java.io.CloseableMaintains an index of the entry locations in the EntryLogger.For each ledger multiple entries are stored in the same "record", represented by the
LedgerIndexPageclass.
-
-
Constructor Summary
Constructors Constructor Description EntryLocationIndex(ServerConfiguration conf, KeyValueStorageFactory storageFactory, java.lang.String basePath, StatsLogger stats)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLocation(long ledgerId, long entryId, long location)voidaddLocation(KeyValueStorage.Batch batch, long ledgerId, long entryId, long location)voidclose()voidcompact()voiddelete(long ledgerId)java.lang.StringgetEntryLocationDBPath()longgetLastEntryInLedger(long ledgerId)longgetLocation(long ledgerId, long entryId)booleanisCompacting()KeyValueStorage.BatchnewBatch()voidremoveOffsetFromDeletedLedgers()voidupdateLocations(java.lang.Iterable<EntryLocation> newLocations)
-
-
-
Constructor Detail
-
EntryLocationIndex
public EntryLocationIndex(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
-
getLocation
public long getLocation(long ledgerId, long entryId) throws java.io.IOException- Throws:
java.io.IOException
-
getLastEntryInLedger
public long getLastEntryInLedger(long ledgerId) throws java.io.IOException- Throws:
java.io.IOException
-
addLocation
public void addLocation(long ledgerId, long entryId, long location) throws java.io.IOException- Throws:
java.io.IOException
-
newBatch
public KeyValueStorage.Batch newBatch()
-
addLocation
public void addLocation(KeyValueStorage.Batch batch, long ledgerId, long entryId, long location) throws java.io.IOException
- Throws:
java.io.IOException
-
updateLocations
public void updateLocations(java.lang.Iterable<EntryLocation> newLocations) throws java.io.IOException
- Throws:
java.io.IOException
-
delete
public void delete(long ledgerId) throws java.io.IOException- Throws:
java.io.IOException
-
getEntryLocationDBPath
public java.lang.String getEntryLocationDBPath()
-
compact
public void compact() throws java.io.IOException- Throws:
java.io.IOException
-
isCompacting
public boolean isCompacting()
-
removeOffsetFromDeletedLedgers
public void removeOffsetFromDeletedLedgers() throws java.io.IOException- Throws:
java.io.IOException
-
-