Loading src/authdb.cpp +3 −0 Changes for src/authdb.cpp: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -529,6 +529,9 @@ int main(int argc,char *argv[]){ if (dataBlocks) ccfg.data_blocks = config.getIntValue(dataBlocks, 0); if (parityBlocks) ccfg.parity_blocks = config.getIntValue(parityBlocks, 0); auto *storePath = config.getKey("/AUTHDB/CLUSTER/PATH"); if (storePath) ccfg.store_path = config.getValue(storePath, 0); auto *peersKey = config.getKey("/AUTHDB/CLUSTER/PEERS"); if (peersKey) { for (int pi = 0; ; pi++) { Loading src/cluster.cpp +5 −1 Changes for src/cluster.cpp: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -173,8 +173,12 @@ namespace authdb { void Cluster::init(const ClusterConfig &cfg) { cfg_ = cfg; // Setup local block store for receiving peer data // Setup local block store — file-backed if path configured, otherwise memory if (!cfg_.store_path.empty()) { store_ = std::make_shared<paritypp::file_block_store>(cfg_.store_path); } else { store_ = std::make_shared<paritypp::memory_block_store>(); } // Setup auth auth_ = std::make_shared<paritypp::auth_store>(); Loading src/cluster.h +3 −2 Changes for src/cluster.h: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ namespace authdb { std::string key_file; std::string client_name; std::string client_key; std::string store_path; // file-backed store directory (empty = memory only) size_t data_blocks = 2; // k: data shards size_t parity_blocks = 1; // m: parity shards (fault tolerance) }; Loading Loading @@ -117,7 +118,7 @@ namespace authdb { bool isRunning() const { return running_; } // Accessors for backend use paritypp::memory_block_store &getStore() { return *store_; } paritypp::block_store &getStore() { return *store_; } std::unique_ptr<paritypp::client> &getClient() { return pclient_; } std::mutex &getClientMutex() { return client_mutex_; } Loading Loading @@ -149,7 +150,7 @@ namespace authdb { std::atomic<bool> running_{false}; std::thread server_thread_; std::shared_ptr<paritypp::memory_block_store> store_; std::shared_ptr<paritypp::block_store> store_; std::shared_ptr<paritypp::auth_store> auth_; std::unique_ptr<paritypp::server> server_; Loading Loading
src/authdb.cpp +3 −0 Changes for src/authdb.cpp: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -529,6 +529,9 @@ int main(int argc,char *argv[]){ if (dataBlocks) ccfg.data_blocks = config.getIntValue(dataBlocks, 0); if (parityBlocks) ccfg.parity_blocks = config.getIntValue(parityBlocks, 0); auto *storePath = config.getKey("/AUTHDB/CLUSTER/PATH"); if (storePath) ccfg.store_path = config.getValue(storePath, 0); auto *peersKey = config.getKey("/AUTHDB/CLUSTER/PEERS"); if (peersKey) { for (int pi = 0; ; pi++) { Loading
src/cluster.cpp +5 −1 Changes for src/cluster.cpp: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -173,8 +173,12 @@ namespace authdb { void Cluster::init(const ClusterConfig &cfg) { cfg_ = cfg; // Setup local block store for receiving peer data // Setup local block store — file-backed if path configured, otherwise memory if (!cfg_.store_path.empty()) { store_ = std::make_shared<paritypp::file_block_store>(cfg_.store_path); } else { store_ = std::make_shared<paritypp::memory_block_store>(); } // Setup auth auth_ = std::make_shared<paritypp::auth_store>(); Loading
src/cluster.h +3 −2 Changes for src/cluster.h: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ namespace authdb { std::string key_file; std::string client_name; std::string client_key; std::string store_path; // file-backed store directory (empty = memory only) size_t data_blocks = 2; // k: data shards size_t parity_blocks = 1; // m: parity shards (fault tolerance) }; Loading Loading @@ -117,7 +118,7 @@ namespace authdb { bool isRunning() const { return running_; } // Accessors for backend use paritypp::memory_block_store &getStore() { return *store_; } paritypp::block_store &getStore() { return *store_; } std::unique_ptr<paritypp::client> &getClient() { return pclient_; } std::mutex &getClientMutex() { return client_mutex_; } Loading Loading @@ -149,7 +150,7 @@ namespace authdb { std::atomic<bool> running_{false}; std::thread server_thread_; std::shared_ptr<paritypp::memory_block_store> store_; std::shared_ptr<paritypp::block_store> store_; std::shared_ptr<paritypp::auth_store> auth_; std::unique_ptr<paritypp::server> server_; Loading