Skip to content

Commit

Permalink
fix: Remove cassandra from log (#1557)
Browse files Browse the repository at this point in the history
Fix #1452
  • Loading branch information
cindyyan317 authored Jul 30, 2024
1 parent 3095f58 commit 00c4287
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/data/BackendFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ make_Backend(util::Config const& config)
auto const type = config.value<std::string>("database.type");
std::shared_ptr<BackendInterface> backend = nullptr;

// TODO: retire `cassandra-new` by next release after 2.0
if (boost::iequals(type, "cassandra") or boost::iequals(type, "cassandra-new")) {
if (boost::iequals(type, "cassandra")) {
auto cfg = config.section("database." + type);
backend = std::make_shared<data::cassandra::CassandraBackend>(data::cassandra::SettingsProvider{cfg}, readOnly);
}
Expand Down
11 changes: 5 additions & 6 deletions src/data/CassandraBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "data/BackendInterface.hpp"
#include "data/DBHelpers.hpp"
#include "data/Types.hpp"
#include "data/cassandra/Concepts.hpp"
#include "data/cassandra/Handle.hpp"
#include "data/cassandra/Schema.hpp"
#include "data/cassandra/SettingsProvider.hpp"
Expand Down Expand Up @@ -94,7 +93,7 @@ class BasicCassandraBackend : public BackendInterface {
, executor_{settingsProvider_.getSettings(), handle_}
{
if (auto const res = handle_.connect(); not res)
throw std::runtime_error("Could not connect to Cassandra: " + res.error());
throw std::runtime_error("Could not connect to databse: " + res.error());

if (not readOnly) {
if (auto const res = handle_.execute(schema_.createKeyspace); not res) {
Expand Down Expand Up @@ -346,7 +345,7 @@ class BasicCassandraBackend : public BackendInterface {
hashes.push_back(std::move(hash));

auto end = std::chrono::system_clock::now();
LOG(log_.debug()) << "Fetched " << hashes.size() << " transaction hashes from Cassandra in "
LOG(log_.debug()) << "Fetched " << hashes.size() << " transaction hashes from database in "
<< std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count()
<< " milliseconds";

Expand Down Expand Up @@ -659,7 +658,7 @@ class BasicCassandraBackend : public BackendInterface {
});

ASSERT(numHashes == results.size(), "Number of hashes and results must match");
LOG(log_.debug()) << "Fetched " << numHashes << " transactions from Cassandra in " << timeDiff
LOG(log_.debug()) << "Fetched " << numHashes << " transactions from database in " << timeDiff
<< " milliseconds";
return results;
}
Expand Down Expand Up @@ -779,7 +778,7 @@ class BasicCassandraBackend : public BackendInterface {
if (keys.empty())
return {};

LOG(log_.debug()) << "Fetched " << keys.size() << " diff hashes from Cassandra in " << timeDiff
LOG(log_.debug()) << "Fetched " << keys.size() << " diff hashes from database in " << timeDiff
<< " milliseconds";

auto const objs = fetchLedgerObjects(keys, ledgerSequence, yield);
Expand Down Expand Up @@ -867,7 +866,7 @@ class BasicCassandraBackend : public BackendInterface {
std::string&& metadata
) override
{
LOG(log_.trace()) << "Writing txn to cassandra";
LOG(log_.trace()) << "Writing txn to database";

executor_.write(schema_->insertLedgerTransaction, seq, hash);
executor_.write(
Expand Down

0 comments on commit 00c4287

Please sign in to comment.