Skip to content

Commit

Permalink
Minor fixes and cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolau-manubens committed May 14, 2024
1 parent c0f7406 commit 02759a5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/fdb5/daos/DaosName.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ const std::string& DaosNameBase::poolName() const {

}

// TODO: containerName, make it longer
// actually DaosContainerName::name()
const std::string& DaosNameBase::containerName() const {

ASSERT(cont_.has_value());
Expand Down
4 changes: 2 additions & 2 deletions src/fdb5/daos/DaosObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ uint64_t DaosArray::write(const void* buf, const uint64_t& len, const eckit::Off
/// RPC and reduce performance. If the read interface is not properly
/// implemented, at least DataHandle::copyTo breaks.
/// @todo: fix this issue by using the "short_read" feature in daos_array_read
/// and returning actual read size.
/// and returning actual read size, rather han having DataHandle::read
/// check the size.
/// @note: see DaosArrayPartHandle for cases where the object size is known.
uint64_t DaosArray::read(void* buf, uint64_t len, const eckit::Offset& off) {

Expand Down Expand Up @@ -284,7 +285,6 @@ uint64_t DaosArray::read(void* buf, uint64_t len, const eckit::Offset& off) {

}

/// @todo: should return a long for consistency with the rest of DaosArray API
uint64_t DaosArray::size() {

open();
Expand Down
2 changes: 1 addition & 1 deletion src/fdb5/daos/DaosSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void DaosManager::error(int code, const char* msg, const char* file, int line, c

void DaosManager::configure(const eckit::LocalConfiguration& config) {

std::lock_guard<std::recursive_mutex> lock(mutex_);
std::lock_guard<std::mutex> lock(mutex_);
containerOidsPerAlloc_ = config.getInt("container_oids_per_alloc", containerOidsPerAlloc_);
objectCreateCellSize_ = config.getInt64("object_create_cell_size", objectCreateCellSize_);
objectCreateChunkSize_ = config.getInt64("object_create_chunk_size", objectCreateChunkSize_);
Expand Down
4 changes: 2 additions & 2 deletions src/fdb5/daos/DaosSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DaosManager : private eckit::NonCopyable {

friend class DaosSession;

std::recursive_mutex mutex_;
std::mutex mutex_;
PoolCache pool_cache_;

/// @note: sets number of OIDs allocated in a single daos_cont_alloc_oids call
Expand Down Expand Up @@ -159,7 +159,7 @@ class DaosSession : eckit::NonCopyable {
private: // members

/// @todo: add lock_guards in all DaosSession methods using pool_cache_. Same for cont_cache_ in DaosPool.
// std::recursive_mutex& mutex_;
// std::mutex& mutex_;
PoolCache& pool_cache_;

};
Expand Down
7 changes: 2 additions & 5 deletions src/fdb5/daos/DaosStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ namespace fdb5 {
//----------------------------------------------------------------------------------------------------------------------

DaosStore::DaosStore(const Schema& schema, const Key& key, const Config& config) :
Store(schema), DaosCommon(config, "store", key), db_str_(db_cont_) {

/// @todo: should assert the store actually exists, as in the constructors of DaosPool etc.

}
Store(schema), DaosCommon(config, "store", key), db_str_(db_cont_) {}

eckit::URI DaosStore::uri() const {

Expand Down Expand Up @@ -89,6 +85,7 @@ std::set<eckit::URI> DaosStore::asCollocatedDataURIs(const std::vector<eckit::UR
std::set<eckit::URI> res;

for (auto& uri : uris)
/// @note: seems redundant, but intends to check validity of input URIs
res.insert(fdb5::DaosName(uri).URI());

return res;
Expand Down

0 comments on commit 02759a5

Please sign in to comment.