提交 1684aacb authored 作者: Andrei Tokar's avatar Andrei Tokar

Order chunks by version instead of id (possibly wrapped around)

上级 bcf35f36
...@@ -712,7 +712,7 @@ public class MVStore { ...@@ -712,7 +712,7 @@ public class MVStore {
Queue<Chunk> lastChunkCandidates = new PriorityQueue<>(Math.max(32, (int)(blocksInStore / 4)), new Comparator<Chunk>() { Queue<Chunk> lastChunkCandidates = new PriorityQueue<>(Math.max(32, (int)(blocksInStore / 4)), new Comparator<Chunk>() {
@Override @Override
public int compare(Chunk one, Chunk two) { public int compare(Chunk one, Chunk two) {
int result = Integer.compare(two.id, one.id); int result = Long.compare(two.version, one.version);
if (result == 0) { if (result == 0) {
// out of two versions of the same chunk we prefer the one // out of two versions of the same chunk we prefer the one
// close to the begining of file (presumably later version) // close to the begining of file (presumably later version)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论