Extract HA config to separate file
Reviewers: msantl, ipaljak Reviewed By: msantl Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1964
This commit is contained in:
parent
45f2a06a8b
commit
8999f5fccd
@ -1,6 +1,8 @@
|
|||||||
#include <limits>
|
#include "database/single_node_ha/config.hpp"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
#include "database/single_node_ha/graph_db.hpp"
|
|
||||||
#include "utils/flag_validation.hpp"
|
#include "utils/flag_validation.hpp"
|
||||||
#include "utils/string.hpp"
|
#include "utils/string.hpp"
|
||||||
|
|
||||||
|
35
src/database/single_node_ha/config.hpp
Normal file
35
src/database/single_node_ha/config.hpp
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/// @file
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace database {
|
||||||
|
|
||||||
|
/// Database configuration. Initialized from flags, but modifiable.
|
||||||
|
struct Config {
|
||||||
|
Config();
|
||||||
|
|
||||||
|
// Durability flags.
|
||||||
|
std::string durability_directory;
|
||||||
|
bool db_recover_on_startup;
|
||||||
|
|
||||||
|
// Misc flags.
|
||||||
|
int gc_cycle_sec;
|
||||||
|
int query_execution_time_sec;
|
||||||
|
|
||||||
|
// set of properties which will be stored on disk
|
||||||
|
std::vector<std::string> properties_on_disk;
|
||||||
|
|
||||||
|
// RPC flags.
|
||||||
|
uint16_t rpc_num_client_workers;
|
||||||
|
uint16_t rpc_num_server_workers;
|
||||||
|
|
||||||
|
// HA flags.
|
||||||
|
std::string coordination_config_file;
|
||||||
|
std::string raft_config_file;
|
||||||
|
uint16_t server_id;
|
||||||
|
};
|
||||||
|
} // namespace database
|
@ -6,6 +6,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "database/single_node_ha/config.hpp"
|
||||||
#include "database/single_node_ha/counters.hpp"
|
#include "database/single_node_ha/counters.hpp"
|
||||||
#include "io/network/endpoint.hpp"
|
#include "io/network/endpoint.hpp"
|
||||||
#include "raft/coordination.hpp"
|
#include "raft/coordination.hpp"
|
||||||
@ -38,31 +39,6 @@ struct Stat {
|
|||||||
std::atomic<double> avg_degree{0};
|
std::atomic<double> avg_degree{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Database configuration. Initialized from flags, but modifiable.
|
|
||||||
struct Config {
|
|
||||||
Config();
|
|
||||||
|
|
||||||
// Durability flags.
|
|
||||||
std::string durability_directory;
|
|
||||||
bool db_recover_on_startup;
|
|
||||||
|
|
||||||
// Misc flags.
|
|
||||||
int gc_cycle_sec;
|
|
||||||
int query_execution_time_sec;
|
|
||||||
|
|
||||||
// set of properties which will be stored on disk
|
|
||||||
std::vector<std::string> properties_on_disk;
|
|
||||||
|
|
||||||
// RPC flags.
|
|
||||||
uint16_t rpc_num_client_workers;
|
|
||||||
uint16_t rpc_num_server_workers;
|
|
||||||
|
|
||||||
// HA flags.
|
|
||||||
std::string coordination_config_file;
|
|
||||||
std::string raft_config_file;
|
|
||||||
uint16_t server_id;
|
|
||||||
};
|
|
||||||
|
|
||||||
class GraphDbAccessor;
|
class GraphDbAccessor;
|
||||||
|
|
||||||
/// An abstract base class providing the interface for a graph database.
|
/// An abstract base class providing the interface for a graph database.
|
||||||
|
Loading…
Reference in New Issue
Block a user