Commit 0bc7132f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b776d01f
...@@ -98,10 +98,12 @@ def main(): ...@@ -98,10 +98,12 @@ def main():
# database records # database records
stor = FileStorage(outfs, read_only=True) stor = FileStorage(outfs, read_only=True)
oidPrevPos = {} # oid -> pos of last drec(oid)
emit("\nvar _1fs_dbEntryv = [...]dbEntry{") emit("\nvar _1fs_dbEntryv = [...]dbEntry{")
for txn in stor.iterator(): # txn is TransactionRecord for txn in stor.iterator(): # txn is TransactionRecord
emit("\tTxnHeader{") emit("\tTxnHeader{")
emit("\t\tTid:\t%s" % hex64(txn.tid)) emit("\t\tTid:\t%s," % hex64(txn.tid))
# -> TxnHeader # -> TxnHeader
#txn.tid, txn.status #txn.tid, txn.status
#.user .description .extension #.user .description .extension
...@@ -115,7 +117,7 @@ def main(): ...@@ -115,7 +117,7 @@ def main():
emit("\t\t\tTid:\t%s," % hex64(drec.tid)) emit("\t\t\tTid:\t%s," % hex64(drec.tid))
# drec: .data .prev (=prev_txn) .pos # drec: .data .prev (=prev_txn) .pos
# PrevDataRecPos emit("\t\t\tPrevDataRecPos:\t%i," % oidPrevPos.get(drec.oid, 0))
emit("\t\t\tTxnPos:\t%i," % txn._tpos) emit("\t\t\tTxnPos:\t%i," % txn._tpos)
assert drec.version == '' assert drec.version == ''
# DataLen # DataLen
...@@ -123,7 +125,10 @@ def main(): ...@@ -123,7 +125,10 @@ def main():
#.data .data_txn #.data .data_txn
emit("\t\t},") emit("\t\t},")
emit("\t}") oidPrevPos[drec.oid] = drec.pos
emit("\t},")
emit("}") emit("}")
......
...@@ -15,446 +15,504 @@ var _1fs_indexEntryv = [...]indexEntry{ ...@@ -15,446 +15,504 @@ var _1fs_indexEntryv = [...]indexEntry{
var _1fs_dbEntryv = [...]dbEntry{ var _1fs_dbEntryv = [...]dbEntry{
TxnHeader{ TxnHeader{
Tid: 0x0285cbac12c5f933 Tid: 0x0285cbac12c5f933,
DataHeader{ DataHeader{
Oid: 0, Oid: 0,
Tid: 0x0285cbac12c5f933, Tid: 0x0285cbac12c5f933,
PrevDataRecPos: 0,
TxnPos: 4, TxnPos: 4,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac2a3d70b3 Tid: 0x0285cbac2a3d70b3,
DataHeader{ DataHeader{
Oid: 0, Oid: 0,
Tid: 0x0285cbac2a3d70b3, Tid: 0x0285cbac2a3d70b3,
PrevDataRecPos: 52,
TxnPos: 162, TxnPos: 162,
}, },
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbac2a3d70b3, Tid: 0x0285cbac2a3d70b3,
PrevDataRecPos: 0,
TxnPos: 162, TxnPos: 162,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac2eeeef00 Tid: 0x0285cbac2eeeef00,
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbac2eeeef00, Tid: 0x0285cbac2eeeef00,
PrevDataRecPos: 367,
TxnPos: 444, TxnPos: 444,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac33a06d4c Tid: 0x0285cbac33a06d4c,
DataHeader{ DataHeader{
Oid: 0, Oid: 0,
Tid: 0x0285cbac33a06d4c, Tid: 0x0285cbac33a06d4c,
PrevDataRecPos: 230,
TxnPos: 589, TxnPos: 589,
}, },
DataHeader{ DataHeader{
Oid: 2, Oid: 2,
Tid: 0x0285cbac33a06d4c, Tid: 0x0285cbac33a06d4c,
PrevDataRecPos: 0,
TxnPos: 589, TxnPos: 589,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac3851eb99 Tid: 0x0285cbac3851eb99,
DataHeader{ DataHeader{
Oid: 0, Oid: 0,
Tid: 0x0285cbac3851eb99, Tid: 0x0285cbac3851eb99,
PrevDataRecPos: 657,
TxnPos: 892, TxnPos: 892,
}, },
DataHeader{ DataHeader{
Oid: 3, Oid: 3,
Tid: 0x0285cbac3851eb99, Tid: 0x0285cbac3851eb99,
PrevDataRecPos: 0,
TxnPos: 892, TxnPos: 892,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac3d0369e6 Tid: 0x0285cbac3d0369e6,
DataHeader{ DataHeader{
Oid: 0, Oid: 0,
Tid: 0x0285cbac3d0369e6, Tid: 0x0285cbac3d0369e6,
PrevDataRecPos: 960,
TxnPos: 1215, TxnPos: 1215,
}, },
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbac3d0369e6, Tid: 0x0285cbac3d0369e6,
PrevDataRecPos: 0,
TxnPos: 1215, TxnPos: 1215,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac41b4e833 Tid: 0x0285cbac41b4e833,
DataHeader{ DataHeader{
Oid: 2, Oid: 2,
Tid: 0x0285cbac41b4e833, Tid: 0x0285cbac41b4e833,
PrevDataRecPos: 815,
TxnPos: 1558, TxnPos: 1558,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac46666680 Tid: 0x0285cbac46666680,
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbac46666680, Tid: 0x0285cbac46666680,
PrevDataRecPos: 512,
TxnPos: 1703, TxnPos: 1703,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac4b17e4cc Tid: 0x0285cbac4b17e4cc,
DataHeader{ DataHeader{
Oid: 2, Oid: 2,
Tid: 0x0285cbac4b17e4cc, Tid: 0x0285cbac4b17e4cc,
PrevDataRecPos: 1626,
TxnPos: 1848, TxnPos: 1848,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac4fc96319 Tid: 0x0285cbac4fc96319,
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbac4fc96319, Tid: 0x0285cbac4fc96319,
PrevDataRecPos: 1481,
TxnPos: 1993, TxnPos: 1993,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac547ae166 Tid: 0x0285cbac547ae166,
DataHeader{ DataHeader{
Oid: 0, Oid: 0,
Tid: 0x0285cbac547ae166, Tid: 0x0285cbac547ae166,
PrevDataRecPos: 1283,
TxnPos: 2138, TxnPos: 2138,
}, },
DataHeader{ DataHeader{
Oid: 5, Oid: 5,
Tid: 0x0285cbac547ae166, Tid: 0x0285cbac547ae166,
PrevDataRecPos: 0,
TxnPos: 2138, TxnPos: 2138,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac592c5fb3 Tid: 0x0285cbac592c5fb3,
DataHeader{ DataHeader{
Oid: 0, Oid: 0,
Tid: 0x0285cbac592c5fb3, Tid: 0x0285cbac592c5fb3,
PrevDataRecPos: 2206,
TxnPos: 2501, TxnPos: 2501,
}, },
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbac592c5fb3, Tid: 0x0285cbac592c5fb3,
PrevDataRecPos: 0,
TxnPos: 2501, TxnPos: 2501,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac5dddde00 Tid: 0x0285cbac5dddde00,
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbac5dddde00, Tid: 0x0285cbac5dddde00,
PrevDataRecPos: 2061,
TxnPos: 2887, TxnPos: 2887,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac628f5c4c Tid: 0x0285cbac628f5c4c,
DataHeader{ DataHeader{
Oid: 3, Oid: 3,
Tid: 0x0285cbac628f5c4c, Tid: 0x0285cbac628f5c4c,
PrevDataRecPos: 1138,
TxnPos: 3035, TxnPos: 3035,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac6740da99 Tid: 0x0285cbac6740da99,
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbac6740da99, Tid: 0x0285cbac6740da99,
PrevDataRecPos: 1771,
TxnPos: 3183, TxnPos: 3183,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac6bf258e6 Tid: 0x0285cbac6bf258e6,
DataHeader{ DataHeader{
Oid: 5, Oid: 5,
Tid: 0x0285cbac6bf258e6, Tid: 0x0285cbac6bf258e6,
PrevDataRecPos: 2424,
TxnPos: 3331, TxnPos: 3331,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac70a3d733 Tid: 0x0285cbac70a3d733,
DataHeader{ DataHeader{
Oid: 3, Oid: 3,
Tid: 0x0285cbac70a3d733, Tid: 0x0285cbac70a3d733,
PrevDataRecPos: 3105,
TxnPos: 3479, TxnPos: 3479,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac75555580 Tid: 0x0285cbac75555580,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbac75555580, Tid: 0x0285cbac75555580,
PrevDataRecPos: 2809,
TxnPos: 3627, TxnPos: 3627,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac7a06d3cc Tid: 0x0285cbac7a06d3cc,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbac7a06d3cc, Tid: 0x0285cbac7a06d3cc,
PrevDataRecPos: 3697,
TxnPos: 3775, TxnPos: 3775,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac7eb85219 Tid: 0x0285cbac7eb85219,
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbac7eb85219, Tid: 0x0285cbac7eb85219,
PrevDataRecPos: 3253,
TxnPos: 3923, TxnPos: 3923,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac8369d066 Tid: 0x0285cbac8369d066,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbac8369d066, Tid: 0x0285cbac8369d066,
PrevDataRecPos: 3845,
TxnPos: 4071, TxnPos: 4071,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac881b4eb3 Tid: 0x0285cbac881b4eb3,
DataHeader{ DataHeader{
Oid: 2, Oid: 2,
Tid: 0x0285cbac881b4eb3, Tid: 0x0285cbac881b4eb3,
PrevDataRecPos: 1916,
TxnPos: 4219, TxnPos: 4219,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac8ccccd00 Tid: 0x0285cbac8ccccd00,
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbac8ccccd00, Tid: 0x0285cbac8ccccd00,
PrevDataRecPos: 3993,
TxnPos: 4367, TxnPos: 4367,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac917e4b4c Tid: 0x0285cbac917e4b4c,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbac917e4b4c, Tid: 0x0285cbac917e4b4c,
PrevDataRecPos: 4141,
TxnPos: 4515, TxnPos: 4515,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac962fc999 Tid: 0x0285cbac962fc999,
DataHeader{ DataHeader{
Oid: 5, Oid: 5,
Tid: 0x0285cbac962fc999, Tid: 0x0285cbac962fc999,
PrevDataRecPos: 3401,
TxnPos: 4663, TxnPos: 4663,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac9ae147e6 Tid: 0x0285cbac9ae147e6,
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbac9ae147e6, Tid: 0x0285cbac9ae147e6,
PrevDataRecPos: 2957,
TxnPos: 4811, TxnPos: 4811,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbac9f92c633 Tid: 0x0285cbac9f92c633,
DataHeader{ DataHeader{
Oid: 0, Oid: 0,
Tid: 0x0285cbac9f92c633, Tid: 0x0285cbac9f92c633,
PrevDataRecPos: 2571,
TxnPos: 4959, TxnPos: 4959,
}, },
DataHeader{ DataHeader{
Oid: 7, Oid: 7,
Tid: 0x0285cbac9f92c633, Tid: 0x0285cbac9f92c633,
PrevDataRecPos: 0,
TxnPos: 4959, TxnPos: 4959,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbaca4444480 Tid: 0x0285cbaca4444480,
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbaca4444480, Tid: 0x0285cbaca4444480,
PrevDataRecPos: 4881,
TxnPos: 5365, TxnPos: 5365,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbaca8f5c2cc Tid: 0x0285cbaca8f5c2cc,
DataHeader{ DataHeader{
Oid: 5, Oid: 5,
Tid: 0x0285cbaca8f5c2cc, Tid: 0x0285cbaca8f5c2cc,
PrevDataRecPos: 4733,
TxnPos: 5513, TxnPos: 5513,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacada74119 Tid: 0x0285cbacada74119,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbacada74119, Tid: 0x0285cbacada74119,
PrevDataRecPos: 4585,
TxnPos: 5661, TxnPos: 5661,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacb258bf66 Tid: 0x0285cbacb258bf66,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbacb258bf66, Tid: 0x0285cbacb258bf66,
PrevDataRecPos: 5731,
TxnPos: 5809, TxnPos: 5809,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacb70a3db3 Tid: 0x0285cbacb70a3db3,
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbacb70a3db3, Tid: 0x0285cbacb70a3db3,
PrevDataRecPos: 5435,
TxnPos: 5957, TxnPos: 5957,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacbbbbbc00 Tid: 0x0285cbacbbbbbc00,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbacbbbbbc00, Tid: 0x0285cbacbbbbbc00,
PrevDataRecPos: 5879,
TxnPos: 6105, TxnPos: 6105,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacc06d3a4c Tid: 0x0285cbacc06d3a4c,
DataHeader{ DataHeader{
Oid: 3, Oid: 3,
Tid: 0x0285cbacc06d3a4c, Tid: 0x0285cbacc06d3a4c,
PrevDataRecPos: 3549,
TxnPos: 6253, TxnPos: 6253,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacc51eb899 Tid: 0x0285cbacc51eb899,
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbacc51eb899, Tid: 0x0285cbacc51eb899,
PrevDataRecPos: 4437,
TxnPos: 6401, TxnPos: 6401,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacc9d036e6 Tid: 0x0285cbacc9d036e6,
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbacc9d036e6, Tid: 0x0285cbacc9d036e6,
PrevDataRecPos: 6027,
TxnPos: 6549, TxnPos: 6549,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacce81b533 Tid: 0x0285cbacce81b533,
DataHeader{ DataHeader{
Oid: 7, Oid: 7,
Tid: 0x0285cbacce81b533, Tid: 0x0285cbacce81b533,
PrevDataRecPos: 5287,
TxnPos: 6697, TxnPos: 6697,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacd3333380 Tid: 0x0285cbacd3333380,
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbacd3333380, Tid: 0x0285cbacd3333380,
PrevDataRecPos: 6471,
TxnPos: 6845, TxnPos: 6845,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacd7e4b1cc Tid: 0x0285cbacd7e4b1cc,
DataHeader{ DataHeader{
Oid: 2, Oid: 2,
Tid: 0x0285cbacd7e4b1cc, Tid: 0x0285cbacd7e4b1cc,
PrevDataRecPos: 4289,
TxnPos: 6993, TxnPos: 6993,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacdc963019 Tid: 0x0285cbacdc963019,
DataHeader{ DataHeader{
Oid: 1, Oid: 1,
Tid: 0x0285cbacdc963019, Tid: 0x0285cbacdc963019,
PrevDataRecPos: 6915,
TxnPos: 7141, TxnPos: 7141,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbace147ae66 Tid: 0x0285cbace147ae66,
DataHeader{ DataHeader{
Oid: 5, Oid: 5,
Tid: 0x0285cbace147ae66, Tid: 0x0285cbace147ae66,
PrevDataRecPos: 5583,
TxnPos: 7289, TxnPos: 7289,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbace5f92cb3 Tid: 0x0285cbace5f92cb3,
DataHeader{ DataHeader{
Oid: 7, Oid: 7,
Tid: 0x0285cbace5f92cb3, Tid: 0x0285cbace5f92cb3,
PrevDataRecPos: 6767,
TxnPos: 7437, TxnPos: 7437,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbaceaaaab00 Tid: 0x0285cbaceaaaab00,
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbaceaaaab00, Tid: 0x0285cbaceaaaab00,
PrevDataRecPos: 6619,
TxnPos: 7585, TxnPos: 7585,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacef5c294c Tid: 0x0285cbacef5c294c,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbacef5c294c, Tid: 0x0285cbacef5c294c,
PrevDataRecPos: 6175,
TxnPos: 7733, TxnPos: 7733,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacf40da799 Tid: 0x0285cbacf40da799,
DataHeader{ DataHeader{
Oid: 3, Oid: 3,
Tid: 0x0285cbacf40da799, Tid: 0x0285cbacf40da799,
PrevDataRecPos: 6323,
TxnPos: 7881, TxnPos: 7881,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacf8bf25e6 Tid: 0x0285cbacf8bf25e6,
DataHeader{ DataHeader{
Oid: 2, Oid: 2,
Tid: 0x0285cbacf8bf25e6, Tid: 0x0285cbacf8bf25e6,
PrevDataRecPos: 7063,
TxnPos: 8029, TxnPos: 8029,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbacfd70a433 Tid: 0x0285cbacfd70a433,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbacfd70a433, Tid: 0x0285cbacfd70a433,
PrevDataRecPos: 7803,
TxnPos: 8177, TxnPos: 8177,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbad02222280 Tid: 0x0285cbad02222280,
DataHeader{ DataHeader{
Oid: 3, Oid: 3,
Tid: 0x0285cbad02222280, Tid: 0x0285cbad02222280,
PrevDataRecPos: 7951,
TxnPos: 8325, TxnPos: 8325,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbad06d3a0cc Tid: 0x0285cbad06d3a0cc,
DataHeader{ DataHeader{
Oid: 4, Oid: 4,
Tid: 0x0285cbad06d3a0cc, Tid: 0x0285cbad06d3a0cc,
PrevDataRecPos: 7655,
TxnPos: 8473, TxnPos: 8473,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbad0b851f19 Tid: 0x0285cbad0b851f19,
DataHeader{ DataHeader{
Oid: 3, Oid: 3,
Tid: 0x0285cbad0b851f19, Tid: 0x0285cbad0b851f19,
PrevDataRecPos: 8395,
TxnPos: 8621, TxnPos: 8621,
}, },
} },
TxnHeader{ TxnHeader{
Tid: 0x0285cbad10369d66 Tid: 0x0285cbad10369d66,
DataHeader{ DataHeader{
Oid: 6, Oid: 6,
Tid: 0x0285cbad10369d66, Tid: 0x0285cbad10369d66,
PrevDataRecPos: 8247,
TxnPos: 8769, TxnPos: 8769,
}, },
} },
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment