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

MVStore file format documentation.

上级 996aaab0
...@@ -212,9 +212,7 @@ public class Chunk { ...@@ -212,9 +212,7 @@ public class Chunk {
DataUtils.appendMap(buff, "pages", pageCount); DataUtils.appendMap(buff, "pages", pageCount);
DataUtils.appendMap(buff, "root", metaRootPos); DataUtils.appendMap(buff, "root", metaRootPos);
DataUtils.appendMap(buff, "time", time); DataUtils.appendMap(buff, "time", time);
if (version != id) { DataUtils.appendMap(buff, "version", version);
DataUtils.appendMap(buff, "version", version);
}
return buff.toString(); return buff.toString();
} }
...@@ -222,9 +220,7 @@ public class Chunk { ...@@ -222,9 +220,7 @@ public class Chunk {
StringBuilder buff = new StringBuilder(); StringBuilder buff = new StringBuilder();
DataUtils.appendMap(buff, "chunk", id); DataUtils.appendMap(buff, "chunk", id);
DataUtils.appendMap(buff, "block", block); DataUtils.appendMap(buff, "block", block);
if (version != id) { DataUtils.appendMap(buff, "version", version);
DataUtils.appendMap(buff, "version", version);
}
byte[] bytes = buff.toString().getBytes(DataUtils.LATIN); byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
int checksum = DataUtils.getFletcher32(bytes, bytes.length / 2 * 2); int checksum = DataUtils.getFletcher32(bytes, bytes.length / 2 * 2);
DataUtils.appendMap(buff, "fletcher", checksum); DataUtils.appendMap(buff, "fletcher", checksum);
......
...@@ -68,6 +68,9 @@ MVStore: ...@@ -68,6 +68,9 @@ MVStore:
- ensure data is overwritten eventually if the system doesn't have a - ensure data is overwritten eventually if the system doesn't have a
real-time clock (Raspberry Pi) and if there are few writes per startup real-time clock (Raspberry Pi) and if there are few writes per startup
- when opening, verify the footer of the chunk (also when following next pointers)
- test max length sum with length code 31 (which is Integer.MAX_VALUE)
- maybe change the length code to have lower gaps
- test chunk id rollover - test chunk id rollover
- document and review the file format - document and review the file format
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论