| 110 | } |
| 111 | |
| 112 | FeatureStore* CreateFeatureStore(ModelConfig* config) { |
| 113 | if (config->feature_store_type == "redis") { |
| 114 | LocalRedis::Config redis_config; |
| 115 | Status s = GetIPAndPortFromUrl(config->redis_url, |
| 116 | &redis_config.ip, |
| 117 | &redis_config.port); |
| 118 | if (!s.ok()) { |
| 119 | LOG(ERROR) << "Can't parse ip and port from url: " |
| 120 | << config->redis_url; |
| 121 | return nullptr; |
| 122 | } |
| 123 | redis_config.passwd = config->redis_password; |
| 124 | redis_config.db_idx = config->redis_db_idx; |
| 125 | |
| 126 | return new LocalRedis(redis_config); |
| 127 | } else { |
| 128 | LOG(ERROR) << "Only LocalRedis backend now. type = " |
| 129 | << config->feature_store_type; |
| 130 | } |
| 131 | |
| 132 | return nullptr; |
| 133 | } |
| 134 | |
| 135 | #define CALL_BY_UPDATE_THREAD(fn, ...) \ |
| 136 | do { \ |
no test coverage detected