summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-03-05 14:36:07 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2024-03-05 14:36:07 +0000
commit45123e5612b6942b0f4ba6586be250d2069529e8 (patch)
tree7fca0cdda35c77aef67e56ff9ac423d9989af1e3
parentb706db42b706a16993b0c62531b329bc45862ce1 (diff)
Rename to reflect that is is a configid, not a search cluster.
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp6
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp22
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchenvironment.h4
3 files changed, 16 insertions, 16 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp b/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp
index b9820e52ef9..367e9601fe5 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp
@@ -23,7 +23,7 @@ protected:
mutable std::mutex _lock;
void entryDropped(const SessionId &id);
- ~SessionCacheBase() {}
+ ~SessionCacheBase() = default;
};
template <typename T>
@@ -31,7 +31,7 @@ struct SessionCache : SessionCacheBase {
using EntryUP = typename T::UP;
vespalib::lrucache_map<vespalib::LruParam<SessionId, EntryUP> > _cache;
- SessionCache(uint32_t max_size) : _cache(max_size) {}
+ explicit SessionCache(uint32_t max_size) : _cache(max_size) {}
void insert(EntryUP session) {
std::lock_guard<std::mutex> guard(_lock);
@@ -115,7 +115,7 @@ struct SessionMap : SessionCacheBase {
toDestruct.back().swap(session);
}
}
- for (auto key : keys) {
+ for (const auto & key : keys) {
_map.erase(key);
_stats.numTimedout++;
}
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp b/streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp
index 933aa528163..fdaa05ab005 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/searchenvironment.cpp
@@ -124,27 +124,27 @@ SearchEnvironment::~SearchEnvironment()
}
SearchEnvironment::Env &
-SearchEnvironment::getEnv(const vespalib::string & searchCluster)
+SearchEnvironment::getEnv(const vespalib::string & config_id)
{
- config::ConfigUri searchClusterUri(_configUri.createWithNewId(searchCluster));
+ config::ConfigUri configUri(_configUri.createWithNewId(config_id));
if (_localEnvMap == nullptr) {
EnvMapUP envMap = std::make_unique<EnvMap>();
_localEnvMap = envMap.get();
std::lock_guard guard(_lock);
_threadLocals.emplace_back(std::move(envMap));
}
- auto localFound = _localEnvMap->find(searchCluster);
+ auto localFound = _localEnvMap->find(config_id);
if (localFound == _localEnvMap->end()) {
std::lock_guard guard(_lock);
- auto found = _envMap.find(searchCluster);
+ auto found = _envMap.find(config_id);
if (found == _envMap.end()) {
- LOG(debug, "Init VSMAdapter with config id = '%s'", searchCluster.c_str());
- Env::SP env = std::make_shared<Env>(searchClusterUri, *_wordFolder, _transport, _file_distributor_connection_spec);
- _envMap[searchCluster] = std::move(env);
- found = _envMap.find(searchCluster);
+ LOG(debug, "Init VSMAdapter with config id = '%s'", config_id.c_str());
+ Env::SP env = std::make_shared<Env>(configUri, *_wordFolder, _transport, _file_distributor_connection_spec);
+ _envMap[config_id] = std::move(env);
+ found = _envMap.find(config_id);
}
_localEnvMap->insert(*found);
- localFound = _localEnvMap->find(searchCluster);
+ localFound = _localEnvMap->find(config_id);
}
return *localFound->second;
}
@@ -156,9 +156,9 @@ SearchEnvironment::clear_thread_local_env_map()
}
std::shared_ptr<const SearchEnvironmentSnapshot>
-SearchEnvironment::get_snapshot(const vespalib::string& search_cluster)
+SearchEnvironment::get_snapshot(const vespalib::string& config_id)
{
- return getEnv(search_cluster).get_snapshot();
+ return getEnv(config_id).get_snapshot();
}
std::optional<int64_t>
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchenvironment.h b/streamingvisitors/src/vespa/searchvisitor/searchenvironment.h
index 9ea4867272e..4cdc38a286b 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchenvironment.h
+++ b/streamingvisitors/src/vespa/searchvisitor/searchenvironment.h
@@ -75,12 +75,12 @@ private:
FNET_Transport* const _transport;
vespalib::string _file_distributor_connection_spec;
- Env & getEnv(const vespalib::string & searchcluster);
+ Env & getEnv(const vespalib::string & config_id);
public:
SearchEnvironment(const config::ConfigUri & configUri, FNET_Transport* transport, const vespalib::string& file_distributor_connection_spec);
~SearchEnvironment();
- std::shared_ptr<const SearchEnvironmentSnapshot> get_snapshot(const vespalib::string& search_cluster);
+ std::shared_ptr<const SearchEnvironmentSnapshot> get_snapshot(const vespalib::string& config_id);
std::optional<int64_t> get_oldest_config_generation();
// Should only be used by unit tests to simulate that the calling thread is finished.
void clear_thread_local_env_map();