提交 b604d5d1 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 5caf19d4
...@@ -859,9 +859,31 @@ public class DiskFile implements CacheWriter { ...@@ -859,9 +859,31 @@ public class DiskFile implements CacheWriter {
return comp; return comp;
} }
}); });
// RedoLogRecord last = null;
// for (int i = 0; i < redoBuffer.size(); i++) {
// RedoLogRecord entry = (RedoLogRecord) redoBuffer.get(i);
// if (entry.data != null) {
// continue;
// }
// if (last != null && entry.recordId != last.recordId) {
// writeRedoLog(last);
// }
// last = entry;
// }
// if (last != null) {
// writeRedoLog(last);
// }
int test;
// first write all deleted entries
RedoLogRecord last = null; RedoLogRecord last = null;
for (int i = 0; i < redoBuffer.size(); i++) { for (int i = 0; i < redoBuffer.size(); i++) {
RedoLogRecord entry = (RedoLogRecord) redoBuffer.get(i); RedoLogRecord entry = (RedoLogRecord) redoBuffer.get(i);
if (entry.data != null) {
continue;
}
if (last != null && entry.recordId != last.recordId) { if (last != null && entry.recordId != last.recordId) {
writeRedoLog(last); writeRedoLog(last);
} }
...@@ -870,6 +892,22 @@ public class DiskFile implements CacheWriter { ...@@ -870,6 +892,22 @@ public class DiskFile implements CacheWriter {
if (last != null) { if (last != null) {
writeRedoLog(last); writeRedoLog(last);
} }
// now write the last entry, skipping the deleted entries
last = null;
for (int i = 0; i < redoBuffer.size(); i++) {
RedoLogRecord entry = (RedoLogRecord) redoBuffer.get(i);
if (last != null && entry.recordId != last.recordId) {
if (last.data != null) {
writeRedoLog(last);
}
}
last = entry;
}
if (last != null && last.data != null) {
writeRedoLog(last);
}
redoBuffer.clear(); redoBuffer.clear();
redoBufferSize = 0; redoBufferSize = 0;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论