Skip to content
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

Remote fdb #54

Draft
wants to merge 217 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 198 commits
Commits
Show all changes
217 commits
Select commit Hold shift + click to select a range
7a593ab
wip
danovaro Oct 6, 2023
8fc61a7
Schema streamable
danovaro Oct 6, 2023
1d65ce7
wip
danovaro Oct 10, 2023
b6691d5
wip
danovaro Oct 10, 2023
337cc51
cleanup
danovaro Oct 10, 2023
d5f9ae8
removed DB, added fdb remote connection multiplexer
danovaro Oct 19, 2023
563d1ad
removed default Schema ctor
danovaro Oct 24, 2023
020ce9f
fixed RemoteFieldLocation URI parsing + UriStore cleanup
danovaro Oct 26, 2023
e9df4ee
Remote catalogue write pathway wip
ChrisspyB Oct 26, 2023
8b4a464
Merge branch 'develop' into feature/noDB
danovaro Oct 26, 2023
d6a0003
fdb remote - fix flush of multiple DBs
danovaro Oct 26, 2023
cee3a23
fdb remote - read
danovaro Oct 27, 2023
618e3da
Remote catalogue list and api forwarding
ChrisspyB Oct 27, 2023
4908bc5
Merge branch 'feature/noDB' into feature/noDB
ChrisspyB Oct 27, 2023
2e8d795
receive store config from catalogue
danovaro Oct 27, 2023
6a2843d
Remote retrieve and archive using control endpoint
ChrisspyB Oct 27, 2023
40e783f
Merge branch 'feature/noDB' of ssh://git.ecmwf.int/mars/fdb5 into fea…
ChrisspyB Oct 27, 2023
6c7c24b
lazy creation of remote::Archiver
danovaro Oct 27, 2023
2d6666f
Merge branch 'feature/noDB' of ssh://git.ecmwf.int/mars/fdb5 into fea…
danovaro Oct 27, 2023
9894117
list/retrieve/archive with both catalogue and store remote
danovaro Oct 29, 2023
eb715c0
random store
danovaro Oct 29, 2023
79e22bf
removed remote::Client::key()
danovaro Oct 30, 2023
69e2b9d
Merge branch 'master' into feature/noDB
danovaro Oct 30, 2023
dfb54b4
addressed PR comments (blocking requests are using data channel - imp…
danovaro Nov 5, 2023
8ab2cc2
cleanup
danovaro Nov 6, 2023
e5c17d7
wip
danovaro Nov 7, 2023
8eee95e
wip
danovaro Nov 7, 2023
da0a0f7
wip
danovaro Nov 7, 2023
40fcf66
wip
danovaro Nov 7, 2023
d46037c
wip
danovaro Nov 7, 2023
75e8aa9
added localStores (to strip endpoint before archival/inject endpoint …
danovaro Nov 8, 2023
77af845
fdb-read not respecting order
danovaro Nov 8, 2023
5b4c9dc
Archiver cleanup
danovaro Nov 9, 2023
3df7fb7
Merge branch 'feature/FDB-320_listCompact' into remoteFDB
danovaro Nov 9, 2023
1827694
fix merge
danovaro Nov 9, 2023
06339d3
empty line
Nov 14, 2023
0da176a
Merge branch 'remoteFDB' of ssh://git.ecmwf.int/mars/fdb5 into remoteFDB
Nov 14, 2023
42c4f08
archive callback
danovaro Nov 16, 2023
1a0bec2
Merge branch 'develop' into remoteFDB
danovaro Nov 19, 2023
2943da3
cleanup
danovaro Nov 23, 2023
c132acc
cleanup
danovaro Nov 23, 2023
4adcf41
wip
danovaro Nov 24, 2023
20e580a
fix remote archiver
danovaro Nov 24, 2023
08a4b86
cleanup
danovaro Nov 27, 2023
399a344
version bump
danovaro Nov 27, 2023
3e18426
Merge branch 'master' into remoteFDB
danovaro Nov 27, 2023
2572484
reduced verbosity on archival
danovaro Nov 28, 2023
562a1b9
Merge branch 'remoteFDB' of ssh://git.ecmwf.int/mars/fdb5 into remoteFDB
danovaro Nov 28, 2023
00c3527
wip
danovaro Nov 29, 2023
fc61ce1
fdb remote - connection demultiplexing
danovaro Dec 3, 2023
41a34ad
version bump
danovaro Dec 3, 2023
5e90127
client-defined domain of fdb remote endpoints
danovaro Dec 7, 2023
d51e189
passing archiver ID to minimise the number of archival threads
danovaro Dec 7, 2023
d9937fa
version bump
danovaro Dec 7, 2023
1da7376
fix dependency
danovaro Dec 7, 2023
8170786
Message::Store
danovaro Dec 7, 2023
ecf3f43
wip
danovaro Dec 7, 2023
9473df2
wip
danovaro Dec 7, 2023
de5d324
Merge branch 'develop' into remoteFDB
danovaro Dec 8, 2023
e094c0f
cleanup
danovaro Dec 8, 2023
f4c6320
Merge branch 'feature/FDB-320_listCompact' into remoteFDB
danovaro Dec 8, 2023
ed0ad67
fdb remote multiple networks
danovaro Dec 12, 2023
4d030a9
missing include
danovaro Dec 12, 2023
49a81e3
version bump
danovaro Dec 12, 2023
830fedc
wip
danovaro Dec 15, 2023
6fb345f
wip
danovaro Dec 15, 2023
9438332
wip
danovaro Dec 15, 2023
25cb578
fix disconnection
danovaro Dec 15, 2023
3a23919
version bump
danovaro Dec 15, 2023
49a2365
initial implementation of FDBRemoteDataHandle::estimate
danovaro Dec 18, 2023
b1ae035
version bump
danovaro Dec 18, 2023
f2b7251
ClientConnection cleanup
danovaro Dec 24, 2023
5284b99
tag
danovaro Jan 2, 2024
44370ca
improved error report
danovaro Jan 4, 2024
10fc5e8
Merge branch 'hotfix/5.11.29' into remoteFDB
danovaro Jan 11, 2024
476a1ec
refactored store endpoint configuration
danovaro Jan 11, 2024
2ff5a35
multi-archiver
danovaro Feb 8, 2024
bcd5d90
async data write, unified connection
danovaro Feb 20, 2024
33b7bea
lowercase metadata
danovaro Feb 21, 2024
3647975
Merge branch 'feature/lowercase' into remoteFDB
danovaro Feb 21, 2024
786a777
Revert "lowercase metadata"
danovaro Feb 22, 2024
14d2d9a
all keys to lowercase
danovaro Feb 22, 2024
d0c0cdb
scan_dbs accepting symlinks
danovaro Feb 22, 2024
5a3bc9a
version bump
danovaro Feb 22, 2024
87ccf55
archival on existing (case sensitive) db
danovaro Feb 23, 2024
46d4166
version bump
danovaro Feb 23, 2024
d3afd34
fix remote termination
danovaro Mar 1, 2024
ec5e557
version bump
danovaro Mar 2, 2024
b5c2a77
fdb read returns a seekable handle
danovaro Mar 8, 2024
9ac8b94
version bump
danovaro Mar 8, 2024
d08408c
wip
danovaro Mar 10, 2024
c89ada3
fixed fdb handler termination
danovaro Mar 11, 2024
4fb2629
fixed handler termination (closed archivalQueue)
danovaro Mar 12, 2024
f529745
Merge branch 'remoteFDBstopHandler' into remoteFDB
danovaro Mar 12, 2024
04c5501
fix seekable handle
danovaro Mar 13, 2024
1054385
process termination
danovaro Mar 13, 2024
b8085b2
wait for future before dtor
danovaro Mar 13, 2024
2a3fac1
cleanup FDB remote blocking requests
danovaro Mar 15, 2024
17a9bcb
fdb remote src file cleanup
danovaro Mar 15, 2024
a284d06
tag
danovaro Mar 15, 2024
cc3f2fa
fix message buffering (read in chunks)
danovaro Mar 17, 2024
75e7cdc
PR comments
danovaro Mar 20, 2024
9f29eaf
debug macro
danovaro Mar 24, 2024
e97ebc8
version bump
danovaro Mar 25, 2024
e8baf96
fix single connection + archival ack
danovaro Apr 2, 2024
6c3ff1b
version bump
danovaro Apr 2, 2024
26344a8
fix multiple flushes + lazy creation of futures
danovaro Apr 4, 2024
2700124
version bump
danovaro Apr 5, 2024
e8413de
added request expansion to C api
danovaro Apr 10, 2024
856cdc5
added tokenizing of MarsRequest metadata
danovaro Apr 10, 2024
54bd06e
added tokenizing of MarsRequest metadata
danovaro Apr 10, 2024
d52e86a
updated step-range canonical unit
danovaro Apr 10, 2024
3c10fa9
Pull request #94: added request expansion to C api
danovaro Apr 10, 2024
6034b72
version bump
danovaro Apr 10, 2024
e1e2dd4
fix catalogue indexing with async store archival
danovaro Apr 15, 2024
3667c5e
propagated catalogue index key in Catalogue::archive
danovaro Apr 15, 2024
87948df
added comment
danovaro Apr 16, 2024
b1d04ef
Pull request #95: fix catalogue indexing with async store archival
danovaro Apr 16, 2024
63dfd6d
version bump
danovaro Apr 16, 2024
36ad610
Add archival status logging
ChrisspyB Apr 26, 2024
17ae0bb
fdb remote stats
danovaro Apr 30, 2024
a6dd9ec
tag
danovaro Apr 30, 2024
a59cff6
TocStats check for data file existence
danovaro Apr 30, 2024
ac9d98f
FDB remote - fix race condition blocking requests
danovaro May 1, 2024
b3e6111
fix regex options
danovaro May 1, 2024
395596e
sync action + connection termination
danovaro May 2, 2024
4b6fe5c
fix FDBRemoteStore read to cope with optimised MultiHandle read
danovaro Jun 4, 2024
f1bdbec
version bump
danovaro Jun 4, 2024
12ff64a
fixed dataWriteQueue initialisation
danovaro Jul 1, 2024
cf314bb
Allow RemoteFieldLocation construction from uri
ChrisspyB Jul 1, 2024
ecf4d33
protected clients_ and promises_ with mutexes
danovaro Jul 1, 2024
78622a1
version bump
danovaro Jul 1, 2024
f1c8115
Remove early return
ChrisspyB Jul 2, 2024
e2f4834
pool of FDBs in CatalogueHandler
danovaro Jul 2, 2024
f1360ae
version bump
danovaro Jul 2, 2024
049e11b
remoteFDB concurrecy
danovaro Jul 3, 2024
7fdc98b
remoteFDB connection teardown
danovaro Jul 3, 2024
36e7bc9
fixed remoteStore builder
danovaro Jul 3, 2024
5df53a6
concurrent remote readers
danovaro Jul 3, 2024
9c0f629
version bump
danovaro Jul 4, 2024
f90b99d
retrieveMessageQueue_ protected by mutex
danovaro Jul 5, 2024
6c991d7
Increase buffer size for api requests
ChrisspyB Jul 10, 2024
2758dc3
fix merge
danovaro Jul 12, 2024
bb8557f
Merge branch 'feature/canonicalKey' into merge_remote_canonicalKey
danovaro Aug 12, 2024
5cd3a51
fix merge
danovaro Aug 13, 2024
7fe0f17
Merge branch 'feature/canonicalKey' into merge_remote_canonicalKey
danovaro Aug 13, 2024
f6ff5df
Merge branch 'remoteFDB' into merge_remote_canonicalKey
danovaro Aug 13, 2024
ac05187
wip
danovaro Aug 16, 2024
183e257
start remoteFDB data connection earlier
danovaro Sep 4, 2024
49a2f13
version bump
danovaro Sep 4, 2024
b49b2a1
fixed remoteFDB data connection binding
danovaro Sep 4, 2024
b2d9c6b
fixed unit tests (DAOS catalogue factory name + archive callback comp…
danovaro Sep 5, 2024
df121a0
improved composition of callback + async archival
danovaro Sep 6, 2024
31e553e
Merge branch 'remoteFDB' into merge_remote_canonicalKey
danovaro Sep 6, 2024
3c7f4ec
Merge branch 'feature/canonicalKey' into merge_remote_canonicalKey
danovaro Sep 10, 2024
b39ee3d
fix callback composition in archival
danovaro Sep 11, 2024
b6e225f
fix remote flush
danovaro Sep 12, 2024
df54644
improved FDB error reporting
danovaro Sep 13, 2024
1e3b158
Merge branch 'feature/canonicalKey' into merge_remote_canonicalKey
danovaro Sep 19, 2024
2a07281
wip
danovaro Sep 23, 2024
254ed76
Merge branch 'develop' into merge_remote_canonicalKey
danovaro Sep 23, 2024
6631185
Merge branch 'develop' into merge_remote_canonicalKey
danovaro Sep 23, 2024
2d25663
fix merge + nuked pmem
danovaro Sep 23, 2024
90ea48a
tag
danovaro Sep 24, 2024
5a18659
remote teardown on error
danovaro Sep 30, 2024
6d99a27
fixed order of data connection init
danovaro Sep 30, 2024
0b12259
force single connection
danovaro Sep 30, 2024
c21f5f3
force single connection
danovaro Sep 30, 2024
07e4d3b
wip
danovaro Sep 30, 2024
2832638
wip
danovaro Sep 30, 2024
7f1fd53
wip
danovaro Sep 30, 2024
4bbd91c
wip
danovaro Sep 30, 2024
9e80e07
wip
danovaro Sep 30, 2024
6263ddd
wip
danovaro Sep 30, 2024
3f57dd4
wip
danovaro Sep 30, 2024
84cdfd4
wip
danovaro Sep 30, 2024
27ad205
wip
danovaro Sep 30, 2024
2d3ce4d
wip
danovaro Sep 30, 2024
4c1ac8d
wip
danovaro Oct 1, 2024
3825bb6
wip
danovaro Oct 3, 2024
253a432
Merge branch 'develop' into remoteFDB
danovaro Oct 7, 2024
7ec275b
wip
danovaro Oct 7, 2024
f8652cb
Merge branch 'develop' into remoteFDB
danovaro Oct 22, 2024
0d61134
sleep before connection
danovaro Oct 31, 2024
52a8746
sleep before connection
danovaro Oct 31, 2024
ae94a85
data connection async accept
danovaro Nov 4, 2024
a0087c2
wip
danovaro Nov 4, 2024
29ba56c
wip
danovaro Nov 4, 2024
a7dd7e5
wip
danovaro Nov 4, 2024
e32c79d
cleanup TCPException
danovaro Nov 6, 2024
07dc074
Merge branch 'develop' into remoteFDB
danovaro Nov 6, 2024
5d83a55
fix merge develop
danovaro Nov 6, 2024
2f048df
cleanup
danovaro Nov 6, 2024
fdaa5d4
little cleanup
danovaro Nov 8, 2024
f2ed166
version bump
danovaro Nov 8, 2024
8397826
config remoteFDB connection(s)
danovaro Nov 11, 2024
872573a
fix merge
danovaro Nov 14, 2024
d0af10f
Merge branch 'develop' into remoteFDB
danovaro Nov 26, 2024
9057f3e
wip
danovaro Nov 29, 2024
db308cf
Base tmpdir on cwd in auxiliary/callback tests
ChrisspyB Nov 27, 2024
9d2bebd
FDB-330 lustre FS identification
danovaro Nov 27, 2024
99d130a
FDB-330 lustre FS identification
danovaro Nov 27, 2024
e5f2ace
addressed PR + fix toc async read
danovaro Nov 28, 2024
f4245dc
Merge branch 'develop' into remoteFDB
danovaro Dec 6, 2024
49dcda0
retrieve seekable handle removed (and ported to feature/57-seekable b…
danovaro Dec 10, 2024
b64b924
retrieve seekable handle removed (and ported to feature/57-seekable b…
danovaro Dec 10, 2024
7e03919
retrieve seekable handle removed in the c API
danovaro Dec 10, 2024
46508f3
Remove commented code
Ozaq Dec 11, 2024
b70c849
Fix PR
danovaro Dec 11, 2024
43ce247
Remove commented out code & formatting
Ozaq Dec 11, 2024
5974d92
addressed PR comments (mutex on flush while evicting a catalogue from…
danovaro Dec 18, 2024
598a1d7
compute Axes encoding size (to allocate the correct buffer size)
danovaro Dec 19, 2024
10d10b0
added Schema dependency
danovaro Dec 20, 2024
5a6a08f
wip
danovaro Dec 20, 2024
4ea6a5b
Revert "wip"
danovaro Dec 20, 2024
b07fa9f
reverted to Store* in EntryVisitor
danovaro Dec 20, 2024
92e37c7
version bump
danovaro Dec 20, 2024
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
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ ecbuild_add_option( FEATURE GRIB

ecbuild_find_package( NAME metkit VERSION 1.11.22 REQUIRED )

### FDB backend in persistent memory, i.e. pmem (NVRAM)

ecbuild_add_option( FEATURE PMEMFDB # option present in fdb5_config.h
DEFAULT OFF
DESCRIPTION "Persistent memory (NVRAM) support for FDB"
REQUIRED_PACKAGES "NAME pmem" )

### FDB backend in CEPH object store (using Rados)

find_package( RADOS QUIET )
Expand Down Expand Up @@ -166,6 +159,7 @@ add_subdirectory( tests )

### finalize


ecbuild_install_project( NAME fdb )

ecbuild_print_summary()
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.13.3
5.13.105
88 changes: 27 additions & 61 deletions src/fdb5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ list( APPEND fdb5_srcs
database/BaseArchiveVisitor.h
database/Catalogue.cc
database/Catalogue.h
database/DB.cc
database/DB.h
database/DatabaseNotFoundException.cc
database/DatabaseNotFoundException.h
database/DataStats.cc
Expand Down Expand Up @@ -126,7 +124,6 @@ list( APPEND fdb5_srcs
database/IndexFactory.h
database/Key.cc
database/Key.h
database/ReadVisitor.cc
database/ReadVisitor.h
database/Report.cc
database/Report.h
Expand All @@ -153,6 +150,8 @@ list( APPEND fdb5_srcs
io/LustreFileHandle.h
io/HandleGatherer.cc
io/HandleGatherer.h
io/FieldHandle.cc
io/FieldHandle.h
rules/MatchAlways.cc
rules/MatchAlways.h
rules/MatchAny.cc
Expand Down Expand Up @@ -220,18 +219,37 @@ if(HAVE_FDB_REMOTE)
api/RemoteFDB.cc
api/RemoteFDB.h

remote/RemoteConfiguration.h
remote/RemoteConfiguration.cc
remote/Connection.h
remote/Connection.cc
remote/RemoteFieldLocation.h
remote/RemoteFieldLocation.cc
remote/Messages.h
remote/Messages.cc
remote/Handler.h
remote/Handler.cc
remote/AvailablePortList.cc
remote/AvailablePortList.h
remote/FdbServer.h
remote/FdbServer.cc

remote/client/Client.h
remote/client/Client.cc
remote/client/ClientConnection.h
remote/client/ClientConnection.cc
remote/client/ClientConnectionRouter.h
remote/client/ClientConnectionRouter.cc
remote/client/RemoteStore.cc
remote/client/RemoteStore.h
remote/client/RemoteCatalogue.h
remote/client/RemoteCatalogue.cc

remote/server/AvailablePortList.cc
remote/server/AvailablePortList.h
remote/server/CatalogueHandler.h
remote/server/CatalogueHandler.cc
remote/server/StoreHandler.h
remote/server/StoreHandler.cc
remote/server/ServerConnection.h
remote/server/ServerConnection.cc

# remote/RemoteConfiguration.h
# remote/RemoteConfiguration.cc
Ozaq marked this conversation as resolved.
Show resolved Hide resolved
)
endif()

Expand Down Expand Up @@ -310,58 +328,6 @@ if( HAVE_TOCFDB )
fdb-reconsolidate-toc )
endif()

if( HAVE_PMEMFDB )

list( APPEND fdb5_srcs
pmem/DataPool.cc
pmem/DataPool.h
pmem/DataPoolManager.cc
pmem/DataPoolManager.h
pmem/MemoryBufferStream.h
pmem/MemoryBufferStream.cc
pmem/PBaseNode.cc
pmem/PBaseNode.h
pmem/PBranchingNode.cc
pmem/PBranchingNode.h
pmem/PDataNode.cc
pmem/PDataNode.h
pmem/PDataRoot.cc
pmem/PDataRoot.h
pmem/PIndexRoot.cc
pmem/PIndexRoot.h
pmem/PMemDB.cc
pmem/PMemDB.h
pmem/PMemDBReader.cc
pmem/PMemDBReader.h
pmem/PMemDBWriter.cc
pmem/PMemDBWriter.h
pmem/PMemFieldLocation.cc
pmem/PMemFieldLocation.h
pmem/PMemIndex.cc
pmem/PMemIndex.h
pmem/PMemIndexLocation.cc
pmem/PMemIndexLocation.h
pmem/PRoot.cc
pmem/PRoot.h
pmem/Pool.cc
pmem/Pool.h
pmem/PoolEntry.cc
pmem/PoolEntry.h
pmem/PoolGroup.cc
pmem/PoolGroup.h
pmem/PoolManager.cc
pmem/PoolManager.h
pmem/PMemStats.cc
pmem/PMemStats.h
pmem/PMemEngine.cc
pmem/PMemEngine.h
)

else()
set( PMEM_LIBRARIES "" )
set( PMEM_INCLUDE_DIRS "" )
endif()

if( HAVE_RADOSFDB )
list( APPEND fdb5_srcs
rados/RadosFieldLocation.cc
Expand Down
3 changes: 2 additions & 1 deletion src/fdb5/LibFdb5.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

#include "eckit/system/Library.h"

#include "fdb5/database/DB.h"
#include "fdb5/database/Catalogue.h"
#include "fdb5/types/TypesRegistry.h"
#include "fdb5/api/helpers/Callback.h"

namespace fdb5 {
Expand Down
2 changes: 2 additions & 0 deletions src/fdb5/api/DistFDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class DistFDB : public FDBBase {

ListIterator list(const FDBToolRequest& request) override;

AxesIterator axesIterator(const FDBToolRequest& request, int level=3) override { NOTIMP; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this warrants an explanation why this FDB type does not allow axes iteration.


DumpIterator dump(const FDBToolRequest& request, bool simple) override;

StatusIterator status(const FDBToolRequest& request) override;
Expand Down
19 changes: 9 additions & 10 deletions src/fdb5/api/FDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "fdb5/api/helpers/FDBToolRequest.h"
#include "fdb5/database/Key.h"
#include "fdb5/io/HandleGatherer.h"
#include "fdb5/io/FieldHandle.h"
#include "fdb5/message/MessageDecoder.h"
#include "fdb5/types/Type.h"

Expand Down Expand Up @@ -145,13 +146,6 @@ bool FDB::sorted(const metkit::mars::MarsRequest &request) {
return sorted;
}

class ListElementDeduplicator : public metkit::hypercube::Deduplicator<ListElement> {
public:
bool toReplace(const ListElement& existing, const ListElement& replacement) const override {
return existing.timestamp() < replacement.timestamp();
}
};

eckit::DataHandle* FDB::read(const eckit::URI& uri) {
auto location = std::unique_ptr<FieldLocation>(FieldLocationFactory::instance().build(uri.scheme(), uri));
return location->dataHandle();
Expand All @@ -168,7 +162,12 @@ eckit::DataHandle* FDB::read(const std::vector<eckit::URI>& uris, bool sorted) {
return result.dataHandle();
}

eckit::DataHandle* FDB::read(ListIterator& it, bool sorted) {
eckit::DataHandle* FDB::read(bool seekable, ListIterator& it, bool sorted) {

if (seekable) {
return new FieldHandle(it);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really by done in a separate overload or even different function. This way you also do not break the existing interface and retain backward compatibility. Although the more adequate fix is to not expose the distinction between seekable and non-seekable FDB through the interface.

eckit::Timer timer;
timer.start();

Expand Down Expand Up @@ -219,9 +218,9 @@ eckit::DataHandle* FDB::read(ListIterator& it, bool sorted) {
return result.dataHandle();
}

eckit::DataHandle* FDB::retrieve(const metkit::mars::MarsRequest& request) {
eckit::DataHandle* FDB::retrieve(const metkit::mars::MarsRequest& request, bool seekable) {
ListIterator it = inspect(request);
return read(it, sorted(request));
return read(seekable, it, sorted(request));
}

ListIterator FDB::inspect(const metkit::mars::MarsRequest& request) {
Expand Down
4 changes: 2 additions & 2 deletions src/fdb5/api/FDB.h
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RemoteFDB only supports a subset of the interface and throws a NotImplemented exception that will reach caller code. I think this is a surprising design as the Exception is unexpected (nothing in the interface indicates that behavior) and also not very descriptive. Not implemented can have several meanings, at a bare minimum the exception should be translated into a "NotSupportedForThisDBType" exception. It would be nice to be able to programmatically inspect for capabilities, e.g. have something such has bool supports_wipe().

Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ class FDB {

eckit::DataHandle* read(const std::vector<eckit::URI>& uris, bool sorted = false);

eckit::DataHandle* read(ListIterator& it, bool sorted = false);
eckit::DataHandle* read(bool seekable, ListIterator& it, bool sorted = false);
Ozaq marked this conversation as resolved.
Show resolved Hide resolved

eckit::DataHandle* retrieve(const metkit::mars::MarsRequest& request);
eckit::DataHandle* retrieve(const metkit::mars::MarsRequest& request, bool seekable = false);
Ozaq marked this conversation as resolved.
Show resolved Hide resolved

ListIterator inspect(const metkit::mars::MarsRequest& request);

Expand Down
18 changes: 11 additions & 7 deletions src/fdb5/api/FDBFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "eckit/utils/Regex.h"
#include "eckit/memory/NonCopyable.h"

#include "fdb5/database/DB.h"
#include "fdb5/database/Catalogue.h"
#include "fdb5/config/Config.h"
#include "fdb5/api/FDBStats.h"
#include "fdb5/api/helpers/AxesIterator.h"
Expand All @@ -39,13 +39,17 @@
#include "fdb5/api/helpers/StatusIterator.h"
#include "fdb5/api/helpers/Callback.h"

namespace eckit {
namespace message {
namespace eckit::message {

class Message;
}
} // namespace eckit

namespace metkit { class MarsRequest; }
} // namespace eckit::message

namespace metkit {

class MarsRequest;

} // namespace metkit

namespace fdb5 {

Expand Down Expand Up @@ -89,7 +93,7 @@ class FDBBase : private eckit::NonCopyable {

virtual MoveIterator move(const FDBToolRequest& request, const eckit::URI& dest) = 0;

virtual AxesIterator axesIterator(const FDBToolRequest& request, int axes) { NOTIMP; }
virtual AxesIterator axesIterator(const FDBToolRequest& request, int axes) = 0;

void registerArchiveCallback(ArchiveCallback callback) {callback_ = callback;}

Expand Down
5 changes: 5 additions & 0 deletions src/fdb5/api/FDBStats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace fdb5 {

FDBStats::FDBStats() :
numArchive_(0),
numLocation_(0),
numFlush_(0),
numRetrieve_(0),
bytesArchive_(0),
Expand All @@ -48,6 +49,7 @@ FDBStats::~FDBStats() {}

FDBStats& FDBStats::operator+=(const FDBStats& rhs) {
numArchive_ += rhs.numArchive_;
numLocation_ += rhs.numLocation_;
numFlush_ += rhs.numFlush_;
numRetrieve_ += rhs.numRetrieve_;
bytesArchive_ += rhs.bytesArchive_;
Expand Down Expand Up @@ -81,6 +83,9 @@ void FDBStats::addArchive(size_t length, eckit::Timer& timer, size_t nfields) {
<< ", total: " << Seconds(elapsedArchive_) << std::endl;
}

void FDBStats::addLocation(size_t nfields) {
numLocation_ += nfields;
}

void FDBStats::addRetrieve(size_t length, eckit::Timer& timer) {

Expand Down
3 changes: 3 additions & 0 deletions src/fdb5/api/FDBStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ class FDBStats : public eckit::Statistics {
~FDBStats();

size_t numArchive() const { return numArchive_; }
size_t numLocation() const { return numLocation_; }
size_t numFlush() const { return numFlush_; }

void addArchive(size_t length, eckit::Timer& timer, size_t nfields=1);
void addLocation(size_t nfields=1);
void addRetrieve(size_t length, eckit::Timer& timer);
void addFlush(eckit::Timer& timer);

Expand All @@ -49,6 +51,7 @@ class FDBStats : public eckit::Statistics {
private: // members

size_t numArchive_;
size_t numLocation_;
size_t numFlush_;
size_t numRetrieve_;

Expand Down
4 changes: 2 additions & 2 deletions src/fdb5/api/LocalFDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "fdb5/api/helpers/FDBToolRequest.h"
#include "fdb5/api/LocalFDB.h"
#include "fdb5/database/Archiver.h"
#include "fdb5/database/DB.h"
#include "fdb5/database/Catalogue.h"
#include "fdb5/database/EntryVisitMechanism.h"
#include "fdb5/database/Index.h"
#include "fdb5/database/Inspector.h"
Expand Down Expand Up @@ -143,7 +143,7 @@ void LocalFDB::print(std::ostream &s) const {


static FDBBuilder<LocalFDB> localFdbBuilder("local");

static FDBBuilder<LocalFDB> builder("catalogue"); // Enable type=catalogue to build localFDB (serverside).
//----------------------------------------------------------------------------------------------------------------------

} // namespace fdb5
10 changes: 6 additions & 4 deletions src/fdb5/api/LocalFDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ class LocalFDB : public FDBBase {

void flush() override;

private: // methods

void print(std::ostream& s) const override;
protected: // methods

template <typename VisitorType, typename ... Ts>
APIIterator<typename VisitorType::ValueType> queryInternal(const FDBToolRequest& request, Ts ... args);

private: // members
private: // methods

void print(std::ostream& s) const override;

protected: // members

std::string home_;

Expand Down
Loading
Loading