Package org.apache.bookkeeper.bookie
Class IndexInMemPageMgr
- java.lang.Object
-
- org.apache.bookkeeper.bookie.IndexInMemPageMgr
-
class IndexInMemPageMgr extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
entriesPerPage
(package private) int
pageLimit
(package private) org.apache.bookkeeper.bookie.IndexInMemPageMgr.InMemPageCollection
pageMapAndList
(package private) int
pageSize
-
Constructor Summary
Constructors Constructor Description IndexInMemPageMgr(int pageSize, int entriesPerPage, ServerConfiguration conf, IndexPersistenceMgr indexPersistenceManager, StatsLogger statsLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
flushOneOrMoreLedgers(boolean doAll)
(package private) long
getEntryOffset(long ledger, long entry)
(package private) long
getLastEntryInMem(long ledgerId)
(package private) LedgerEntryPage
getLedgerEntryPage(long ledger, long pageEntry)
Get the ledger entry page for a given pageEntry.(package private) LedgerEntryPage
getLedgerEntryPageFromCache(long ledger, long firstEntry, boolean onlyDirty)
int
getPageSize()
LedgerCache.PageEntriesIterable
listEntries(long ledgerId)
Return iterator over pages for mapping entries to entry loggers.(package private) void
putEntryOffset(long ledger, long entry, long offset)
(package private) void
removePagesForLedger(long ledgerId)
-
-
-
Constructor Detail
-
IndexInMemPageMgr
public IndexInMemPageMgr(int pageSize, int entriesPerPage, ServerConfiguration conf, IndexPersistenceMgr indexPersistenceManager, StatsLogger statsLogger)
-
-
Method Detail
-
getPageSize
public int getPageSize()
- Returns:
- page size used in ledger cache
-
getLedgerEntryPage
LedgerEntryPage getLedgerEntryPage(long ledger, long pageEntry) throws java.io.IOException
Get the ledger entry page for a given pageEntry.- Parameters:
ledger
- ledger idpageEntry
- first entry id of a given page- Returns:
- ledger entry page
- Throws:
java.io.IOException
-
getLedgerEntryPageFromCache
LedgerEntryPage getLedgerEntryPageFromCache(long ledger, long firstEntry, boolean onlyDirty)
-
removePagesForLedger
void removePagesForLedger(long ledgerId)
-
getLastEntryInMem
long getLastEntryInMem(long ledgerId)
-
flushOneOrMoreLedgers
void flushOneOrMoreLedgers(boolean doAll) throws java.io.IOException
- Throws:
java.io.IOException
-
putEntryOffset
void putEntryOffset(long ledger, long entry, long offset) throws java.io.IOException
- Throws:
java.io.IOException
-
getEntryOffset
long getEntryOffset(long ledger, long entry) throws java.io.IOException
- Throws:
java.io.IOException
-
listEntries
public LedgerCache.PageEntriesIterable listEntries(long ledgerId) throws java.io.IOException
Return iterator over pages for mapping entries to entry loggers.- Parameters:
ledgerId
-- Returns:
- Iterator over pages
- Throws:
java.io.IOException
-
-