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.Closeable
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
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 void
addLocation(long ledgerId, long entryId, long location)
void
addLocation(KeyValueStorage.Batch batch, long ledgerId, long entryId, long location)
void
close()
void
compact()
void
delete(long ledgerId)
java.lang.String
getEntryLocationDBPath()
long
getLastEntryInLedger(long ledgerId)
long
getLocation(long ledgerId, long entryId)
boolean
isCompacting()
KeyValueStorage.Batch
newBatch()
void
removeOffsetFromDeletedLedgers()
void
updateLocations(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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in 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
-
-