|
31 | 31 | namespace libbitcoin { |
32 | 32 | namespace database { |
33 | 33 |
|
| 34 | +constexpr auto random = true; |
| 35 | +constexpr auto sequential = false; |
| 36 | + |
34 | 37 | BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) |
35 | 38 |
|
36 | 39 | // public |
@@ -134,85 +137,85 @@ CLASS::store(const settings& config) NOEXCEPT |
134 | 137 | // Archive. |
135 | 138 | // ------------------------------------------------------------------------ |
136 | 139 |
|
137 | | - header_head_(head(config.path / schema::dir::heads, schema::archive::header)), |
138 | | - header_body_(body(config.path, schema::archive::header), config.header_size, config.header_rate), |
| 140 | + header_head_(head(config.path / schema::dir::heads, schema::archive::header), 1, 0, random), |
| 141 | + header_body_(body(config.path, schema::archive::header), config.header_size, config.header_rate, sequential), |
139 | 142 | header(header_head_, header_body_, config.header_buckets), |
140 | 143 |
|
141 | | - input_head_(head(config.path / schema::dir::heads, schema::archive::input)), |
142 | | - input_body_(body(config.path, schema::archive::input), config.input_size, config.input_rate), |
| 144 | + input_head_(head(config.path / schema::dir::heads, schema::archive::input), 1, 0, random), |
| 145 | + input_body_(body(config.path, schema::archive::input), config.input_size, config.input_rate, sequential), |
143 | 146 | input(input_head_, input_body_), |
144 | 147 |
|
145 | | - output_head_(head(config.path / schema::dir::heads, schema::archive::output)), |
146 | | - output_body_(body(config.path, schema::archive::output), config.output_size, config.output_rate), |
| 148 | + output_head_(head(config.path / schema::dir::heads, schema::archive::output), 1, 0, random), |
| 149 | + output_body_(body(config.path, schema::archive::output), config.output_size, config.output_rate, sequential), |
147 | 150 | output(output_head_, output_body_), |
148 | 151 |
|
149 | | - point_head_(head(config.path / schema::dir::heads, schema::archive::point)), |
150 | | - point_body_(body(config.path, schema::archive::point), config.point_size, config.point_rate), |
| 152 | + point_head_(head(config.path / schema::dir::heads, schema::archive::point), 1, 0, random), |
| 153 | + point_body_(body(config.path, schema::archive::point), config.point_size, config.point_rate, sequential), |
151 | 154 | point(point_head_, point_body_, config.point_buckets), |
152 | 155 |
|
153 | | - ins_head_(head(config.path / schema::dir::heads, schema::archive::ins)), |
154 | | - ins_body_(body(config.path, schema::archive::ins), config.ins_size, config.ins_rate), |
| 156 | + ins_head_(head(config.path / schema::dir::heads, schema::archive::ins), 1, 0, random), |
| 157 | + ins_body_(body(config.path, schema::archive::ins), config.ins_size, config.ins_rate, sequential), |
155 | 158 | ins(ins_head_, ins_body_), |
156 | 159 |
|
157 | | - outs_head_(head(config.path / schema::dir::heads, schema::archive::outs)), |
158 | | - outs_body_(body(config.path, schema::archive::outs), config.outs_size, config.outs_rate), |
| 160 | + outs_head_(head(config.path / schema::dir::heads, schema::archive::outs), 1, 0, random), |
| 161 | + outs_body_(body(config.path, schema::archive::outs), config.outs_size, config.outs_rate, sequential), |
159 | 162 | outs(outs_head_, outs_body_), |
160 | 163 |
|
161 | | - tx_head_(head(config.path / schema::dir::heads, schema::archive::tx)), |
162 | | - tx_body_(body(config.path, schema::archive::tx), config.tx_size, config.tx_rate), |
| 164 | + tx_head_(head(config.path / schema::dir::heads, schema::archive::tx), 1, 0, random), |
| 165 | + tx_body_(body(config.path, schema::archive::tx), config.tx_size, config.tx_rate, sequential), |
163 | 166 | tx(tx_head_, tx_body_, config.tx_buckets), |
164 | 167 |
|
165 | | - txs_head_(head(config.path / schema::dir::heads, schema::archive::txs)), |
166 | | - txs_body_(body(config.path, schema::archive::txs), config.txs_size, config.txs_rate), |
| 168 | + txs_head_(head(config.path / schema::dir::heads, schema::archive::txs), 1, 0, random), |
| 169 | + txs_body_(body(config.path, schema::archive::txs), config.txs_size, config.txs_rate, sequential), |
167 | 170 | txs(txs_head_, txs_body_, config.txs_buckets), |
168 | 171 |
|
169 | 172 | // Indexes. |
170 | 173 | // ------------------------------------------------------------------------ |
171 | 174 |
|
172 | | - candidate_head_(head(config.path / schema::dir::heads, schema::indexes::candidate)), |
173 | | - candidate_body_(body(config.path, schema::indexes::candidate), config.candidate_size, config.candidate_rate), |
| 175 | + candidate_head_(head(config.path / schema::dir::heads, schema::indexes::candidate), 1, 0, random), |
| 176 | + candidate_body_(body(config.path, schema::indexes::candidate), config.candidate_size, config.candidate_rate, sequential), |
174 | 177 | candidate(candidate_head_, candidate_body_), |
175 | 178 |
|
176 | | - confirmed_head_(head(config.path / schema::dir::heads, schema::indexes::confirmed)), |
177 | | - confirmed_body_(body(config.path, schema::indexes::confirmed), config.confirmed_size, config.confirmed_rate), |
| 179 | + confirmed_head_(head(config.path / schema::dir::heads, schema::indexes::confirmed), 1, 0, random), |
| 180 | + confirmed_body_(body(config.path, schema::indexes::confirmed), config.confirmed_size, config.confirmed_rate, sequential), |
178 | 181 | confirmed(confirmed_head_, confirmed_body_), |
179 | 182 |
|
180 | | - strong_tx_head_(head(config.path / schema::dir::heads, schema::indexes::strong_tx)), |
181 | | - strong_tx_body_(body(config.path, schema::indexes::strong_tx), config.strong_tx_size, config.strong_tx_rate), |
| 183 | + strong_tx_head_(head(config.path / schema::dir::heads, schema::indexes::strong_tx), 1, 0, random), |
| 184 | + strong_tx_body_(body(config.path, schema::indexes::strong_tx), config.strong_tx_size, config.strong_tx_rate, sequential), |
182 | 185 | strong_tx(strong_tx_head_, strong_tx_body_, config.strong_tx_buckets), |
183 | 186 |
|
184 | 187 | // Caches. |
185 | 188 | // ------------------------------------------------------------------------ |
186 | 189 |
|
187 | | - duplicate_head_(head(config.path / schema::dir::heads, schema::caches::duplicate)), |
188 | | - duplicate_body_(body(config.path, schema::caches::duplicate), config.duplicate_size, config.duplicate_rate), |
| 190 | + duplicate_head_(head(config.path / schema::dir::heads, schema::caches::duplicate), 1, 0, random), |
| 191 | + duplicate_body_(body(config.path, schema::caches::duplicate), config.duplicate_size, config.duplicate_rate, sequential), |
189 | 192 | duplicate(duplicate_head_, duplicate_body_, config.duplicate_buckets), |
190 | 193 |
|
191 | | - prevout_head_(head(config.path / schema::dir::heads, schema::caches::prevout)), |
192 | | - prevout_body_(body(config.path, schema::caches::prevout), config.prevout_size, config.prevout_rate), |
| 194 | + prevout_head_(head(config.path / schema::dir::heads, schema::caches::prevout), 1, 0, random), |
| 195 | + prevout_body_(body(config.path, schema::caches::prevout), config.prevout_size, config.prevout_rate, sequential), |
193 | 196 | prevout(prevout_head_, prevout_body_, config.prevout_buckets), |
194 | 197 |
|
195 | | - validated_bk_head_(head(config.path / schema::dir::heads, schema::caches::validated_bk)), |
196 | | - validated_bk_body_(body(config.path, schema::caches::validated_bk), config.validated_bk_size, config.validated_bk_rate), |
| 198 | + validated_bk_head_(head(config.path / schema::dir::heads, schema::caches::validated_bk), 1, 0, random), |
| 199 | + validated_bk_body_(body(config.path, schema::caches::validated_bk), config.validated_bk_size, config.validated_bk_rate, sequential), |
197 | 200 | validated_bk(validated_bk_head_, validated_bk_body_, config.validated_bk_buckets), |
198 | 201 |
|
199 | | - validated_tx_head_(head(config.path / schema::dir::heads, schema::caches::validated_tx)), |
200 | | - validated_tx_body_(body(config.path, schema::caches::validated_tx), config.validated_tx_size, config.validated_tx_rate), |
| 202 | + validated_tx_head_(head(config.path / schema::dir::heads, schema::caches::validated_tx), 1, 0, random), |
| 203 | + validated_tx_body_(body(config.path, schema::caches::validated_tx), config.validated_tx_size, config.validated_tx_rate, sequential), |
201 | 204 | validated_tx(validated_tx_head_, validated_tx_body_, config.validated_tx_buckets), |
202 | 205 |
|
203 | 206 | // Optionals. |
204 | 207 | // ------------------------------------------------------------------------ |
205 | 208 |
|
206 | | - address_head_(head(config.path / schema::dir::heads, schema::optionals::address)), |
207 | | - address_body_(body(config.path, schema::optionals::address), config.address_size, config.address_rate), |
| 209 | + address_head_(head(config.path / schema::dir::heads, schema::optionals::address), 1, 0, random), |
| 210 | + address_body_(body(config.path, schema::optionals::address), config.address_size, config.address_rate, sequential), |
208 | 211 | address(address_head_, address_body_, config.address_buckets), |
209 | 212 |
|
210 | | - filter_bk_head_(head(config.path / schema::dir::heads, schema::optionals::filter_bk)), |
211 | | - filter_bk_body_(body(config.path, schema::optionals::filter_bk), config.filter_bk_size, config.filter_bk_rate), |
| 213 | + filter_bk_head_(head(config.path / schema::dir::heads, schema::optionals::filter_bk), 1, 0, random), |
| 214 | + filter_bk_body_(body(config.path, schema::optionals::filter_bk), config.filter_bk_size, config.filter_bk_rate, sequential), |
212 | 215 | filter_bk(filter_bk_head_, filter_bk_body_, config.filter_bk_buckets), |
213 | 216 |
|
214 | | - filter_tx_head_(head(config.path / schema::dir::heads, schema::optionals::filter_tx)), |
215 | | - filter_tx_body_(body(config.path, schema::optionals::filter_tx), config.filter_tx_size, config.filter_tx_rate), |
| 217 | + filter_tx_head_(head(config.path / schema::dir::heads, schema::optionals::filter_tx), 1, 0, random), |
| 218 | + filter_tx_body_(body(config.path, schema::optionals::filter_tx), config.filter_tx_size, config.filter_tx_rate, sequential), |
216 | 219 | filter_tx(filter_tx_head_, filter_tx_body_, config.filter_tx_buckets), |
217 | 220 |
|
218 | 221 | // Locks. |
|
0 commit comments