提交 2d330b23 authored 作者: noelgrandin's avatar noelgrandin

rename PageStore#removeRecord to removeFromCache, makes the other code much easier to understand

上级 33cde2d9
...@@ -206,7 +206,7 @@ public abstract class PageBtree extends Page { ...@@ -206,7 +206,7 @@ public abstract class PageBtree extends Page {
void setPageId(int id) { void setPageId(int id) {
changeCount = index.getPageStore().getChangeCount(); changeCount = index.getPageStore().getChangeCount();
written = false; written = false;
index.getPageStore().removeRecord(getPos()); index.getPageStore().removeFromCache(getPos());
setPos(id); setPos(id);
index.getPageStore().logUndo(this, null); index.getPageStore().logUndo(this, null);
remapChildren(); remapChildren();
......
...@@ -271,7 +271,7 @@ public class PageBtreeIndex extends PageIndex { ...@@ -271,7 +271,7 @@ public class PageBtreeIndex extends PageIndex {
PageBtree root = getPage(rootPageId); PageBtree root = getPage(rootPageId);
root.freeRecursive(); root.freeRecursive();
root = PageBtreeLeaf.create(this, rootPageId, PageBtree.ROOT); root = PageBtreeLeaf.create(this, rootPageId, PageBtree.ROOT);
store.removeRecord(rootPageId); store.removeFromCache(rootPageId);
store.update(root); store.update(root);
rowCount = 0; rowCount = 0;
} finally { } finally {
......
...@@ -162,7 +162,7 @@ abstract class PageData extends Page { ...@@ -162,7 +162,7 @@ abstract class PageData extends Page {
*/ */
void setPageId(int id) { void setPageId(int id) {
int old = getPos(); int old = getPos();
index.getPageStore().removeRecord(getPos()); index.getPageStore().removeFromCache(getPos());
setPos(id); setPos(id);
index.getPageStore().logUndo(this, null); index.getPageStore().logUndo(this, null);
remapChildren(old); remapChildren(old);
......
...@@ -391,7 +391,7 @@ public class PageDataIndex extends PageIndex { ...@@ -391,7 +391,7 @@ public class PageDataIndex extends PageIndex {
PageData root = getPage(rootPageId, 0); PageData root = getPage(rootPageId, 0);
root.freeRecursive(); root.freeRecursive();
root = PageDataLeaf.create(this, rootPageId, PageData.ROOT); root = PageDataLeaf.create(this, rootPageId, PageData.ROOT);
store.removeRecord(rootPageId); store.removeFromCache(rootPageId);
store.update(root); store.update(root);
rowCount = 0; rowCount = 0;
lastKey = 0; lastKey = 0;
......
...@@ -1339,7 +1339,7 @@ public class PageStore implements CacheWriter { ...@@ -1339,7 +1339,7 @@ public class PageStore implements CacheWriter {
* *
* @param pageId the page id * @param pageId the page id
*/ */
public synchronized void removeRecord(int pageId) { public synchronized void removeFromCache(int pageId) {
cache.remove(pageId); cache.remove(pageId);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论