@@ -27,6 +27,7 @@ struct ComponentState final : private vk::not_copyable {
2727 array<string> ini_opts{array_size{argc, false }};
2828 array<mixed> env{array_size{envc, false }};
2929 mixed runtime_config;
30+ string cluster_name{DEFAULT_CLUSTER_NAME.data (), DEFAULT_CLUSTER_NAME.size ()};
3031
3132 ComponentState () noexcept {
3233 parse_env ();
@@ -38,6 +39,8 @@ struct ComponentState final : private vk::not_copyable {
3839 kphp::core::is_reference_counter_recursive (env, ExtraRefCnt::for_global_const)));
3940 kphp::log::assertion ((kphp::core::set_reference_counter_recursive (runtime_config, ExtraRefCnt::for_global_const),
4041 kphp::core::is_reference_counter_recursive (runtime_config, ExtraRefCnt::for_global_const)));
42+ kphp::log::assertion ((kphp::core::set_reference_counter_recursive (cluster_name, ExtraRefCnt::for_global_const),
43+ kphp::core::is_reference_counter_recursive (cluster_name, ExtraRefCnt::for_global_const)));
4144 }
4245
4346 static const ComponentState& get () noexcept {
@@ -52,6 +55,8 @@ struct ComponentState final : private vk::not_copyable {
5255 static constexpr std::string_view INI_ARG_PREFIX = " ini " ;
5356 static constexpr std::string_view KML_DIR_ARG = " kml-dir" ;
5457 static constexpr std::string_view RUNTIME_CONFIG_ARG = " runtime-config" ;
58+ static constexpr std::string_view CLUSTER_NAME_ARG = " cluster-name" ;
59+ static constexpr std::string_view DEFAULT_CLUSTER_NAME = " default" ;
5560 static constexpr auto INIT_COMPONENT_ALLOCATOR_SIZE = static_cast <size_t >(1024U * 1024U ); // 1MB
5661
5762 void parse_env () noexcept ;
@@ -63,4 +68,6 @@ struct ComponentState final : private vk::not_copyable {
6368 void parse_kml_arg (std::string_view) noexcept ;
6469
6570 void parse_runtime_config_arg (std::string_view) noexcept ;
71+
72+ void parse_cluster_name (std::string_view value_view) noexcept ;
6673};
0 commit comments