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