| 543 | } |
| 544 | |
| 545 | bool DatabaseConfiguration::setInternal(KeyRef key, ValueRef value) { |
| 546 | KeyRef ck = key.removePrefix(configKeysPrefix); |
| 547 | int type; |
| 548 | |
| 549 | if (ck == LiteralStringRef("initialized")) { |
| 550 | initialized = true; |
| 551 | } else if (ck == LiteralStringRef("commit_proxies")) { |
| 552 | commitProxyCount = toInt(value); |
| 553 | if (commitProxyCount == -1) |
| 554 | overwriteProxiesCount(); |
| 555 | } else if (ck == LiteralStringRef("grv_proxies")) { |
| 556 | grvProxyCount = toInt(value); |
| 557 | if (grvProxyCount == -1) |
| 558 | overwriteProxiesCount(); |
| 559 | } else if (ck == LiteralStringRef("resolvers")) { |
| 560 | parse(&resolverCount, value); |
| 561 | } else if (ck == LiteralStringRef("logs")) { |
| 562 | parse(&desiredTLogCount, value); |
| 563 | } else if (ck == LiteralStringRef("log_replicas")) { |
| 564 | parse(&tLogReplicationFactor, value); |
| 565 | tLogWriteAntiQuorum = std::min(tLogWriteAntiQuorum, tLogReplicationFactor / 2); |
| 566 | } else if (ck == LiteralStringRef("log_anti_quorum")) { |
| 567 | parse(&tLogWriteAntiQuorum, value); |
| 568 | if (tLogReplicationFactor > 0) { |
| 569 | tLogWriteAntiQuorum = std::min(tLogWriteAntiQuorum, tLogReplicationFactor / 2); |
| 570 | } |
| 571 | } else if (ck == LiteralStringRef("storage_replicas")) { |
| 572 | parse(&storageTeamSize, value); |
| 573 | } else if (ck == LiteralStringRef("tss_count")) { |
| 574 | parse(&desiredTSSCount, value); |
| 575 | } else if (ck == LiteralStringRef("log_version")) { |
| 576 | parse((&type), value); |
| 577 | type = std::max((int)TLogVersion::MIN_RECRUITABLE, type); |
| 578 | type = std::min((int)TLogVersion::MAX_SUPPORTED, type); |
| 579 | tLogVersion = (TLogVersion::Version)type; |
| 580 | } else if (ck == LiteralStringRef("log_engine")) { |
| 581 | parse((&type), value); |
| 582 | tLogDataStoreType = (KeyValueStoreType::StoreType)type; |
| 583 | // TODO: Remove this once Redwood works as a log engine |
| 584 | if (tLogDataStoreType == KeyValueStoreType::SSD_REDWOOD_V1) { |
| 585 | tLogDataStoreType = KeyValueStoreType::SSD_BTREE_V2; |
| 586 | } |
| 587 | // TODO: Remove this once memroy radix tree works as a log engine |
| 588 | if (tLogDataStoreType == KeyValueStoreType::MEMORY_RADIXTREE) { |
| 589 | tLogDataStoreType = KeyValueStoreType::SSD_BTREE_V2; |
| 590 | } |
| 591 | } else if (ck == LiteralStringRef("log_spill")) { |
| 592 | parse((&type), value); |
| 593 | tLogSpillType = (TLogSpillType::SpillType)type; |
| 594 | } else if (ck == LiteralStringRef("storage_engine")) { |
| 595 | parse((&type), value); |
| 596 | storageServerStoreType = (KeyValueStoreType::StoreType)type; |
| 597 | } else if (ck == LiteralStringRef("tss_storage_engine")) { |
| 598 | parse((&type), value); |
| 599 | testingStorageServerStoreType = (KeyValueStoreType::StoreType)type; |
| 600 | } else if (ck == LiteralStringRef("auto_commit_proxies")) { |
| 601 | parse(&autoCommitProxyCount, value); |
| 602 | } else if (ck == LiteralStringRef("auto_grv_proxies")) { |
nothing calls this directly
no test coverage detected