void regression_serv::set_config(const string& config) { core::common::jsonconfig::config config_root(lexical_cast<json>(config)); regression_serv_config conf = core::common::jsonconfig::config_cast_check<regression_serv_config>( config_root); config_ = config; core::common::jsonconfig::config param; if (conf.parameter) { param = *conf.parameter; } shared_ptr<core::storage::storage_base> model = make_model(argv()); regression_.reset( new core::driver::regression( model, core::regression::regression_factory::create_regression( conf.method, param, model), core::fv_converter::make_fv_converter(conf.converter))); mixer_->set_mixable_holder(regression_->get_mixable_holder()); // TODO(kuenishi): switch the function when set_config is done // because mixing method differs btwn PA, CW, etc... LOG(INFO) << "config loaded: " << config; }
void clustering_serv::set_config(const std::string& config) { core::common::jsonconfig::config config_root( lexical_cast<jubatus::util::text::json::json>(config)); clustering_serv_config conf = core::common::jsonconfig::config_cast_check<clustering_serv_config>( config_root); config_ = config; shared_ptr<core::fv_converter::datum_to_fv_converter> converter = core::fv_converter::make_fv_converter(conf.converter, &so_loader_); core::common::jsonconfig::config param; if (conf.parameter) { param = *conf.parameter; } const std::string name = get_server_identifier(argv()); core::clustering::clustering_config cluster_conf = core::common::jsonconfig::config_cast_check< core::clustering::clustering_config>(param); clustering_.reset(new core::driver::clustering( shared_ptr<core::clustering::clustering>( new core::clustering::clustering( name, conf.method, cluster_conf)), converter)); mixer_->set_driver(clustering_.get()); LOG(INFO) << "config loaded: " << config; }
void kvs_serv::set_config(const std::string& config) { core::common::jsonconfig::config config_root( pfi::lang::lexical_cast<pfi::text::json::json>(config)); kvs_serv_config conf = core::common::jsonconfig::config_cast_check<kvs_serv_config>(config_root); // You can use configuration values here LOG(INFO) << "param1 = " << conf.param1; LOG(INFO) << "param2 = " << conf.param2; }
void burst_serv::set_config(const std::string& config) { core::common::jsonconfig::config config_root(lexical_cast<json>(config)); burst_serv_config conf = config_cast_check<burst_serv_config>(config_root); config_ = config; burst_options options = config_cast_check<burst_options>(conf.parameter); burst_.reset(new core::driver::burst(new core::burst::burst(options))); mixer_->set_driver(burst_.get()); LOG(INFO) << "config loaded: " << config; }
bool regression_serv::set_config(const string& config) { jsonconfig::config config_root(lexical_cast<json>(config)); regression_serv_config conf = jsonconfig::config_cast_check<regression_serv_config>(config_root); config_ = config; converter_ = fv_converter::make_fv_converter(conf.converter); (*converter_).set_weight_manager(wm_.get_model()); jsonconfig::config param; if (conf.parameter) { param = *conf.parameter; } regression_.reset(jubatus::regression::regression_factory().create_regression(conf.method, param, gresser_.get_model().get())); // FIXME: switch the function when set_config is done // because mixing method differs btwn PA, CW, etc... LOG(INFO) << "config loaded: " << config; return true; }