Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Mar 22, 2024
1 parent ed0a974 commit 8737369
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions src/fdb5/api/FDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "fdb5/database/Key.h"
#include "fdb5/io/HandleGatherer.h"
#include "fdb5/message/MessageDecoder.h"
#include "fdb5/types/Type.h"

namespace fdb5 {

Expand Down Expand Up @@ -100,33 +101,24 @@ void FDB::archive(const Key& key, const void* data, size_t length) {
eckit::Timer timer;
timer.start();

<<<<<<< HEAD
auto stepunit = key.find("stepunits");
if (stepunit != key.end()) {
Key k;
for (auto it : key) {
if (it.first == "step" && stepunit->second.size()>0 && stepunit->second[0]!='h') {
// TODO - enable canonical representation of step (as soon as Metkit supports it)
std::string canonicalStep = it.second+stepunit->second; // k.registry().lookupType("step").toKey("step", it.second+stepunit->second);
k.set(it.first, canonicalStep);
} else {
if (it.first != "stepunits") {
k.set(it.first, it.second);
}
}
}
internal_->archive(k, data, length);
} else {
internal_->archive(key, data, length);
}
=======
// This is the API entrypoint. Keys supplied by the user may not have type registry info attached (so
// serialisation won't work properly...)
Key keyInternal(key);
keyInternal.registry(config().schema().registry());

// step in archival requests from the model is just an integer. We need to include the stepunit
auto stepunit = keyInternal.find("stepunits");
if (stepunit != keyInternal.end()) {
if (stepunit->second.size()>0 && stepunit->second[0]!='h') {
auto step = keyInternal.find("step");
if (step != keyInternal.end()) {
std::string canonicalStep = keyInternal.registry().lookupType("step").toKey("step", step->second+stepunit->second);
}
}
keyInternal.unset("stepunits");
}

internal_->archive(keyInternal, data, length);
>>>>>>> c062d99a (FDB-303: Remove Rule from the Key, and replace with TypesRegistry information)
dirty_ = true;

timer.stop();
Expand Down

0 comments on commit 8737369

Please sign in to comment.