Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ozaq committed Dec 11, 2024
1 parent 7e03919 commit 46508f3
Show file tree
Hide file tree
Showing 61 changed files with 400 additions and 800 deletions.
29 changes: 13 additions & 16 deletions src/fdb5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ list( APPEND fdb5_srcs
)

if(HAVE_FDB_REMOTE)
list( APPEND fdb5_srcs
list( APPEND fdb5_srcs
api/RemoteFDB.cc
api/RemoteFDB.h

Expand Down Expand Up @@ -245,9 +245,6 @@ if(HAVE_FDB_REMOTE)
remote/server/StoreHandler.cc
remote/server/ServerConnection.h
remote/server/ServerConnection.cc

# remote/RemoteConfiguration.h
# remote/RemoteConfiguration.cc
)
endif()

Expand Down Expand Up @@ -353,31 +350,31 @@ if( HAVE_DAOSFDB )
daos/DaosArrayHandle.h
daos/DaosKeyValueHandle.cc
daos/DaosKeyValueHandle.h
daos/DaosStore.h
daos/DaosStore.cc
daos/DaosFieldLocation.h
daos/DaosStore.h
daos/DaosStore.cc
daos/DaosFieldLocation.h
daos/DaosFieldLocation.cc
daos/DaosException.h
daos/DaosException.cc
daos/DaosEngine.h
daos/DaosEngine.cc
daos/DaosCatalogue.h
daos/DaosCatalogue.cc
daos/DaosCatalogueWriter.h
daos/DaosEngine.cc
daos/DaosCatalogue.h
daos/DaosCatalogue.cc
daos/DaosCatalogueWriter.h
daos/DaosCatalogueWriter.cc
daos/DaosCatalogueReader.h
daos/DaosCatalogueReader.h
daos/DaosCatalogueReader.cc
daos/DaosIndex.h
daos/DaosIndex.cc
daos/DaosIndexLocation.h
daos/DaosIndexLocation.cc
daos/DaosCommon.h
daos/DaosCommon.cc
daos/DaosWipeVisitor.h
daos/DaosWipeVisitor.h
daos/DaosWipeVisitor.cc
daos/DaosArrayPartHandle.h
daos/DaosArrayPartHandle.h
daos/DaosArrayPartHandle.cc
daos/DaosLazyFieldLocation.h
daos/DaosLazyFieldLocation.h
daos/DaosLazyFieldLocation.cc
daos/UUID.h
daos/UUID.cc
Expand All @@ -392,7 +389,7 @@ endif()
ecbuild_add_library(

TARGET fdb5

TYPE SHARED # Library needs to be shared for dynamic factory self registration

SOURCES
Expand Down
1 change: 0 additions & 1 deletion src/fdb5/api/RemoteFDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ struct BaseAPIHelper {
static ValueType valueFromStream(eckit::Stream& s, fdb5::RemoteFDB* fdb) { return ValueType(s); }
};

// using ListHelper = BaseAPIHelper<fdb5::ListElement, fdb5::remote::Message::List>;
using StatsHelper = BaseAPIHelper<fdb5::StatsElement, fdb5::remote::Message::Stats>;

struct ListHelper : BaseAPIHelper<fdb5::ListElement, fdb5::remote::Message::List> {
Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/api/local/AxesVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class AxesVisitor : public QueryVisitor<AxesElement> {
bool visitIndexes() override { return true; }
bool visitEntries() override { return false; }
void catalogueComplete(const fdb5::Catalogue& catalogue) override;

// bool preVisitDatabase(const eckit::URI& uri) override;
bool visitDatabase(const Catalogue& catalogue) override;
bool visitIndex(const Index&) override;
void visitDatum(const Field&, const Key&) override { NOTIMP; }
Expand Down
4 changes: 2 additions & 2 deletions src/fdb5/api/local/ControlVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ ControlVisitor::ControlVisitor(eckit::Queue<ControlElement>& queue,
identifiers_(identifiers) {}


bool ControlVisitor::visitDatabase(const Catalogue& catalogue) { //, const Store& store) {
bool ControlVisitor::visitDatabase(const Catalogue& catalogue) {

EntryVisitor::visitDatabase(catalogue); //, store);
EntryVisitor::visitDatabase(catalogue);

// Only lock/unlock things that match exactly.

Expand Down
1 change: 0 additions & 1 deletion src/fdb5/api/local/ControlVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class ControlVisitor : public QueryVisitor<ControlElement> {
bool visitEntries() override { return false; }

bool visitDatabase(const Catalogue& catalogue) override;
// bool visitDatabase(const Catalogue& catalogue, const Store& store) override;
bool visitIndex(const Index&) override { NOTIMP; }
void visitDatum(const Field&, const Key&) override { NOTIMP; }

Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/api/local/ListVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ struct ListVisitor : public QueryVisitor<ListElement> {

/// Make a note of the current database. Subtract its key from the current
/// request so we can test request is used in its entirety
// bool visitDatabase(const Catalogue& catalogue, const Store& store) override {
bool visitDatabase(const Catalogue& catalogue) override {

// If the DB is locked for listing, then it "doesn't exist"
if (!catalogue.enabled(ControlIdentifier::List)) {
return false;
}

// bool ret = QueryVisitor::visitDatabase(catalogue, store);
bool ret = QueryVisitor::visitDatabase(catalogue);
ASSERT(catalogue.key().partialMatch(request_));

Expand Down
4 changes: 0 additions & 4 deletions src/fdb5/api/local/MoveVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ MoveVisitor::MoveVisitor(eckit::Queue<MoveElement>& queue,
QueryVisitor<MoveElement>(queue, request),
dest_(dest) {}

//bool MoveVisitor::visitDatabase(const Catalogue& catalogue, const Store& store) {
bool MoveVisitor::visitDatabase(const Catalogue& catalogue) {
if (catalogue.key().match(request_)) {
catalogue.control(
Expand All @@ -54,11 +53,8 @@ bool MoveVisitor::visitDatabase(const Catalogue& catalogue) {
ASSERT(!catalogue.enabled(ControlIdentifier::UniqueRoot));

EntryVisitor::visitDatabase(catalogue);
// EntryVisitor::visitDatabase(catalogue, store);

ASSERT(!internalVisitor_);
// internalVisitor_.reset(catalogue.moveVisitor(store, request_, dest_, queue_));
// internalVisitor_->visitDatabase(catalogue, store);
internalVisitor_.reset(catalogue.moveVisitor(store(), request_, dest_, queue_));
internalVisitor_->visitDatabase(catalogue);

Expand Down
1 change: 0 additions & 1 deletion src/fdb5/api/local/MoveVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class MoveVisitor : public QueryVisitor<MoveElement> {
bool visitIndexes() override { return false; }
bool visitEntries() override { return false; }

// bool visitDatabase(const Catalogue& catalogue, const Store& store) override;
bool visitDatabase(const Catalogue& catalogue) override;
bool visitIndex(const Index&) override { NOTIMP; }
void visitDatum(const Field&, const Key&) override { NOTIMP; }
Expand Down
6 changes: 0 additions & 6 deletions src/fdb5/api/local/PurgeVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ PurgeVisitor::PurgeVisitor(eckit::Queue<PurgeElement>& queue,
doit_(doit),
porcelain_(porcelain) {}

/*
bool PurgeVisitor::visitCatalogue(const Catalogue& catalogue) {
return false;
}*/

//bool PurgeVisitor::visitDatabase(const Catalogue& catalogue, const Store& store) {
bool PurgeVisitor::visitDatabase(const Catalogue& catalogue) {

// If the DB is locked for wiping, then it "doesn't exist"
Expand Down
1 change: 0 additions & 1 deletion src/fdb5/api/local/PurgeVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class PurgeVisitor : public QueryVisitor<PurgeElement> {
bool doit,
bool porcelain);

// bool visitDatabase(const Catalogue& catalogue, const Store& store) override;
bool visitDatabase(const Catalogue& catalogue) override;
bool visitIndex(const Index& index) override;
void catalogueComplete(const Catalogue& catalogue) override;
Expand Down
1 change: 0 additions & 1 deletion src/fdb5/api/local/StatsVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace local {

//----------------------------------------------------------------------------------------------------------------------

// bool StatsVisitor::visitDatabase(const Catalogue& catalogue, const Store& store) {
bool StatsVisitor::visitDatabase(const Catalogue& catalogue) {

EntryVisitor::visitDatabase(catalogue);
Expand Down
1 change: 0 additions & 1 deletion src/fdb5/api/local/StatsVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class StatsVisitor : public QueryVisitor<StatsElement> {

using QueryVisitor<StatsElement>::QueryVisitor;

// bool visitDatabase(const Catalogue& catalogue, const Store& store) override;
bool visitDatabase(const Catalogue& catalogue) override;
bool visitIndex(const Index& index) override;
void catalogueComplete(const Catalogue& catalogue) override;
Expand Down
3 changes: 0 additions & 3 deletions src/fdb5/api/local/WipeVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,17 @@ WipeVisitor::WipeVisitor(eckit::Queue<WipeElement>& queue,
unsafeWipeAll_(unsafeWipeAll) {}


//bool WipeVisitor::visitDatabase(const Catalogue& catalogue, const Store& store) {
bool WipeVisitor::visitDatabase(const Catalogue& catalogue) {

// If the DB is locked for wiping, then it "doesn't exist"
if (!catalogue.enabled(ControlIdentifier::Wipe)) {
return false;
}

// EntryVisitor::visitDatabase(catalogue, store);
EntryVisitor::visitDatabase(catalogue);

ASSERT(!internalVisitor_);
internalVisitor_.reset(catalogue.wipeVisitor(store(), request_, out_, doit_, porcelain_, unsafeWipeAll_));
// internalVisitor_->visitDatabase(catalogue, store);
internalVisitor_->visitDatabase(catalogue);

return true; // Explore contained indexes
Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/api/local/WipeVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class WipeVisitor : public QueryVisitor<WipeElement> {

bool visitEntries() override { return false; }
bool visitIndexes() override;

// bool visitDatabase(const Catalogue& catalogue, const Store& store) override;
bool visitDatabase(const Catalogue& catalogue) override;
bool visitIndex(const Index& index) override;
void catalogueComplete(const Catalogue& catalogue) override;
Expand Down
1 change: 0 additions & 1 deletion src/fdb5/config/Config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Config Config::make(const eckit::PathName& path, const eckit::Configuration& use

Config::Config(const Configuration& config, const eckit::Configuration& userConfig) :
LocalConfiguration(config), schemaPathInitialised_(false) {
// initializeSchemaPath();
userConfig_ = std::make_shared<eckit::LocalConfiguration>(userConfig);
}

Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/daos/DaosCatalogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class DaosCatalogue : public CatalogueImpl, public DaosCommon {
DaosCatalogue(const Key& key, const fdb5::Config& config);
DaosCatalogue(const eckit::URI& uri, const ControlIdentifiers& controlIdentifiers, const fdb5::Config& config);

// static const char* catalogueTypeName() { return fdb5::DaosEngine::typeName(); }

eckit::URI uri() const override;
const Key& indexKey() const override { return currentIndexKey_; }

Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/daos/DaosEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class DaosEngine : public fdb5::Engine {
std::vector<eckit::URI> visitableLocations(const Key& key, const Config& config) const override;
std::vector<eckit::URI> visitableLocations(const metkit::mars::MarsRequest& rq, const Config& config) const override;

// std::vector<eckit::URI> writableLocations(const Key& key, const Config& config) const override { NOTIMP; };

void print( std::ostream &out ) const override { NOTIMP; };

private: // methods
Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/database/Archiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ class Archiver : public eckit::NonCopyable {

virtual ~Archiver();

// uint32_t id() const { return id_; }

void archive(const Key& key, BaseArchiveVisitor& visitor);
void archive(const Key& key, const void* data, size_t len);

Expand Down
1 change: 0 additions & 1 deletion src/fdb5/database/BaseArchiveVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ bool BaseArchiveVisitor::selectDatabase(const Key& dbKey, const TypedKey& fullCo
}

bool BaseArchiveVisitor::selectIndex(const Key& idxKey, const TypedKey& fullComputedKey) {
// eckit::Log::info() << "selectIndex " << idxKey << std::endl;
return catalogue()->selectIndex(idxKey);
}

Expand Down
2 changes: 1 addition & 1 deletion src/fdb5/database/Catalogue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ std::unique_ptr<Store> CatalogueImpl::buildStore() const {
return StoreFactory::instance().build(key(), config_);
}

void Catalogue::visitEntries(EntryVisitor& visitor /*, const Store& store*/, bool sorted) {
void Catalogue::visitEntries(EntryVisitor& visitor, bool sorted) {

std::vector<Index> all = indexes(sorted);

Expand Down
5 changes: 0 additions & 5 deletions src/fdb5/database/Catalogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ class CatalogueReader : virtual public Catalogue {

public:

// CatalogueReader(const Key& key, ControlIdentifiers controlIdentifiers, const fdb5::Config& config)
// : Catalogue(key, controlIdentifiers, config) {}
CatalogueReader() {}

virtual ~CatalogueReader() {}
Expand All @@ -153,9 +151,6 @@ class CatalogueWriter : virtual public Catalogue {
public:

CatalogueWriter() {}
// CatalogueWriter(const Key& key, ControlIdentifiers controlIdentifiers, const fdb5::Config& config)
// : Catalogue(key, controlIdentifiers, config) {}

virtual ~CatalogueWriter() {}

virtual const Index& currentIndex() = 0;
Expand Down
8 changes: 0 additions & 8 deletions src/fdb5/database/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include "eckit/memory/NonCopyable.h"
#include "eckit/filesystem/URI.h"

// #include "fdb5/database/DB.h"


namespace fdb5 {

Expand Down Expand Up @@ -55,16 +53,10 @@ class Engine : private eckit::NonCopyable {
/// Uniquely selects a location where the Key will be put or already exists
virtual eckit::URI location(const Key& key, const Config& config) const = 0;

// /// Lists the roots that can be visited given a DB key
// virtual std::vector<eckit::URI> allLocations(const Key& key, const Config& config) const = 0;

/// Lists the roots that can be visited given a DB key
virtual std::vector<eckit::URI> visitableLocations(const Key& key, const Config& config) const = 0;
virtual std::vector<eckit::URI> visitableLocations(const metkit::mars::MarsRequest& rq, const Config& config) const = 0;

/// Lists the roots where a DB key would be able to be written
// virtual std::vector<eckit::URI> writableLocations(const Key& key, const Config& config) const = 0;

friend std::ostream &operator<<(std::ostream &s, const Engine& x);

protected: // methods
Expand Down
2 changes: 1 addition & 1 deletion src/fdb5/database/Index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void IndexBase::encodeLegacy(eckit::Stream& s, const int version) const {

axes_.encode(s, version);
s << key_;
s << ""; // key_.valuesToString(); we no longer write this field, required in the previous index format
s << ""; // we no longer write this field, required in the previous index format
s << type_;
}

Expand Down
42 changes: 0 additions & 42 deletions src/fdb5/database/Manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,31 +269,6 @@ std::string Manager::engine(const URI& uri)
throw eckit::BadParameter(oss.str(), Here());
}

// eckit::URI Manager::location(const Key& key) {

// const std::string& name = Manager::engine(key);

// return Engine::backend(name).location(key, config_);
// }

// std::vector<URI> Manager::allLocations(const Key& key)
// {
// std::set<std::string> engines = Manager::engines(key);

// LOG_DEBUG_LIB(LibFdb5) << "Matching engines for key " << key << " -> " << engines << std::endl;

// std::vector<URI> r; // union of all locations

// for(std::set<std::string>::const_iterator i = engines.begin(); i != engines.end(); ++i) {
// LOG_DEBUG_LIB(LibFdb5) << "Selected FDB engine " << *i << std::endl;
// std::vector<URI> p = Engine::backend(*i).allLocations(key, config_);
// r.insert(r.end(), p.begin(), p.end());
// }

// return r;
// }


std::vector<eckit::URI> Manager::visitableLocations(const metkit::mars::MarsRequest& rq, bool all) {

std::set<std::string> engines = Manager::engines(rq, all);
Expand All @@ -318,23 +293,6 @@ std::vector<eckit::URI> Manager::visitableLocations(const metkit::mars::MarsRequ

}

// std::vector<eckit::URI> Manager::writableLocations(const Key& key) {

// std::set<std::string> engines = Manager::engines(key);

// LOG_DEBUG_LIB(LibFdb5) << "Matching engines for key " << key << " -> " << engines << std::endl;

// std::vector<URI> r; // union of all locations

// for(std::set<std::string>::const_iterator i = engines.begin(); i != engines.end(); ++i) {
// LOG_DEBUG_LIB(LibFdb5) << "Selected FDB engine " << *i << std::endl;
// std::vector<URI> p = Engine::backend(*i).writableLocations(key, config_);
// r.insert(r.end(), p.begin(), p.end());
// }

// return r;
// }

//----------------------------------------------------------------------------------------------------------------------

} // namespace fdb5
9 changes: 0 additions & 9 deletions src/fdb5/database/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,9 @@ class Manager {
/// Uniquely selects the engine that will handle this URI by checking possible handlers
std::string engine(const eckit::URI& uri);

/// Uniquely selects a location where the Key will be put or already exists
// eckit::URI location(const Key &key);

// /// Lists the roots that can be visited given a DB key
// std::vector<eckit::URI> allLocations(const Key& key);

/// Lists the roots that can be visited given a DB key
std::vector<eckit::URI> visitableLocations(const metkit::mars::MarsRequest& request, bool all);

// /// Lists the roots where a DB key would be able to be written
// std::vector<eckit::URI> writableLocations(const Key& key);

private: // members

eckit::PathName enginesFile_;
Expand Down
Loading

0 comments on commit 46508f3

Please sign in to comment.