Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Framework/CCDBSupport/src/AnalysisCCDBHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ AlgorithmSpec AnalysisCCDBHelpers::fetchFromCCDB(ConfigContext const& /*ctx*/)

// Rows sharing a uniformity value resolve to the same objects, so the query is
// issued once per distinct value and the resulting handles are repeated for the
// rest of the run. When uniformity is the timestamp itself (the default) this
// degenerates to the previous behaviour, one query per row.
// rest of the run. When uniformity is the timestamp itself (the default) the
// query is issued once per run of consecutive rows with the same timestamp.
std::vector<int64_t> uniformity;
bool const shortCircuit = uniformityColumn.get() != timestampColumn.get();
if (shortCircuit) {
Expand Down Expand Up @@ -273,15 +273,13 @@ AlgorithmSpec AnalysisCCDBHelpers::fetchFromCCDB(ConfigContext const& /*ctx*/)

for (int64_t ri = 0; ri < chunk->data()->length; ri++) {
++row;
bool const sameAsPrevious = shortCircuit && haveResponses && uniformity[row] == previousUniformity;
if (shortCircuit) {
previousUniformity = uniformity[row];
}
ops.clear();
int64_t timestamp = timestamps[ri];
// Key the path lookup on the uniformity value; when uniformity is the
// timestamp itself the mapping expresses validity intervals instead.
int64_t const uniformityKey = shortCircuit ? uniformity[row] : timestamp;
bool const sameAsPrevious = haveResponses && uniformityKey == previousUniformity;
previousUniformity = uniformityKey;
int fi = 0;
for (auto& field : schema->fields()) {
auto const& url = pathTables[i][fi++].resolve(uniformityKey, field->name());
Expand Down
2 changes: 1 addition & 1 deletion Framework/CCDBSupport/src/CCDBFetcherHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ auto CCDBFetcherHelper::populateCacheWith(std::shared_ptr<CCDBFetcherHelper> con
O2_SIGNPOST_EVENT_EMIT(ccdb, sid, "populateCacheWith", "Fetching object for route %{public}s", DataSpecUtils::describe(op.spec).data());
auto concrete = DataSpecUtils::asConcreteDataMatcher(op.spec);
Output output{concrete.origin, concrete.description, concrete.subSpec};
auto&& v = allocator.makeVector<char>(output);
std::map<std::string, std::string> metadata;
std::map<std::string, std::string> headers;
std::string path = op.url;
Expand Down Expand Up @@ -232,6 +231,7 @@ auto CCDBFetcherHelper::populateCacheWith(std::shared_ptr<CCDBFetcherHelper> con

const auto& api = helper->getAPI(path);
if (checkValidity && (!api.isSnapshotMode() || etag.empty())) { // in the snapshot mode the object needs to be fetched only once
auto&& v = allocator.makeVector<char>(output);
LOGP(detail, "Loading {} for timestamp {}", path, timestampToUse);
api.loadFileToMemory(v, path, metadata, timestampToUse, &headers, etag, helper->createdNotAfter, helper->createdNotBefore);
if ((headers.count("Error") != 0) || (etag.empty() && v.empty())) {
Expand Down
Loading