mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 11:45:53 +00:00
make cassandra driver thread count configurable
This commit is contained in:
@@ -1192,13 +1192,15 @@ CassandraBackend::open()
|
|||||||
cass_cluster_set_credentials(
|
cass_cluster_set_credentials(
|
||||||
cluster, username.c_str(), getString("password").c_str());
|
cluster, username.c_str(), getString("password").c_str());
|
||||||
}
|
}
|
||||||
|
int threads = config_.contains("threads")
|
||||||
|
? config_["threads"].as_int64()
|
||||||
|
: std::thread::hardware_concurrency();
|
||||||
|
|
||||||
unsigned int const workers = std::thread::hardware_concurrency();
|
rc = cass_cluster_set_num_threads_io(cluster, threads);
|
||||||
rc = cass_cluster_set_num_threads_io(cluster, workers);
|
|
||||||
if (rc != CASS_OK)
|
if (rc != CASS_OK)
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "nodestore: Error setting Cassandra io threads to " << workers
|
ss << "nodestore: Error setting Cassandra io threads to " << threads
|
||||||
<< ", result: " << rc << ", " << cass_error_desc(rc);
|
<< ", result: " << rc << ", " << cass_error_desc(rc);
|
||||||
throw std::runtime_error(ss.str());
|
throw std::runtime_error(ss.str());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user