| Modifier and Type | Class and Description |
|---|---|
| private static class | IndexPageCache.
IndexPageCache implementation of an Index |
| private static class | IndexPageCache.
Keeps track of the extra info for an index page. |
| private class | IndexPageCache.
Keeps track of the main info for an index page. |
| private static class | IndexPageCache.
A view of an index page's entries which combines the normal entries and tail entry into one collection. |
| private static enum | |
| private class | IndexPageCache.
Utility class for running index validation. |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | dataPages
the currently loaded pages for this index, pageNumber -> page |
| private final IndexData | indexData
the index whose pages this cache is managing |
| private static final int | MAX_CACHE_SIZE
max number of pages to cache (unless a write operation is in progress) |
| private final List | modifiedPages
the currently modified index pages |
| private IndexPageCache. | rootPage
the root page for the index |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | addEntry(IndexPageCache.
the page to which to add the entry cacheDataPage,the index at which to add the entry entryIdx, IndexData.the entry to add newEntryAdds the entry to the given page at the given index. |
| private void | addParentEntry(IndexPageCache.
the parent page to which to add the entry parentDataPage,the child from which to get the entry to add childDataPageAdds an entry for the given child page to the given parent page. |
| private void | addToPeersBefore(IndexPageCache.
the new index page newDataPage,the current index page origDataPageInserts the new page as a peer between the given original page and any previous peer page. |
| private IndexPageCache. | Returns: the newly created pagethe parent page for the new page parentPageNumber, boolean whether or not the new page is a leaf page isLeaf, int the level of the new page in the index tree level)Allocates a new index page with the given parent page and type. |
| private List | collectPages(List<Object>
the List to update pages, IndexPageCache.the index page to collect dpMainCollects all the cache pages in the cache. |
| private void | deleteDataPage(IndexPageCache.
Deletes the given index page from the file (clears the page). |
| private void | demoteTail(IndexPageCache.
the page whose tail must be updated cacheDataPageMakes the tail entry of the given page a normal entry on that page, done when there is only one entry left on a page, and it is the tail. |
| public IndexPageCache. | findCacheDataPage(IndexData.
the entry to find eFinds the index page on which the given entry does or should reside. |
| public IndexPageCache. | getCacheDataPage(Integer pageNumber)
Returns a CacheDataPage for the given page number, may be |
| private IndexPageCache. | getDataPage(Integer pageNumber)
Returns a DataPageMain for the given page number, may be |
| public IndexData | |
| public PageChannel | |
| private void | |
| private IndexPageCache. | Returns: the newly created page nested under the root pagethe root data page rootDataPageCopies the current root page info into a new page and nests this page under the root page. |
| private void | preparePagesForWriting()
Prepares any non-empty modified pages for writing as the second pass
during a |
| private void | promoteTail(IndexPageCache.
the cache data page being processed cacheDataPage,the main data page to be promoted lastMainMakes the last normal entry of the given page the tail entry on that page, done when there are multiple entries on a page and no tail entry. |
| private void | purgeOldPages()
Trims the size of the dataPages cache appropriately (assuming caller has already verified that the cache needs trimming). |
| private IndexPageCache. | |
| private void | removeDataPage(IndexPageCache.
the parent of the removed page parentDataPage,the page to remove cacheDataPage,the last entry for this page (before it was removed) oldLastEntryRemoves an index page which has become empty. |
| private IndexData. | removeEntry(IndexPageCache.
the page from which to remove the entry cacheDataPage,the index of the entry to remove entryIdx)Removes the entry with the given index from the given page. |
| private void | removeFromPeers(IndexPageCache.
the page to remove cacheDataPageRemoves a now empty index page from its next and previous peers. |
| private void | reparentChildren(IndexPageCache.
the page whose children need to be updated cacheDataPageSets the parent info for the children of the given page to the given page. |
| private void | replaceParentEntry(IndexPageCache.
the parent page in which to replace the entry parentDataPage,the child for which the entry is being replaced childDataPage,the old child entry for the child page oldEntryReplaces the entry for the given child page in the given parent page. |
| private void | separateFromNextPeer(IndexPageCache.
the index page to be separated cacheDataPageSeparates the given index page from any next peer page. |
| private void | setModified(IndexPageCache.
the modified index page cacheDataPageMarks the given index page as modified and saves it for writing, if necessary (if the page is already marked, does nothing). |
| public void | setRootPageNumber(int
the root page number pageNumber)Sets the root page for this index, must be called before normal usage. |
| private void | splitDataPage(IndexPageCache.
the page to split origDataPageSplits an index page which has too many entries on it. |
| public String | |
| private IndexData. | updateEntry(IndexPageCache.
the page to update cacheDataPage,the index at which to add/remove/replace the entry entryIdx, IndexData.the entry to add/replace newEntry,the type of update to make upTypeUpdates the entries on the given page according to the given updateType. |
| private void | updateParentEntry(IndexPageCache.
the parent page in which to update the entry parentDataPage,the child for which the entry is being updated childDataPage,the old child entry to remove/replace oldEntry,the new child entry to replace/add newEntry,the type of update to make upTypeUpdates the entry for the given child page in the given parent page according to the given updateType. |
| private void | updateParentTail(IndexPageCache.
the parent page in which to update the child tail parentDataPage,the child to add/replace childDataPage,the type of update to make upTypeUpdates the child tail info in the given parent page according to the given updateType. |
| pack-priv void | |
| private void | validateEntryForPage(IndexPageCache.
the page to which the entry will be added dpMain,the entry being added entryVerifies that the given entry type (node/leaf) is valid for the given page (node/leaf). |
| private String | |
| public void | |
| private void | |
| private void |