dfindexeddb 20241105__py3-none-any.whl → 20260205__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dfindexeddb/indexeddb/chromium/blink.py +116 -74
- dfindexeddb/indexeddb/chromium/definitions.py +240 -125
- dfindexeddb/indexeddb/chromium/record.py +651 -346
- dfindexeddb/indexeddb/chromium/sqlite.py +362 -0
- dfindexeddb/indexeddb/chromium/v8.py +100 -78
- dfindexeddb/indexeddb/cli.py +282 -121
- dfindexeddb/indexeddb/firefox/definitions.py +7 -4
- dfindexeddb/indexeddb/firefox/gecko.py +98 -74
- dfindexeddb/indexeddb/firefox/record.py +78 -26
- dfindexeddb/indexeddb/safari/definitions.py +5 -3
- dfindexeddb/indexeddb/safari/record.py +86 -53
- dfindexeddb/indexeddb/safari/webkit.py +85 -71
- dfindexeddb/indexeddb/types.py +4 -1
- dfindexeddb/leveldb/cli.py +146 -138
- dfindexeddb/leveldb/definitions.py +6 -2
- dfindexeddb/leveldb/descriptor.py +70 -56
- dfindexeddb/leveldb/ldb.py +39 -33
- dfindexeddb/leveldb/log.py +41 -30
- dfindexeddb/leveldb/plugins/chrome_notifications.py +30 -18
- dfindexeddb/leveldb/plugins/interface.py +5 -6
- dfindexeddb/leveldb/plugins/manager.py +10 -9
- dfindexeddb/leveldb/record.py +71 -62
- dfindexeddb/leveldb/utils.py +105 -13
- dfindexeddb/utils.py +36 -31
- dfindexeddb/version.py +2 -2
- dfindexeddb-20260205.dist-info/METADATA +171 -0
- dfindexeddb-20260205.dist-info/RECORD +41 -0
- {dfindexeddb-20241105.dist-info → dfindexeddb-20260205.dist-info}/WHEEL +1 -1
- dfindexeddb-20241105.dist-info/AUTHORS +0 -12
- dfindexeddb-20241105.dist-info/METADATA +0 -424
- dfindexeddb-20241105.dist-info/RECORD +0 -41
- {dfindexeddb-20241105.dist-info → dfindexeddb-20260205.dist-info}/entry_points.txt +0 -0
- {dfindexeddb-20241105.dist-info → dfindexeddb-20260205.dist-info/licenses}/LICENSE +0 -0
- {dfindexeddb-20241105.dist-info → dfindexeddb-20260205.dist-info}/top_level.txt +0 -0
dfindexeddb/leveldb/cli.py
CHANGED
|
@@ -14,29 +14,28 @@
|
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
"""A CLI tool for leveldb files."""
|
|
16
16
|
import argparse
|
|
17
|
+
import csv
|
|
17
18
|
import dataclasses
|
|
18
|
-
from datetime import datetime
|
|
19
19
|
import json
|
|
20
20
|
import pathlib
|
|
21
|
+
import sys
|
|
22
|
+
from datetime import datetime
|
|
23
|
+
from typing import Union
|
|
21
24
|
|
|
22
|
-
from dfindexeddb import utils
|
|
23
|
-
from dfindexeddb import
|
|
24
|
-
from dfindexeddb.leveldb import descriptor
|
|
25
|
-
from dfindexeddb.leveldb import ldb
|
|
26
|
-
from dfindexeddb.leveldb import log
|
|
27
|
-
from dfindexeddb.leveldb import record
|
|
25
|
+
from dfindexeddb import utils, version
|
|
26
|
+
from dfindexeddb.leveldb import descriptor, ldb, log, record
|
|
28
27
|
from dfindexeddb.leveldb.plugins import manager
|
|
29
28
|
|
|
30
|
-
|
|
31
29
|
_VALID_PRINTABLE_CHARACTERS = (
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
31
|
+
+ "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~."
|
|
32
|
+
)
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
class Encoder(json.JSONEncoder):
|
|
37
36
|
"""A JSON encoder class for dfleveldb fields."""
|
|
38
37
|
|
|
39
|
-
def default(self, o):
|
|
38
|
+
def default(self, o): # type: ignore[no-untyped-def]
|
|
40
39
|
"""Returns a serializable object for o."""
|
|
41
40
|
if dataclasses.is_dataclass(o):
|
|
42
41
|
o_dict = utils.asdict(o)
|
|
@@ -45,10 +44,10 @@ class Encoder(json.JSONEncoder):
|
|
|
45
44
|
out = []
|
|
46
45
|
for x in o:
|
|
47
46
|
if chr(x) not in _VALID_PRINTABLE_CHARACTERS:
|
|
48
|
-
out.append(f
|
|
47
|
+
out.append(f"\\x{x:02X}")
|
|
49
48
|
else:
|
|
50
49
|
out.append(chr(x))
|
|
51
|
-
return
|
|
50
|
+
return "".join(out)
|
|
52
51
|
if isinstance(o, datetime):
|
|
53
52
|
return o.isoformat()
|
|
54
53
|
if isinstance(o, set):
|
|
@@ -56,19 +55,34 @@ class Encoder(json.JSONEncoder):
|
|
|
56
55
|
return json.JSONEncoder.default(self, o)
|
|
57
56
|
|
|
58
57
|
|
|
59
|
-
def _Output(
|
|
58
|
+
def _Output(
|
|
59
|
+
structure: Union[
|
|
60
|
+
record.LevelDBRecord,
|
|
61
|
+
ldb.Block,
|
|
62
|
+
ldb.KeyValueRecord,
|
|
63
|
+
log.Block,
|
|
64
|
+
log.PhysicalRecord,
|
|
65
|
+
log.WriteBatch,
|
|
66
|
+
log.ParsedInternalKey,
|
|
67
|
+
descriptor.VersionEdit,
|
|
68
|
+
descriptor.LevelDBVersion,
|
|
69
|
+
],
|
|
70
|
+
output: str,
|
|
71
|
+
) -> None:
|
|
60
72
|
"""Helper method to output parsed structure to stdout."""
|
|
61
|
-
if output ==
|
|
73
|
+
if output == "csv":
|
|
74
|
+
csv.writer(sys.stdout).writerow(utils.asdict(structure).values())
|
|
75
|
+
elif output == "json":
|
|
62
76
|
print(json.dumps(structure, indent=2, cls=Encoder))
|
|
63
|
-
elif output ==
|
|
77
|
+
elif output == "jsonl":
|
|
64
78
|
print(json.dumps(structure, cls=Encoder))
|
|
65
|
-
elif output ==
|
|
79
|
+
elif output == "repr":
|
|
66
80
|
print(structure)
|
|
67
81
|
|
|
68
82
|
|
|
69
|
-
def DbCommand(args):
|
|
83
|
+
def DbCommand(args: argparse.Namespace) -> None:
|
|
70
84
|
"""The CLI for processing leveldb folders."""
|
|
71
|
-
if args.plugin and args.plugin ==
|
|
85
|
+
if args.plugin and args.plugin == "list":
|
|
72
86
|
for plugin, _ in manager.LeveldbPluginManager.GetPlugins():
|
|
73
87
|
print(plugin)
|
|
74
88
|
return
|
|
@@ -78,10 +92,10 @@ def DbCommand(args):
|
|
|
78
92
|
else:
|
|
79
93
|
plugin_class = None
|
|
80
94
|
|
|
81
|
-
for leveldb_record in record.FolderReader(
|
|
82
|
-
args.
|
|
83
|
-
|
|
84
|
-
|
|
95
|
+
for leveldb_record in record.FolderReader(args.source).GetRecords(
|
|
96
|
+
use_manifest=args.use_manifest,
|
|
97
|
+
use_sequence_number=args.use_sequence_number,
|
|
98
|
+
):
|
|
85
99
|
if plugin_class:
|
|
86
100
|
plugin_record = plugin_class.FromLevelDBRecord(leveldb_record)
|
|
87
101
|
_Output(plugin_record, output=args.output)
|
|
@@ -89,9 +103,9 @@ def DbCommand(args):
|
|
|
89
103
|
_Output(leveldb_record, output=args.output)
|
|
90
104
|
|
|
91
105
|
|
|
92
|
-
def LdbCommand(args):
|
|
106
|
+
def LdbCommand(args: argparse.Namespace) -> None:
|
|
93
107
|
"""The CLI for processing ldb files."""
|
|
94
|
-
if args.plugin and args.plugin ==
|
|
108
|
+
if args.plugin and args.plugin == "list":
|
|
95
109
|
for plugin, _ in manager.LeveldbPluginManager.GetPlugins():
|
|
96
110
|
print(plugin)
|
|
97
111
|
return
|
|
@@ -103,12 +117,12 @@ def LdbCommand(args):
|
|
|
103
117
|
|
|
104
118
|
ldb_file = ldb.FileReader(args.source)
|
|
105
119
|
|
|
106
|
-
if args.structure_type ==
|
|
120
|
+
if args.structure_type == "blocks":
|
|
107
121
|
# Prints block information.
|
|
108
122
|
for block in ldb_file.GetBlocks():
|
|
109
123
|
_Output(block, output=args.output)
|
|
110
124
|
|
|
111
|
-
elif args.structure_type ==
|
|
125
|
+
elif args.structure_type == "records" or not args.structure_type:
|
|
112
126
|
# Prints key value record information.
|
|
113
127
|
for key_value_record in ldb_file.GetKeyValueRecords():
|
|
114
128
|
if plugin_class:
|
|
@@ -118,12 +132,12 @@ def LdbCommand(args):
|
|
|
118
132
|
_Output(key_value_record, output=args.output)
|
|
119
133
|
|
|
120
134
|
else:
|
|
121
|
-
print(f
|
|
135
|
+
print(f"{args.structure_type} is not supported for ldb files.")
|
|
122
136
|
|
|
123
137
|
|
|
124
|
-
def LogCommand(args):
|
|
138
|
+
def LogCommand(args: argparse.Namespace) -> None:
|
|
125
139
|
"""The CLI for processing log files."""
|
|
126
|
-
if args.plugin and args.plugin ==
|
|
140
|
+
if args.plugin and args.plugin == "list":
|
|
127
141
|
for plugin, _ in manager.LeveldbPluginManager.GetPlugins():
|
|
128
142
|
print(plugin)
|
|
129
143
|
return
|
|
@@ -135,23 +149,25 @@ def LogCommand(args):
|
|
|
135
149
|
|
|
136
150
|
log_file = log.FileReader(args.source)
|
|
137
151
|
|
|
138
|
-
if args.structure_type ==
|
|
152
|
+
if args.structure_type == "blocks":
|
|
139
153
|
# Prints block information.
|
|
140
154
|
for block in log_file.GetBlocks():
|
|
141
155
|
_Output(block, output=args.output)
|
|
142
156
|
|
|
143
|
-
elif args.structure_type ==
|
|
157
|
+
elif args.structure_type == "physical_records":
|
|
144
158
|
# Prints log file physical record information.
|
|
145
159
|
for log_file_record in log_file.GetPhysicalRecords():
|
|
146
160
|
_Output(log_file_record, output=args.output)
|
|
147
161
|
|
|
148
|
-
elif args.structure_type ==
|
|
162
|
+
elif args.structure_type == "write_batches":
|
|
149
163
|
# Prints log file batch information.
|
|
150
164
|
for batch in log_file.GetWriteBatches():
|
|
151
165
|
_Output(batch, output=args.output)
|
|
152
166
|
|
|
153
|
-
elif (
|
|
154
|
-
|
|
167
|
+
elif (
|
|
168
|
+
args.structure_type in ("parsed_internal_key", "records")
|
|
169
|
+
or not args.structure_type
|
|
170
|
+
):
|
|
155
171
|
# Prints key value record information.
|
|
156
172
|
for internal_key_record in log_file.GetParsedInternalKeys():
|
|
157
173
|
if plugin_class:
|
|
@@ -161,10 +177,10 @@ def LogCommand(args):
|
|
|
161
177
|
_Output(internal_key_record, output=args.output)
|
|
162
178
|
|
|
163
179
|
else:
|
|
164
|
-
print(f
|
|
180
|
+
print(f"{args.structure_type} is not supported for log files.")
|
|
165
181
|
|
|
166
182
|
|
|
167
|
-
def DescriptorCommand(args):
|
|
183
|
+
def DescriptorCommand(args: argparse.Namespace) -> None:
|
|
168
184
|
"""The CLI for processing descriptor (MANIFEST) files."""
|
|
169
185
|
manifest_file = descriptor.FileReader(args.source)
|
|
170
186
|
|
|
@@ -172,164 +188,156 @@ def DescriptorCommand(args):
|
|
|
172
188
|
for levels in manifest_file.GetVersions():
|
|
173
189
|
_Output(levels, output=args.output)
|
|
174
190
|
|
|
175
|
-
elif args.structure_type ==
|
|
191
|
+
elif args.structure_type == "blocks":
|
|
176
192
|
# Prints block information.
|
|
177
193
|
for block in manifest_file.GetBlocks():
|
|
178
194
|
_Output(block, output=args.output)
|
|
179
195
|
|
|
180
|
-
elif args.structure_type ==
|
|
196
|
+
elif args.structure_type == "physical_records":
|
|
181
197
|
# Prints log file physical record information.
|
|
182
198
|
for log_file_record in manifest_file.GetPhysicalRecords():
|
|
183
199
|
_Output(log_file_record, output=args.output)
|
|
184
200
|
|
|
185
|
-
elif
|
|
186
|
-
or not args.structure_type):
|
|
201
|
+
elif args.structure_type == "versionedit" or not args.structure_type:
|
|
187
202
|
for version_edit in manifest_file.GetVersionEdits():
|
|
188
203
|
_Output(version_edit, output=args.output)
|
|
189
204
|
|
|
190
205
|
else:
|
|
191
|
-
print(f
|
|
206
|
+
print(f"{args.structure_type} is not supported for descriptor files.")
|
|
192
207
|
|
|
193
208
|
|
|
194
|
-
def App():
|
|
209
|
+
def App() -> None:
|
|
195
210
|
"""The CLI app entrypoint for parsing leveldb files."""
|
|
196
211
|
parser = argparse.ArgumentParser(
|
|
197
|
-
prog=
|
|
198
|
-
description=
|
|
199
|
-
epilog=f
|
|
212
|
+
prog="dfleveldb",
|
|
213
|
+
description="A cli tool for parsing leveldb files",
|
|
214
|
+
epilog=f"Version {version.GetVersion()}",
|
|
215
|
+
)
|
|
200
216
|
|
|
201
217
|
subparsers = parser.add_subparsers()
|
|
202
218
|
|
|
203
|
-
parser_db = subparsers.add_parser(
|
|
204
|
-
'db', help='Parse a directory as leveldb.')
|
|
219
|
+
parser_db = subparsers.add_parser("db", help="Parse a directory as leveldb.")
|
|
205
220
|
parser_db.add_argument(
|
|
206
|
-
|
|
207
|
-
|
|
221
|
+
"-s",
|
|
222
|
+
"--source",
|
|
208
223
|
required=True,
|
|
209
224
|
type=pathlib.Path,
|
|
210
|
-
help=
|
|
225
|
+
help="The source leveldb directory.",
|
|
226
|
+
)
|
|
211
227
|
recover_group = parser_db.add_mutually_exclusive_group()
|
|
212
228
|
recover_group.add_argument(
|
|
213
|
-
|
|
214
|
-
action=
|
|
215
|
-
help=
|
|
229
|
+
"--use_manifest",
|
|
230
|
+
action="store_true",
|
|
231
|
+
help="Use manifest file to determine active/deleted records.",
|
|
232
|
+
)
|
|
216
233
|
recover_group.add_argument(
|
|
217
|
-
|
|
218
|
-
action=
|
|
234
|
+
"--use_sequence_number",
|
|
235
|
+
action="store_true",
|
|
219
236
|
help=(
|
|
220
|
-
|
|
221
|
-
|
|
237
|
+
"Use sequence number and file offset to determine active/deleted "
|
|
238
|
+
"records."
|
|
239
|
+
),
|
|
240
|
+
)
|
|
222
241
|
parser_db.add_argument(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
choices=[
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
help='Output format. Default is json.')
|
|
231
|
-
parser_db.add_argument(
|
|
232
|
-
'--plugin',
|
|
233
|
-
help='Use plugin to parse records.')
|
|
242
|
+
"-o",
|
|
243
|
+
"--output",
|
|
244
|
+
choices=["csv", "json", "jsonl", "repr"],
|
|
245
|
+
default="json",
|
|
246
|
+
help="Output format. Default is json.",
|
|
247
|
+
)
|
|
248
|
+
parser_db.add_argument("--plugin", help="Use plugin to parse records.")
|
|
234
249
|
parser_db.set_defaults(func=DbCommand)
|
|
235
250
|
|
|
236
|
-
parser_log = subparsers.add_parser(
|
|
237
|
-
'log', help='Parse a leveldb log file.')
|
|
251
|
+
parser_log = subparsers.add_parser("log", help="Parse a leveldb log file.")
|
|
238
252
|
parser_log.add_argument(
|
|
239
|
-
|
|
240
|
-
|
|
253
|
+
"-s",
|
|
254
|
+
"--source",
|
|
241
255
|
required=True,
|
|
242
256
|
type=pathlib.Path,
|
|
243
|
-
help=
|
|
244
|
-
|
|
245
|
-
'-o',
|
|
246
|
-
'--output',
|
|
247
|
-
choices=[
|
|
248
|
-
'json',
|
|
249
|
-
'jsonl',
|
|
250
|
-
'repr'],
|
|
251
|
-
default='json',
|
|
252
|
-
help='Output format. Default is json.')
|
|
257
|
+
help="The source leveldb file.",
|
|
258
|
+
)
|
|
253
259
|
parser_log.add_argument(
|
|
254
|
-
|
|
255
|
-
|
|
260
|
+
"-o",
|
|
261
|
+
"--output",
|
|
262
|
+
choices=["csv", "json", "jsonl", "repr"],
|
|
263
|
+
default="json",
|
|
264
|
+
help="Output format. Default is json.",
|
|
265
|
+
)
|
|
266
|
+
parser_log.add_argument("--plugin", help="Use plugin to parse records.")
|
|
256
267
|
parser_log.add_argument(
|
|
257
|
-
|
|
258
|
-
|
|
268
|
+
"-t",
|
|
269
|
+
"--structure_type",
|
|
259
270
|
choices=[
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
271
|
+
"blocks",
|
|
272
|
+
"physical_records",
|
|
273
|
+
"write_batches",
|
|
274
|
+
"parsed_internal_key",
|
|
275
|
+
],
|
|
276
|
+
help="Parses the specified structure. Default is parsed_internal_key.",
|
|
277
|
+
)
|
|
265
278
|
parser_log.set_defaults(func=LogCommand)
|
|
266
279
|
|
|
267
280
|
parser_ldb = subparsers.add_parser(
|
|
268
|
-
|
|
281
|
+
"ldb", help="Parse a leveldb table (.ldb) file."
|
|
282
|
+
)
|
|
269
283
|
parser_ldb.add_argument(
|
|
270
|
-
|
|
271
|
-
|
|
284
|
+
"-s",
|
|
285
|
+
"--source",
|
|
272
286
|
required=True,
|
|
273
287
|
type=pathlib.Path,
|
|
274
|
-
help=
|
|
275
|
-
|
|
276
|
-
'-o',
|
|
277
|
-
'--output',
|
|
278
|
-
choices=[
|
|
279
|
-
'json',
|
|
280
|
-
'jsonl',
|
|
281
|
-
'repr'],
|
|
282
|
-
default='json',
|
|
283
|
-
help='Output format. Default is json.')
|
|
288
|
+
help="The source leveldb file",
|
|
289
|
+
)
|
|
284
290
|
parser_ldb.add_argument(
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
"-o",
|
|
292
|
+
"--output",
|
|
293
|
+
choices=["csv", "json", "jsonl", "repr"],
|
|
294
|
+
default="json",
|
|
295
|
+
help="Output format. Default is json.",
|
|
296
|
+
)
|
|
297
|
+
parser_ldb.add_argument("--plugin", help="Use plugin to parse records.")
|
|
287
298
|
parser_ldb.add_argument(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
choices=[
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
help='Parses the specified structure. Default is records.')
|
|
299
|
+
"-t",
|
|
300
|
+
"--structure_type",
|
|
301
|
+
choices=["blocks", "records"],
|
|
302
|
+
help="Parses the specified structure. Default is records.",
|
|
303
|
+
)
|
|
294
304
|
parser_ldb.set_defaults(func=LdbCommand)
|
|
295
305
|
|
|
296
306
|
parser_descriptor = subparsers.add_parser(
|
|
297
|
-
|
|
307
|
+
"descriptor", help="Parse a leveldb descriptor (MANIFEST) file."
|
|
308
|
+
)
|
|
298
309
|
parser_descriptor.add_argument(
|
|
299
|
-
|
|
300
|
-
|
|
310
|
+
"-s",
|
|
311
|
+
"--source",
|
|
301
312
|
required=True,
|
|
302
313
|
type=pathlib.Path,
|
|
303
|
-
help=
|
|
314
|
+
help="The source leveldb file",
|
|
315
|
+
)
|
|
304
316
|
parser_descriptor.add_argument(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
choices=[
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
default='json',
|
|
312
|
-
help='Output format. Default is json.')
|
|
317
|
+
"-o",
|
|
318
|
+
"--output",
|
|
319
|
+
choices=["csv", "json", "jsonl", "repr"],
|
|
320
|
+
default="json",
|
|
321
|
+
help="Output format. Default is json.",
|
|
322
|
+
)
|
|
313
323
|
db_group = parser_descriptor.add_mutually_exclusive_group()
|
|
314
324
|
db_group.add_argument(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
choices=[
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
'versionedit'
|
|
321
|
-
],
|
|
322
|
-
help='Parses the specified structure. Default is versionedit.')
|
|
325
|
+
"-t",
|
|
326
|
+
"--structure_type",
|
|
327
|
+
choices=["blocks", "physical_records", "versionedit"],
|
|
328
|
+
help="Parses the specified structure. Default is versionedit.",
|
|
329
|
+
)
|
|
323
330
|
db_group.add_argument(
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
action=
|
|
327
|
-
help=
|
|
331
|
+
"-v",
|
|
332
|
+
"--version_history",
|
|
333
|
+
action="store_true",
|
|
334
|
+
help="Parses the leveldb version history.",
|
|
335
|
+
)
|
|
328
336
|
parser_descriptor.set_defaults(func=DescriptorCommand)
|
|
329
337
|
|
|
330
338
|
args = parser.parse_args()
|
|
331
339
|
|
|
332
|
-
if not hasattr(args,
|
|
340
|
+
if not hasattr(args, "func"):
|
|
333
341
|
parser.print_usage()
|
|
334
342
|
else:
|
|
335
343
|
args.func(args)
|
|
@@ -19,23 +19,25 @@ import enum
|
|
|
19
19
|
BLOCK_RESTART_ENTRY_LENGTH = 4
|
|
20
20
|
BLOCK_TRAILER_SIZE = 5
|
|
21
21
|
TABLE_FOOTER_SIZE = 48
|
|
22
|
-
TABLE_MAGIC = b
|
|
22
|
+
TABLE_MAGIC = b"\x57\xfb\x80\x8b\x24\x75\x47\xdb"
|
|
23
23
|
|
|
24
24
|
PACKED_SEQUENCE_AND_TYPE_LENGTH = 8
|
|
25
25
|
SEQUENCE_LENGTH = 7
|
|
26
26
|
TYPE_LENGTH = 1
|
|
27
27
|
|
|
28
|
-
MANIFEST_FILENAME_PATTERN = r
|
|
28
|
+
MANIFEST_FILENAME_PATTERN = r"MANIFEST-[0-9]{6}"
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class BlockCompressionType(enum.IntEnum):
|
|
32
32
|
"""Block compression types."""
|
|
33
|
+
|
|
33
34
|
SNAPPY = 1
|
|
34
35
|
ZSTD = 2
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
class VersionEditTags(enum.IntEnum):
|
|
38
39
|
"""VersionEdit tags."""
|
|
40
|
+
|
|
39
41
|
COMPARATOR = 1
|
|
40
42
|
LOG_NUMBER = 2
|
|
41
43
|
NEXT_FILE_NUMBER = 3
|
|
@@ -49,6 +51,7 @@ class VersionEditTags(enum.IntEnum):
|
|
|
49
51
|
|
|
50
52
|
class LogFilePhysicalRecordType(enum.IntEnum):
|
|
51
53
|
"""Log file physical record types."""
|
|
54
|
+
|
|
52
55
|
FULL = 1
|
|
53
56
|
FIRST = 2
|
|
54
57
|
MIDDLE = 3
|
|
@@ -57,5 +60,6 @@ class LogFilePhysicalRecordType(enum.IntEnum):
|
|
|
57
60
|
|
|
58
61
|
class InternalRecordType(enum.IntEnum):
|
|
59
62
|
"""Internal record types."""
|
|
63
|
+
|
|
60
64
|
DELETED = 0
|
|
61
65
|
VALUE = 1
|