1TKRZW_DBM_UTIL(1) User Commands TKRZW_DBM_UTIL(1)
2
3
4
6 tkrzw_dbm_util - manual page for tkrzw_dbm_util 1.0.17
7
9 tkrzw_dbm_util: DBM utilities of Tkrzw
10
11 Usage:
12 tkrzw_dbm_util create [common_options] [tuning_options] [op‐
13 tions] file
14
15 : Creates a database file.
16
17 tkrzw_dbm_util inspect [common_options] file [attr]
18
19 : Prints inspection of a database file.
20
21 tkrzw_dbm_util get [common_options] file key
22
23 : Gets a record and prints it.
24
25 tkrzw_dbm_util set [common_options] [options] file key
26
27 : Sets a record.
28
29 tkrzw_dbm_util remove [common_options] file key
30
31 : Removes a record.
32
33 tkrzw_dbm_util list [common_options] file
34
35 : Lists up records and prints them.
36
37 tkrzw_dbm_util rebuild [common_options] [tuning_options] file
38
39 : Rebuilds a database file for optimization.
40
41 tkrzw_dbm_util restore [common_options] old_file [new_file]
42
43 : Restores a broken database file.
44
45 tkrzw_dbm_util merge [common_options] dest_file src_files...
46
47 : Merges database files.
48
49 tkrzw_dbm_util export [common_options] [options] dbm_file
50 rec_file
51
52 : Exports records to a flat record file.
53
54 tkrzw_dbm_util import [common_options] [options] dbm_file
55 rec_file
56
57 : Imports records from a flat record file.
58
59 Common options:
60 --dbm impl : The name of a DBM implementation: auto, hash, tree, skip,
61 tiny, baby, cache, stdhash, stdtree, poly, shard. (default:
62 auto)
63
64 --file impl : The name of a file implementation: mmap-para, mmap-atom,
65 pos-para, pos-atom. (default: mmap-para)
66
67 --no_wait : Fails if the file is locked by another process.
68
69 --no_lock : Omits file locking.
70
71 --sync_hard : Synchronizes the file physically when closing.
72
73 --alloc_init num : The initial allocation size. (default: 1048576)
74
75 --alloc_inc num : The allocation increment factor. (default: 2.0)
76
77 --block_size num : The block size of the positional access file. (de‐
78 fault: 1)
79
80 --direct_io : Enables the direct I/O option of the positional access
81 file.
82
83 --sync_io : Enables the synchronous I/O option of the positional access
84 file.
85
86 --padding : Enables padding at the end of the file.
87
88 --pagecache : Enables the mini page cache in the process.
89
90 --multi : Calls xxxMulti methods for get, set, and remove subcommands.
91
92 Options for the create subcommand:
93 --truncate : Truncates an existing database file.
94
95 Options for the inspect subcommand:
96 --validate : Validates records.
97
98 Options for the set subcommand:
99 --no_overwrite : Fails if there's an existing record wit the same key.
100
101 --append str : Appends the value at the end after the given delimiter.
102
103 --incr num : Increments the value with the given initial value.
104
105 --reducer func : Sets the reducer for the skip database: none, first,
106 second, last, concat, concatnull, concattab, concatline, total.
107 (default: none)
108
109 Options for the list subcommand:
110 --move type : Type of movement: first, jump, jumplower, jumplowerinc,
111 jumpupper, jumpupperinc. (default: first)
112
113 --jump_key str : Specifies the jump key. (default: empty string)
114
115 --items num : The number of items to print. (default: 10)
116
117 --escape : C-style escape is applied to the TSV data.
118
119 --keys : Prints keys only.
120
121 Options for the rebuild subcommand:
122 --restore : Skips broken records to restore a broken database.
123
124 Options for the restore subcommand:
125 --auto str : The restore mode automatically done: none, default, de‐
126 fault-ns, sync, sync-ns. (default: none)
127
128 --end_offset : The exclusive end offset of records to read. (default:
129 -1)
130
131 --class : The class name given to PolyDBM or ShardDBM.
132
133 Options for the merge subcommand:
134 --reducer func : Sets the reducer for the skip database: none, first,
135 second, last, concat, concatnull, concattab, concatline, total.
136 (default: none)
137
138 Options for the export and import subcommands:
139 --tsv : The record file is in TSV format instead of flat record.
140
141 --escape : C-style escape/unescape is applied to the TSV data.
142
143 --keys : Exports keys only.
144
145 --ulog num : Uses update logs based on the timestamp.
146
147 --ulog_ids num num : Sets the server ID and the DBM index of update
148 logs.
149
150 Tuning options for HashDBM:
151 --in_place : Uses in-place rather than pre-defined ones.
152
153 --append : Uses appending rather than pre-defined ones.
154
155 --record_crc num : The record CRC mode: -1, 0, 8, 16, 32. (default: 0
156 or -1)
157
158 --record_comp str : The record compression mode: default, none, zlib,
159 zstd, lz4, lzma. (default: none or default)
160
161 --offset_width num : The width to represent the offset of records. (de‐
162 fault: 4 or -1)
163
164 --align_pow num : Sets the power to align records. (default: 3 or -1)
165
166 --buckets num : Sets the number of buckets for hashing. (default:
167 1048583 or -1)
168
169 Tuning options for TreeDBM:
170 --in_place : Uses in-place rather than pre-defined ones.
171
172 --append : Uses appending rather than pre-defined ones.
173
174 --record_crc num : The record CRC mode: -1, 0, 8, 16, 32. (default: 0
175 or -1)
176
177 --record_comp str : The record compression mode: default, none, zlib,
178 zstd, lz4, lzma. (default: none or default)
179
180 --offset_width num : The width to represent the offset of records. (de‐
181 fault: 4 or -1)
182
183 --align_pow num : Sets the power to align records. (default: 10 or -1)
184
185 --buckets num : Sets the number of buckets for hashing. (default:
186 131101 or -1)
187
188 --max_page_size num : Sets the maximum size of a page. (default: 8130
189 or -1)
190
191 --max_branches num : Sets the maximum number of branches of inner
192 nodes. (default: 256 or -1)
193
194 --comparator func : Sets the key comparator: lex, lexcase, dec, hex.
195 (default: lex)
196
197 Tuning options for SkipDBM:
198 --offset_width num : The width to represent the offset of records. (de‐
199 fault: 4)
200
201 --step_unit num : Sets the step unit of the skip list. (default: 4)
202
203 --max_level num : Sets the maximum level of the skip list. (default:
204 14)
205
206 --sort_mem_size num : Sets the memory size used for sorting. (default:
207 268435456)
208
209 --insert_in_order : Inserts records in ascending order of the key.
210
211 Options for PolyDBM and ShardDBM:
212 --params str : Sets the parameters in "key=value,key=value" format.
213
214
215
216tkrzw_dbm_util 1.0.17 October 2021 TKRZW_DBM_UTIL(1)