Skip to content

Commit

Permalink
Merge branch 'release/0.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisspyB committed Sep 16, 2024
2 parents 7621932 + 463f680 commit 38acb73
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ecbuild_add_option( FEATURE GRIBJUMP_LOCAL_EXTRACT
DESCRIPTION "Build local extraction and serverside functionality")

if (HAVE_GRIBJUMP_LOCAL_EXTRACT)
ecbuild_find_package( NAME fdb5 VERSION 5.11.28 REQUIRED )
ecbuild_find_package( NAME fdb5 VERSION 5.13.1 REQUIRED )
set(GRIBJUMP_HAVE_FDB 1)

ecbuild_find_package( NAME eccodes VERSION 2.32.1 REQUIRED )
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.2
0.5.3
2 changes: 1 addition & 1 deletion src/gribjump/FDBPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void FDBPlugin::addFDB(fdb5::FDB& fdb) {
aggregators_.emplace_back(std::make_unique<std::optional<InfoAggregator>>());
std::optional<InfoAggregator>& aggregator = *aggregators_.back();

fdb.registerArchiveCallback([this, &aggregator](const fdb5::Key& key, const void* data, const size_t length, std::future<std::shared_ptr<FieldLocation>> future) {
fdb.registerArchiveCallback([this, &aggregator](const fdb5::Key& key, const void* data, const size_t length, std::future<std::shared_ptr<const FieldLocation>> future) {
if (!matches(key) || length < 4)
return;

Expand Down
8 changes: 4 additions & 4 deletions src/gribjump/info/InfoAggregator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ InfoAggregator::InfoAggregator(): futures_(AGGREGATOR_QUEUE_SIZE) {
for (;;) {
locPair elem;
if (futures_.pop(elem) == -1) break;
std::shared_ptr<fdb5::FieldLocation> location = elem.first.get();
std::shared_ptr<const fdb5::FieldLocation> location = elem.first.get();
std::unique_ptr<JumpInfo> info = std::move(elem.second);
insert(location->fullUri(), std::move(info));
}
Expand All @@ -48,7 +48,7 @@ InfoAggregator::~InfoAggregator() {
close();
}

void InfoAggregator::add(std::future<std::shared_ptr<fdb5::FieldLocation>> future, eckit::MemoryHandle& handle, eckit::Offset offset) {
void InfoAggregator::add(std::future<std::shared_ptr<const fdb5::FieldLocation>> future, eckit::MemoryHandle& handle, eckit::Offset offset) {

handle.openForRead();
eckit::AutoClose closer(handle);
Expand Down Expand Up @@ -102,7 +102,7 @@ SerialAggregator::SerialAggregator() {
SerialAggregator::~SerialAggregator() {
}

void SerialAggregator::add(std::future<std::shared_ptr<fdb5::FieldLocation>> future, eckit::MemoryHandle& handle, eckit::Offset offset) {
void SerialAggregator::add(std::future<std::shared_ptr<const fdb5::FieldLocation>> future, eckit::MemoryHandle& handle, eckit::Offset offset) {

handle.openForRead();
eckit::AutoClose closer(handle);
Expand All @@ -113,7 +113,7 @@ void SerialAggregator::add(std::future<std::shared_ptr<fdb5::FieldLocation>> fut
}

std::unique_ptr<JumpInfo> info(InfoFactory::instance().build(handle, offset));
std::shared_ptr<fdb5::FieldLocation> location = future.get();
std::shared_ptr<const fdb5::FieldLocation> location = future.get();
insert(location->fullUri(), std::move(info));
}

Expand Down
6 changes: 3 additions & 3 deletions src/gribjump/info/InfoAggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ using Key = std::string;
// NB: This object creates a consumer thread (in ctor) and accepts futures from producers (add(), flush()).
// Note that it *is not* safe to have multiple producers calling add() and/or flush() concurrently.
class InfoAggregator {
using locPair = std::pair<std::future<std::shared_ptr<fdb5::FieldLocation>>, std::unique_ptr<JumpInfo>>;
using locPair = std::pair<std::future<std::shared_ptr<const fdb5::FieldLocation>>, std::unique_ptr<JumpInfo>>;

public:
InfoAggregator();
~InfoAggregator();

void add(std::future<std::shared_ptr<fdb5::FieldLocation>> future, eckit::MemoryHandle& handle, eckit::Offset offset);
void add(std::future<std::shared_ptr<const fdb5::FieldLocation>> future, eckit::MemoryHandle& handle, eckit::Offset offset);

void flush();

Expand All @@ -59,7 +59,7 @@ class SerialAggregator {
SerialAggregator();
~SerialAggregator();

void add(std::future<std::shared_ptr<fdb5::FieldLocation>> future, eckit::MemoryHandle& handle, eckit::Offset offset);
void add(std::future<std::shared_ptr<const fdb5::FieldLocation>> future, eckit::MemoryHandle& handle, eckit::Offset offset);
void flush();

private:
Expand Down

0 comments on commit 38acb73

Please sign in to comment.