As titled. For dumping wal files, since a mapping from column family id to the user comparator object is needed to print the timestamp in human readable format, option [--db=<db_path>] is added to dump_wal command to allow the user to choose to optionally open the DB as read only instance and dump the wal file with better timestamp formatting.
Test plan:
Manually tested
dump_wal:
[dump a wal file specified with --walfile]
>> ./ldb --walfile=$TEST_DB/000004.log dump_wal --print_value
>>1,1,28,13,PUT(0) : 0x666F6F0100000000000000 : 0x7631
(Column family id: [0] contained in WAL are not opened in DB. Applied default hex formatting for user key. Specify --db=<db_path> to open DB for better user key formatting if it contains timestamp.)
[dump with --db specified for better timestamp formatting]
>>./ldb --path=/tmp/rocksdbtest-501/column_family_test_75359_17910784957761284041/000004.log dump
Sequence,Count,ByteSize,Physical Offset,Key(s) : value
1,1,28,13,PUT(0) : 0x666F6F0100000000000000 : 0x7631
(Column family id: [0] contained in WAL are not opened in DB. Applied default hex formatting for user key. Specify --db=<db_path> to open DB for better user key formatting if it contains timestamp.)
As titled. For dumping wal files, since a mapping from column family id to the user comparator object is needed to print the timestamp in human readable format, option
[--db=<db_path>]
is added todump_wal
command to allow the user to choose to optionally open the DB as read only instance and dump the wal file with better timestamp formatting.Test plan: Manually tested
dump_wal: [dump a wal file specified with --walfile]
[dump with --db specified for better timestamp formatting]
dump: [dump a file specified with --path]
[dump db specified with --db]
idump