mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-23 05:05:54 +00:00
online delete for postgres working
This commit is contained in:
@@ -1359,6 +1359,16 @@ CassandraBackend::open(bool readOnly)
|
||||
? config_["threads"].as_int64()
|
||||
: std::thread::hardware_concurrency();
|
||||
int ttl = config_.contains("ttl") ? config_["ttl"].as_int64() * 2 : 0;
|
||||
int keysTtl, keysIncr = pow(2, indexer_.getKeyShift()) * 4 * 2;
|
||||
while (keysTtl < ttl)
|
||||
{
|
||||
keysTtl += keysIncr;
|
||||
}
|
||||
int booksTtl, booksIncr = pow(2, indexer_.getBookShift()) * 4 * 2;
|
||||
while (booksTtl < ttl)
|
||||
{
|
||||
booksTtl += booksIncr;
|
||||
}
|
||||
|
||||
rc = cass_cluster_set_num_threads_io(cluster, threads);
|
||||
if (rc != CASS_OK)
|
||||
@@ -1530,7 +1540,9 @@ CassandraBackend::open(bool readOnly)
|
||||
query.str("");
|
||||
query << "CREATE TABLE IF NOT EXISTS " << tablePrefix << "keys"
|
||||
<< " ( sequence bigint, key blob, PRIMARY KEY "
|
||||
"(sequence, key))";
|
||||
"(sequence, key))"
|
||||
" WITH default_time_to_live = "
|
||||
<< keysTtl;
|
||||
if (!executeSimpleStatement(query.str()))
|
||||
continue;
|
||||
|
||||
@@ -1546,7 +1558,8 @@ CassandraBackend::open(bool readOnly)
|
||||
"blob>, PRIMARY KEY "
|
||||
"((book, sequence), quality_key)) WITH CLUSTERING ORDER BY "
|
||||
"(quality_key "
|
||||
"ASC)";
|
||||
"ASC) AND default_time_to_live = "
|
||||
<< booksTtl;
|
||||
if (!executeSimpleStatement(query.str()))
|
||||
continue;
|
||||
query.str("");
|
||||
|
||||
Reference in New Issue
Block a user