two ledger data implementations

This commit is contained in:
CJ Cobb
2021-02-16 13:09:38 -05:00
parent 6bda1af3e6
commit 3ce651ef52
3 changed files with 153 additions and 5 deletions

View File

@@ -1266,6 +1266,38 @@ CassandraFlatMapBackend::open()
// Get the prepared object from the future
upperBound_ = cass_future_get_prepared(prepare_future);
// The future can be freed immediately after getting the prepared
// object
//
cass_future_free(prepare_future);
query = {};
query << "SELECT filterempty(key,object) FROM " << tableName << "flat "
<< " WHERE TOKEN(key) >= ? and sequence <= ?"
<< " PER PARTITION LIMIT 1 LIMIT ?"
<< " ALLOW FILTERING";
prepare_future =
cass_session_prepare(session_.get(), query.str().c_str());
// Wait for the statement to prepare and get the result
rc = cass_future_error_code(prepare_future);
if (rc != CASS_OK)
{
// Handle error
cass_future_free(prepare_future);
std::stringstream ss;
ss << "nodestore: Error preparing upperBound : " << rc << ", "
<< cass_error_desc(rc);
BOOST_LOG_TRIVIAL(error) << ss.str() << " : " << query.str();
continue;
}
// Get the prepared object from the future
upperBound2_ = cass_future_get_prepared(prepare_future);
// The future can be freed immediately after getting the prepared
// object
//