Skip to content

Commit

Permalink
leveldb: in some properties, change spaces to underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
mikez committed Dec 7, 2023
1 parent cc0d5a8 commit 1ba8dec
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions format/leveldb/leveldb_descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ const (
var tagTypes = scalar.UintMapSymStr{
tagTypeComparator: "comparator",
tagTypeLogNumber: "log_number",
tagTypeNextFileNumber: "next file number",
tagTypeLastSequence: "last sequence",
tagTypeCompactPointer: "compact pointer",
tagTypeDeletedFile: "deleted file",
tagTypeNewFile: "new file",
tagTypePrevLogNumber: "previous log number",
tagTypeNextFileNumber: "next_file_number",
tagTypeLastSequence: "last_sequence",
tagTypeCompactPointer: "compact_pointer",
tagTypeDeletedFile: "deleted_file",
tagTypeNewFile: "new_file",
tagTypePrevLogNumber: "previous_log_number",
}

func ldbDescriptorDecode(d *decode.D) any {
Expand Down
10 changes: 5 additions & 5 deletions format/leveldb/leveldb_descriptor.jq
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def _leveldb_descriptor_torepr:
(
.value
| if .comparator then (.comparator |= .data) else . end
| if ."new file" then (
."new file".largest_internal_key |= .data
| ."new file".smallest_internal_key |= .data
| if .new_file then (
.new_file.largest_internal_key |= .data
| .new_file.smallest_internal_key |= .data
) else . end
| if ."compact pointer" then (
."compact pointer".internal_key |= .data
| if .compact_pointer then (
.compact_pointer.internal_key |= .data
) else . end
)
end
Expand Down
8 changes: 4 additions & 4 deletions format/leveldb/testdata/leveldb_manifest.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ $ fq -d leveldb_descriptor dv uncompressed.ldb/MANIFEST-000004
0x20| 02 | . | key: "log_number" (2) 0x2a-0x2b (1)
0x20| 06 | . | value: 6 0x2b-0x2c (1)
| | | [1]{}: tag 0x2c-0x2e (2)
0x20| 09 | . | key: "previous log number" (9) 0x2c-0x2d (1)
0x20| 09 | . | key: "previous_log_number" (9) 0x2c-0x2d (1)
0x20| 00 | . | value: 0 0x2d-0x2e (1)
| | | [2]{}: tag 0x2e-0x30 (2)
0x20| 03 | . | key: "next file number" (3) 0x2e-0x2f (1)
0x20| 03 | . | key: "next_file_number" (3) 0x2e-0x2f (1)
0x20| 07| .| value: 7 0x2f-0x30 (1)
| | | [3]{}: tag 0x30-0x32 (2)
0x30|04 |. | key: "last sequence" (4) 0x30-0x31 (1)
0x30|04 |. | key: "last_sequence" (4) 0x30-0x31 (1)
0x30| 04 | . | value: 4 0x31-0x32 (1)
| | | [4]{}: tag 0x32-0x57 (37)
0x30| 07 | . | key: "new file" (7) 0x32-0x33 (1)
0x30| 07 | . | key: "new_file" (7) 0x32-0x33 (1)
| | | value{}: 0x33-0x57 (36)
0x30| 00 | . | level: 0 0x33-0x34 (1)
0x30| 05 | . | file_number: 5 0x34-0x35 (1)
Expand Down

0 comments on commit 1ba8dec

Please sign in to comment.