Class EntryLocationIndex
java.lang.Object
org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex
- All Implemented Interfaces:
Closeable,AutoCloseable
Maintains an index of the entry locations in the EntryLogger.
For each ledger multiple entries are stored in the same "record", represented
by the LedgerIndexPage class.
-
Constructor Summary
ConstructorsConstructorDescriptionEntryLocationIndex(ServerConfiguration conf, KeyValueStorageFactory storageFactory, String basePath, StatsLogger stats) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLocation(long ledgerId, long entryId, long location) voidaddLocation(KeyValueStorage.Batch batch, long ledgerId, long entryId, long location) voidclose()voidcompact()voiddelete(long ledgerId) longgetLastEntryInLedger(long ledgerId) longgetLocation(long ledgerId, long entryId) booleannewBatch()voidvoidupdateLocations(Iterable<EntryLocation> newLocations)
-
Constructor Details
-
EntryLocationIndex
public EntryLocationIndex(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
-
getLocation
- Throws:
IOException
-
getLastEntryInLedger
- Throws:
IOException
-
addLocation
- Throws:
IOException
-
newBatch
-
addLocation
public void addLocation(KeyValueStorage.Batch batch, long ledgerId, long entryId, long location) throws IOException - Throws:
IOException
-
updateLocations
- Throws:
IOException
-
delete
- Throws:
IOException
-
getEntryLocationDBPath
-
compact
- Throws:
IOException
-
isCompacting
public boolean isCompacting() -
removeOffsetFromDeletedLedgers
- Throws:
IOException
-