Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Jun 21, 2024
1 parent 12042d0 commit 9ecac11
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 80 deletions.
2 changes: 0 additions & 2 deletions src/fdb5/daos/DaosEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class DaosEngine : public fdb5::Engine {

virtual bool canHandle(const eckit::URI&, const Config&) const override;

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

virtual std::vector<eckit::URI> visitableLocations(const Key& key, const Config& config) const override;
virtual std::vector<eckit::URI> visitableLocations(const metkit::mars::MarsRequest& rq, const Config& config) const override;

Expand Down
3 changes: 0 additions & 3 deletions src/fdb5/database/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ 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;
Expand Down
18 changes: 0 additions & 18 deletions src/fdb5/database/Manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,24 +276,6 @@ eckit::URI Manager::location(const Key& 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 Down
3 changes: 0 additions & 3 deletions src/fdb5/database/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ class Manager {
/// 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);

Expand Down
5 changes: 0 additions & 5 deletions src/fdb5/pmem/PMemEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ std::vector<eckit::PathName> PMemEngine::databases(const std::set<Key>& keys,
return result;
}

// std::vector<eckit::PathName> PMemEngine::allLocations(const Key& key, const Config& config) const
// {
// return databases(key, PoolManager(config).allPools(key), config);
// }

std::vector<eckit::PathName> PMemEngine::visitableLocations(const Key& key, const Config& config) const
{
return databases(key, PoolManager(config).visitablePools(key), config);
Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/pmem/PMemEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class PMemEngine : public fdb5::Engine {

virtual bool canHandle(const eckit::PathName& path) const;

// virtual std::vector<eckit::PathName> allLocations(const Key& key, const Config& config) const;

virtual std::vector<eckit::PathName> visitableLocations(const Key& key, const Config& config) const;
virtual std::vector<eckit::PathName> visitableLocations(const metkit::mars::MarsRequest& rq, const Config& config) const;

Expand Down
28 changes: 0 additions & 28 deletions src/fdb5/rules/Rule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,34 +225,6 @@ void Rule::expand(const Key& initialFieldKey, WriteVisitor &visitor, size_t dept
expand(initialFieldKey, predicates_.begin(), depth, keys, fullComputedKey, visitor);
}

// void Rule::expandFirstLevel( const Key& dbKey, std::vector<Predicate *>::const_iterator cur, Key& result, bool& found) const {

// if (cur == predicates_.end()) {
// found = true;
// return;
// }

// std::vector<Predicate *>::const_iterator next = cur;
// ++next;

// const std::string &keyword = (*cur)->keyword();
// const std::string &value = (*cur)->value(dbKey);

// result.push(keyword, value);

// if ((*cur)->match(result)) {
// expandFirstLevel(dbKey, next, result, found);
// }

// if (!found) {
// result.pop(keyword);
// }
// }

// void Rule::expandFirstLevel(const Key& dbKey, Key& result, bool& found) const {
// expandFirstLevel(dbKey, predicates_.begin(), result, found);
// }

void Rule::expandFirstLevel(const metkit::mars::MarsRequest& rq, std::vector<Predicate *>::const_iterator cur, TypedKey& result, bool& found) const {

if (cur == predicates_.end()) {
Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/rules/Rule.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ class Rule : public eckit::NonCopyable {
TypedKey& fullComputedKey,
WriteVisitor &Visitor) const;

// void expandFirstLevel(const Key& dbKey, std::vector<Predicate *>::const_iterator cur, Key& result, bool& done) const;
// void expandFirstLevel(const Key& dbKey, Key& result, bool& done) const ;
void expandFirstLevel(const metkit::mars::MarsRequest& request, std::vector<Predicate *>::const_iterator cur, TypedKey& result, bool& done) const;
void expandFirstLevel(const metkit::mars::MarsRequest& request, TypedKey& result, bool& done) const;

Expand Down
9 changes: 0 additions & 9 deletions src/fdb5/rules/Schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const Rule* Schema::ruleFor(const Key& dbKey, const Key& idxKey) const {
void Schema::expand(const metkit::mars::MarsRequest &request, ReadVisitor &visitor) const {
TypedKey fullComputedKey{registry()};
std::vector<TypedKey> keys(3, TypedKey{{}, registry()});
// for (auto& k : keys) k.registry(registry());

for (Rule* r : rules_) {
// eckit::Log::info() << "Rule " << **i << std::endl;
Expand Down Expand Up @@ -112,14 +111,6 @@ void Schema::expandSecond(const Key& field, WriteVisitor& visitor, const Key& db
}
}

// bool Schema::expandFirstLevel(const Key& dbKey, Key& result) const {
// bool found = false;
// for (std::vector<Rule *>::const_iterator i = rules_.begin(); i != rules_.end() && !found; ++i ) {
// (*i)->expandFirstLevel(dbKey, result, found);
// }
// return found;
// }

bool Schema::expandFirstLevel(const metkit::mars::MarsRequest& request, TypedKey& result) const {
bool found = false;
for (const Rule* rule : rules_) {
Expand Down
1 change: 0 additions & 1 deletion src/fdb5/rules/Schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class Schema : private eckit::NonCopyable {
void expandSecond(const Key& field, WriteVisitor &visitor, const Key& dbKey) const;
void expandSecond(const metkit::mars::MarsRequest& request, ReadVisitor &visitor, const Key& dbKey) const;

// bool expandFirstLevel(const Key& dbKey, Key& result) const ;
bool expandFirstLevel(const metkit::mars::MarsRequest& request, TypedKey& result) const ;
void matchFirstLevel(const Key& dbKey, std::set<Key> &result, const char* missing) const ;
void matchFirstLevel(const metkit::mars::MarsRequest& request, std::set<Key>& result, const char* missing) const ;
Expand Down
5 changes: 0 additions & 5 deletions src/fdb5/toc/TocEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@ std::vector<eckit::URI> TocEngine::databases(const metkit::mars::MarsRequest& re
return result;
}

// std::vector<eckit::URI> TocEngine::allLocations(const Key& key, const Config& config) const
// {
// return databases(key, CatalogueRootManager(config).allRoots(key), config);
// }

std::vector<eckit::URI> TocEngine::visitableLocations(const Key& key, const Config& config) const
{
return databases(key, CatalogueRootManager(config).visitableRoots(key), config);
Expand Down
2 changes: 0 additions & 2 deletions src/fdb5/toc/TocEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class TocEngine : public fdb5::Engine {

virtual bool canHandle(const eckit::URI&, const Config& config) const override;

// virtual std::vector<eckit::URI> allLocations(const Key& key, const Config& config) const override;

virtual std::vector<eckit::URI> visitableLocations(const Key& key, const Config& config) const override;
virtual std::vector<eckit::URI> visitableLocations(const metkit::mars::MarsRequest& rq, const Config& config) const override;

Expand Down

0 comments on commit 9ecac11

Please sign in to comment.