data_conf.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __DATA_CONF_H__
  2. #define __DATA_CONF_H__
  3. #include "algorithm/singleton.h"
  4. #include <string>
  5. #include <vector>
  6. #include <stdint.h>
  7. struct ConfigParam{
  8. public:
  9. uint32_t single_query_cnt_;
  10. std::string data_rule_;
  11. std::string operate_time_rule_;
  12. std::string operate_type_;
  13. std::string key_field_name_;
  14. std::string table_name_;
  15. std::string life_cycle_table_name_;
  16. std::string hot_db_name_;
  17. std::string cold_db_name_;
  18. std::vector<std::string> field_vec_;
  19. std::vector<int> field_flag_vec_; // whether field is string type
  20. std::string full_db_addr_;
  21. std::string full_db_user_;
  22. std::string full_db_pwd_;
  23. uint32_t port_;
  24. std::string option_file;
  25. };
  26. class DataConf{
  27. public:
  28. DataConf();
  29. ~DataConf();
  30. int LoadConfig(const std::string& config_path);
  31. int ParseConfig(const std::string& config_path, ConfigParam& config_param);
  32. bool ParseAgentConf(std::string path);
  33. uint32_t Port();
  34. private:
  35. uint32_t port_;
  36. };
  37. #endif