-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/fdb 389 dump tools #75
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
@@ -39,7 +39,7 @@ class TocEngine : public fdb5::Engine { | |||
std::vector<eckit::URI> databases(const metkit::mars::MarsRequest& rq, const std::vector<eckit::PathName>& dirs, | |||
const Config& config) const; | |||
|
|||
void scan_dbs(const std::string& path, std::list<std::string>& dbs) const; | |||
void scan_dbs(const std::string& path, std::list<std::string>& dbs, bool lowercase = false) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be removed
@@ -42,7 +42,7 @@ namespace fdb5 { | |||
|
|||
//---------------------------------------------------------------------------------------------------------------------- | |||
|
|||
void TocEngine::scan_dbs(const std::string& path, std::list<std::string>& dbs) const { | |||
void TocEngine::scan_dbs(const std::string& path, std::list<std::string>& dbs, bool lowercase) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be moved into unnamed namespace
it's always lowercase=true
, need it ?
@@ -1340,7 +1340,7 @@ std::vector<Index> TocHandler::loadIndexes(const Catalogue& catalogue, bool sort | |||
s >> offset; | |||
s >> type; | |||
LOG_DEBUG(debug, LibFdb5) << "TocRecord TOC_INDEX " << path << " - " << offset << std::endl; | |||
tocindexes[entry.seqNo] = new TocIndex(s, catalogue, entry.datap->header_.serialisationVersion_, | |||
tocindexes[entry.seqNo] = new TocIndex(s, entry.datap->header_.serialisationVersion_, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you remove catalogue
from 1- lambda, and 2- ::loadIndexes()
.. also from enumerateMasked
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not this PR but can add threads.reserve(nthreads);
above ?
@@ -98,7 +98,7 @@ void FDBRead::execute(const eckit::option::CmdArgs &args) { | |||
|
|||
std::unique_ptr<eckit::DataHandle> dh(handles.dataHandle()); | |||
|
|||
dh->copyTo(out); | |||
dh->saveInto(out); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have we changed copyTo into saveInto? That changes behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reverting to saveInto
with copyTo we lack the statistics
std::transform(keys.begin(), keys.end(), std::back_inserter(keystrings), | ||
[](const Key& k) { return k.valuesToString(); }); | ||
std::set<std::string> keystrings; | ||
for (const auto& key : keys) { keystrings.insert(key.valuesToString()); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What has motivated this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to remove duplicates (possible with very broad listing requests matching multiple rules at 1st level)
fdb-dump-toc and fdb-dump-index where creating a TocHandler and passing to TocIndex ctor after a cast to TocCatalogue
The cast was failing since the object where created as TocHandler (superclass of TocCatalogue)
catalogue is no longer used in TocIndex, thus I've removed the offending cast