提交 b52978ad authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Merge branch 'master' into misc

...@@ -993,7 +993,7 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -993,7 +993,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
* @param memory the number of bytes used for this page * @param memory the number of bytes used for this page
*/ */
protected final void removePage(long pos, int memory) { protected final void removePage(long pos, int memory) {
store.removePage(this, pos, memory); store.removePage(pos, memory);
} }
/** /**
...@@ -1190,10 +1190,10 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -1190,10 +1190,10 @@ public class MVMap<K, V> extends AbstractMap<K, V>
int attempt = 0; int attempt = 0;
int keyCount; int keyCount;
while((keyCount = rootReference.getAppendCounter()) > 0) { while((keyCount = rootReference.getAppendCounter()) > 0) {
Page page = Page.create(this, Page page = Page.createLeaf(this,
Arrays.copyOf(keysBuffer, keyCount), Arrays.copyOf(keysBuffer, keyCount),
Arrays.copyOf(valuesBuffer, keyCount), Arrays.copyOf(valuesBuffer, keyCount),
null, keyCount, 0); 0);
CursorPos pos = rootReference.root.getAppendCursorPos(null); CursorPos pos = rootReference.root.getAppendCursorPos(null);
assert page.map == this; assert page.map == this;
assert pos != null; assert pos != null;
...@@ -1215,7 +1215,7 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -1215,7 +1215,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
Page.PageReference children[] = new Page.PageReference[] { Page.PageReference children[] = new Page.PageReference[] {
new Page.PageReference(p), new Page.PageReference(p),
new Page.PageReference(page)}; new Page.PageReference(page)};
p = Page.create(this, keys, null, children, p.getTotalCount() + page.getTotalCount(), 0); p = Page.createNode(this, keys, children, p.getTotalCount() + page.getTotalCount(), 0);
} }
break; break;
} }
...@@ -1784,7 +1784,7 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -1784,7 +1784,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
new Page.PageReference(p), new Page.PageReference(p),
new Page.PageReference(split) new Page.PageReference(split)
}; };
p = Page.create(this, keys, null, children, totalCount, 0); p = Page.createNode(this, keys, children, totalCount, 0);
break; break;
} }
Page c = p; Page c = p;
......
...@@ -154,7 +154,7 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> { ...@@ -154,7 +154,7 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
new Page.PageReference(split), new Page.PageReference(split),
Page.PageReference.EMPTY Page.PageReference.EMPTY
}; };
p = Page.create(this, keys, null, children, totalCount, 0); p = Page.createNode(this, keys, children, totalCount, 0);
if(store.getFileStore() != null) { if(store.getFileStore() != null) {
store.registerUnsavedPage(p.getMemory()); store.registerUnsavedPage(p.getMemory());
} }
......
...@@ -182,10 +182,6 @@ public class Transaction { ...@@ -182,10 +182,6 @@ public class Transaction {
int currentStatus = getStatus(currentState); int currentStatus = getStatus(currentState);
boolean valid; boolean valid;
switch (status) { switch (status) {
case STATUS_OPEN:
valid = currentStatus == STATUS_CLOSED ||
currentStatus == STATUS_ROLLING_BACK;
break;
case STATUS_ROLLING_BACK: case STATUS_ROLLING_BACK:
valid = currentStatus == STATUS_OPEN; valid = currentStatus == STATUS_OPEN;
break; break;
...@@ -207,6 +203,7 @@ public class Transaction { ...@@ -207,6 +203,7 @@ public class Transaction {
valid = currentStatus == STATUS_COMMITTED || valid = currentStatus == STATUS_COMMITTED ||
currentStatus == STATUS_ROLLED_BACK; currentStatus == STATUS_ROLLED_BACK;
break; break;
case STATUS_OPEN:
default: default:
valid = false; valid = false;
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论