| 317 | } |
| 318 | |
| 319 | FeatureStoreMgr::FeatureStoreMgr(ModelConfig* config) |
| 320 | : thread_num_(config->read_thread_num), |
| 321 | update_thread_num_(config->update_thread_num), |
| 322 | active_thread_index_(0), |
| 323 | active_update_thread_index_(0), |
| 324 | storage_type_(config->feature_store_type) { |
| 325 | if (thread_num_ < 1 || thread_num_ > MANAGER_MAX_THREAD_NUM) { |
| 326 | LOG(FATAL) << "Invalid IO thread num, required [1, 96], get " |
| 327 | << thread_num_; |
| 328 | } |
| 329 | |
| 330 | if (update_thread_num_ < 1 || |
| 331 | update_thread_num_ > MANAGER_MAX_UPDATE_THREAD_NUM) { |
| 332 | LOG(FATAL) << "Invalid IO thread num, required [1, 16], get " |
| 333 | << update_thread_num_; |
| 334 | } |
| 335 | |
| 336 | store_.resize(thread_num_); |
| 337 | for (int i = 0; i < thread_num_; ++i) { |
| 338 | store_[i] = CreateFeatureStore(config); |
| 339 | } |
| 340 | |
| 341 | update_store_.resize(update_thread_num_); |
| 342 | for (int i = 0; i < update_thread_num_; ++i) { |
| 343 | update_store_[i] = CreateFeatureStore(config); |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | FeatureStoreMgr::~FeatureStoreMgr() { |
| 348 | for (auto store : store_) { |
nothing calls this directly
no test coverage detected