eBay / Jungle

An embedded key-value store library specialized for building state machine and log store
Apache License 2.0
224 stars 54 forks source link

[Jungle] Add cmd to get records by seqnum #118

Closed tobecontinued closed 3 years ago

tobecontinued commented 3 years ago
getrecord -s 1
0]
key: 0x7fd48d708a10 -- 0x7fd48d708a17, 8 (0x8) bytes
       0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
0x0   61 61 61 61 66 6b 63 67                            aaaafkcg

sequence number: 1
type: ^@
meta: 0x0, 0

value: 0x7fd48d70b730 -- 0x7fd48d70b930, 513 (0x201) bytes
         0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
  0x0   30 33 31 39 5f 31 36 34  37 34 35 5f 78 78 78 78   0319_164745_xxxx
...
0x200   78                                                 x

[1]
key: 0x7fd48d708a10 -- 0x7fd48d708a17, 8 (0x8) bytes
       0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
0x0   61 61 61 61 65 6c 74 79                            aaaaelty

sequence number: 2
type: ^@
meta: 0x0, 0
...

[99]
key: 0x7fd48d7345c0 -- 0x7fd48d7345c7, 8 (0x8) bytes
       0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
0x0   61 61 61 61 63 6f 6b 63                            aaaacokc

sequence number: 100
type:
meta: 0x0, 0

value: 0x7fd48d7346d0 -- 0x7fd48d7348d0, 513 (0x201) bytes
         0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
  0x0   30 33 31 39 5f 31 36 34  37 34 35 5f 78 78 78 78   0319_164745_xxxx
...
0x200   78                                                 x

more records may exist ...
getrecord -s 1 2
[0]
key: 0x7f8656d3f870 -- 0x7f8656d3f877, 8 (0x8) bytes
       0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
0x0   61 61 61 61 63 76 75 6b                            aaaacvuk

sequence number: 1
type:
meta: 0x0, 0

value: 0x7f8656d429f0 -- 0x7f8656d42bf0, 513 (0x201) bytes
         0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
  0x0   30 33 31 39 5f 31 36 35  38 32 32 5f 78 78 78 78   0319_165822_xxxx
...
0x200   78                                                 x

[1]
key: 0x7f8657461750 -- 0x7f8657461757, 8 (0x8) bytes
       0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
0x0   61 61 61 61 63 74 77 67                            aaaactwg

sequence number: 2
type:
meta: 0x0, 0

value: 0x7f8657461a20 -- 0x7f8657461c20, 513 (0x201) bytes
         0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f
  0x0   30 33 31 39 5f 31 36 35  38 32 32 5f 78 78 78 78   0319_165822_xxxx
...
0x200   78                                                 x