| 325 | } |
| 326 | |
| 327 | void readCheckpointFile() |
| 328 | { |
| 329 | if(_config.checkpointFile.length() == 0) { |
| 330 | return; |
| 331 | } |
| 332 | |
| 333 | ConfigFileReader reader(_config.checkpointFile); |
| 334 | |
| 335 | if(!reader.exists()) { |
| 336 | return; |
| 337 | } |
| 338 | |
| 339 | Logger::log(LogLevel::Info, "Loading ' " + _config.checkpointFile + "'"); |
| 340 | |
| 341 | std::map<std::string, ConfigFileEntry> entries = reader.read(); |
| 342 | |
| 343 | _config.startKey = secp256k1::uint256(entries["start"].value); |
| 344 | _config.nextKey = secp256k1::uint256(entries["next"].value); |
| 345 | _config.endKey = secp256k1::uint256(entries["end"].value); |
| 346 | |
| 347 | if(_config.threads == 0 && entries.find("threads") != entries.end()) { |
| 348 | _config.threads = util::parseUInt32(entries["threads"].value); |
| 349 | } |
| 350 | if(_config.blocks == 0 && entries.find("blocks") != entries.end()) { |
| 351 | _config.blocks = util::parseUInt32(entries["blocks"].value); |
| 352 | } |
| 353 | if(_config.pointsPerThread == 0 && entries.find("points") != entries.end()) { |
| 354 | _config.pointsPerThread = util::parseUInt32(entries["points"].value); |
| 355 | } |
| 356 | if(entries.find("compression") != entries.end()) { |
| 357 | _config.compression = parseCompressionString(entries["compression"].value); |
| 358 | } |
| 359 | if(entries.find("elapsed") != entries.end()) { |
| 360 | _config.elapsed = util::parseUInt32(entries["elapsed"].value); |
| 361 | } |
| 362 | if(entries.find("stride") != entries.end()) { |
| 363 | _config.stride = util::parseUInt64(entries["stride"].value); |
| 364 | } |
| 365 | |
| 366 | _config.totalkeys = (_config.nextKey - _config.startKey).toUint64(); |
| 367 | } |
| 368 | |
| 369 | int run() |
| 370 | { |
no test coverage detected