comm.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * =====================================================================================
  3. *
  4. * Filename: comm.h
  5. *
  6. * Description: comm class definition.
  7. *
  8. * Version: 1.0
  9. * Created: 04/01/2021
  10. * Revision: none
  11. * Compiler: gcc
  12. *
  13. * Author: chenyujie, chenyujie28@jd.com@jd.com
  14. * Company: JD.com, Inc.
  15. *
  16. * =====================================================================================
  17. */
  18. #ifndef __HB_COMM_H
  19. #define __HB_COMM_H
  20. // local
  21. #include "registor.h"
  22. // libs/api/cc_api/include
  23. #include "dtcapi.h"
  24. // connecter
  25. #include "mysql_operation.h"
  26. class DbConfig;
  27. class CComm {
  28. public:
  29. static void parse_argv(int argc, char **argv);
  30. static void show_usage(int argc, char **argv);
  31. static void show_version(int argc, char **argv);
  32. static int load_config(const char *p = SYS_CONFIG_FILE);
  33. static int check_hb_status();
  34. static int fixed_hb_env();
  35. static int fixed_slave_env();
  36. static int connect_ttc_server(int ping_master, DbConfig* pParser);
  37. static int uniq_lock(const char *p = ASYNC_FILE_PATH);
  38. static int ReInitDtcAgency(DbConfig* pParser);
  39. public:
  40. static CRegistor registor;
  41. static DTC::Server master;
  42. static ConnectorProcess mysql_process_;
  43. static const char* version;
  44. static char* dtc_conf;
  45. static char* table_conf;
  46. static int backend;
  47. static int normal;
  48. };
  49. #endif