提交 79746f08 authored 作者: Andrei Tokar's avatar Andrei Tokar

another attempt to fix the test

上级 9297b09e
...@@ -1065,7 +1065,9 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -1065,7 +1065,9 @@ public class MVMap<K, V> extends AbstractMap<K, V>
final boolean hasChangesSince(long version) { final boolean hasChangesSince(long version) {
RootReference rootReference = getRoot(); RootReference rootReference = getRoot();
return !rootReference.root.isComplete() || getVersion(rootReference) > version; Page root = rootReference.root;
return !root.isSaved() && root.getTotalCount() > 0 ||
getVersion(rootReference) > version;
} }
public boolean isSingleWriter() { public boolean isSingleWriter() {
...@@ -1195,7 +1197,6 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -1195,7 +1197,6 @@ public class MVMap<K, V> extends AbstractMap<K, V>
* @return potentially updated RootReference * @return potentially updated RootReference
*/ */
private RootReference flushAppendBuffer(RootReference rootReference) { private RootReference flushAppendBuffer(RootReference rootReference) {
beforeWrite();
int attempt = 0; int attempt = 0;
int keyCount; int keyCount;
while((keyCount = rootReference.getAppendCounter()) > 0) { while((keyCount = rootReference.getAppendCounter()) > 0) {
...@@ -1285,6 +1286,7 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -1285,6 +1286,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
RootReference rootReference = getRootInternal(); RootReference rootReference = getRootInternal();
int appendCounter = rootReference.getAppendCounter(); int appendCounter = rootReference.getAppendCounter();
if (appendCounter >= keysPerPage) { if (appendCounter >= keysPerPage) {
beforeWrite();
rootReference = flushAppendBuffer(rootReference); rootReference = flushAppendBuffer(rootReference);
appendCounter = rootReference.getAppendCounter(); appendCounter = rootReference.getAppendCounter();
assert appendCounter < keysPerPage; assert appendCounter < keysPerPage;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论