Loading src/common/api/admire_types.h +2 −2 Original line number Diff line number Diff line Loading @@ -412,7 +412,7 @@ ADM_dataset_list_destroy(ADM_dataset_list_t list); * * @remark ADM_STORAGEs need to be freed by calling ADM_storage_destroy(). * * @param[in] id An identifier for the storage tier * @param[in] name A name for the storage tier * @param[in] type The type for the storage tier being created. * @param[in] ctx Some specific context information for the storage tier or * NULL if none is required. For instance, an adhoc storage system may find it Loading @@ -420,7 +420,7 @@ ADM_dataset_list_destroy(ADM_dataset_list_t list); * @return A valid ADM_STORAGE if successful, or NULL in case of failure. */ ADM_storage_t ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx); ADM_storage_create(const char* name, ADM_storage_type_t type, void* ctx); /** * Destroy a ADM_STORAGE created by ADM_storage_destroy(). Loading src/common/api/admire_types.hpp +10 −10 Original line number Diff line number Diff line Loading @@ -247,12 +247,12 @@ struct storage { virtual ~ctx() = default; }; storage(storage::type type, std::string user_id); storage(storage::type type, std::string name); virtual ~storage() = default; std::string user_id() const; name() const; type type() const; Loading @@ -260,7 +260,7 @@ struct storage { context() const = 0; protected: std::string m_user_id; std::string m_name; enum type m_type; }; Loading Loading @@ -317,13 +317,13 @@ struct adhoc_storage : public storage { bool m_should_flush; }; adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage(enum storage::type type, std::string name, execution_mode exec_mode, access_type access_type, adhoc_storage::resources res, std::uint32_t walltime, bool should_flush); adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage(enum storage::type type, std::string name, ADM_adhoc_context_t ctx); adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage(enum storage::type type, std::string name, const admire::adhoc_storage::ctx& ctx); adhoc_storage(const adhoc_storage& other) noexcept; Loading @@ -334,10 +334,10 @@ struct adhoc_storage : public storage { operator=(adhoc_storage&&) noexcept; ~adhoc_storage() override; const std::optional<std::uint64_t>& const std::uint64_t& id() const; std::optional<std::uint64_t>& std::uint64_t& id(); std::shared_ptr<storage::ctx> Loading Loading @@ -657,8 +657,8 @@ struct fmt::formatter<admire::adhoc_storage> : formatter<std::string_view> { s.context()); const auto str = fmt::format("{{type: {}, id: {}, user_id: {}, context: {}}}", s.type(), s.id(), std::quoted(s.user_id()), fmt::format("{{type: {}, id: {}, name: {}, context: {}}}", s.type(), s.id(), std::quoted(s.name()), (pctx ? fmt::format("{}", *pctx) : "NULL")); return formatter<std::string_view>::format(str, ctx); } Loading src/common/api/convert.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -113,12 +113,11 @@ convert(const admire::adhoc_storage& st) { convert(*std::static_pointer_cast<admire::adhoc_storage::ctx>( st.context())); ADM_storage_t c_st = ADM_storage_create( st.user_id().c_str(), static_cast<ADM_storage_type_t>(st.type()), st.name().c_str(), static_cast<ADM_storage_type_t>(st.type()), managed_ctx.get()); if(st.id()) { c_st->s_server_id = static_cast<int64_t>(st.id().value()); } // TODO: remove c_st->s_server_id = static_cast<int64_t>(st.id()); return managed_ctype<ADM_storage_t>{c_st, std::move(managed_ctx)}; } Loading src/common/api/types.cpp +26 −26 Original line number Diff line number Diff line Loading @@ -439,7 +439,7 @@ ADM_dataset_list_destroy(ADM_dataset_list_t list) { } ADM_storage_t ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx) { ADM_storage_create(const char* name, ADM_storage_type_t type, void* ctx) { struct adm_storage* adm_storage = (struct adm_storage*) malloc(sizeof(*adm_storage)); Loading @@ -450,7 +450,7 @@ ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx) { return NULL; } if(!id) { if(!name) { LOGGER_ERROR("Null storage id") return NULL; } Loading @@ -460,8 +460,8 @@ ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx) { return NULL; } adm_storage->s_id = (const char*) calloc(strlen(id) + 1, sizeof(char)); strcpy((char*) adm_storage->s_id, id); adm_storage->s_name = (const char*) calloc(strlen(name) + 1, sizeof(char)); strcpy((char*) adm_storage->s_name, name); adm_storage->s_type = type; adm_storage->s_server_id = -1; Loading Loading @@ -518,8 +518,8 @@ ADM_storage_destroy(ADM_storage_t storage) { return ADM_EBADARGS; } if(storage->s_id) { free((void*) storage->s_id); if(storage->s_name) { free((void*) storage->s_name); } switch(storage->s_type) { Loading Loading @@ -798,8 +798,8 @@ ADM_job_requirements_create(ADM_dataset_t inputs[], size_t inputs_len, goto cleanup_on_error; } adm_job_reqs->r_storage = ADM_storage_create(storage->s_id, storage->s_type, storage->s_adhoc_ctx); adm_job_reqs->r_storage = ADM_storage_create( storage->s_name, storage->s_type, storage->s_adhoc_ctx); adm_job_reqs->r_storage->s_server_id = storage->s_server_id; return adm_job_reqs; Loading Loading @@ -1254,12 +1254,12 @@ dataset::id() const { return m_pimpl->id(); } storage::storage(enum storage::type type, std::string user_id) : m_user_id(std::move(user_id)), m_type(type) {} storage::storage(enum storage::type type, std::string name) : m_name(std::move(name)), m_type(type) {} std::string storage::user_id() const { return m_user_id; storage::name() const { return m_name; } enum storage::type Loading Loading @@ -1335,12 +1335,12 @@ public: operator=(impl&&) noexcept = default; ~impl() = default; const std::optional<std::uint64_t>& const std::uint64_t& id() const { return m_id; } std::optional<std::uint64_t>& std::uint64_t& id() { return m_id; } Loading @@ -1351,30 +1351,30 @@ public: } private: std::optional<std::uint64_t> m_id; std::uint64_t m_id; adhoc_storage::ctx m_ctx; }; adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage::adhoc_storage(enum storage::type type, std::string name, execution_mode exec_mode, access_type access_type, adhoc_storage::resources res, std::uint32_t walltime, bool should_flush) : storage(type, std::move(user_id)), : storage(type, std::move(name)), m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ exec_mode, access_type, res, walltime, should_flush})) {} adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage::adhoc_storage(enum storage::type type, std::string name, ADM_adhoc_context_t ctx) : storage(type, std::move(user_id)), : storage(type, std::move(name)), m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ctx})) {} adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage::adhoc_storage(enum storage::type type, std::string name, const adhoc_storage::ctx& ctx) : storage(type, std::move(user_id)), m_pimpl(std::make_unique<impl>(ctx)) {} : storage(type, std::move(name)), m_pimpl(std::make_unique<impl>(ctx)) {} adhoc_storage::adhoc_storage(const adhoc_storage& other) noexcept : storage(other.m_type, other.m_user_id), : storage(other.m_type, other.m_name), m_pimpl(std::make_unique<impl>(*other.m_pimpl)) {} adhoc_storage::adhoc_storage(adhoc_storage&&) noexcept = default; Loading @@ -1388,12 +1388,12 @@ adhoc_storage::operator=(const adhoc_storage& other) noexcept { adhoc_storage& adhoc_storage::operator=(adhoc_storage&&) noexcept = default; const std::optional<std::uint64_t>& const std::uint64_t& adhoc_storage::id() const { return m_pimpl->id(); } std::optional<std::uint64_t>& std::uint64_t& adhoc_storage::id() { return m_pimpl->id(); } Loading @@ -1410,7 +1410,7 @@ pfs_storage::ctx::ctx(std::filesystem::path mount_point) pfs_storage::ctx::ctx(ADM_pfs_context_t ctx) : pfs_storage::ctx(ctx->c_mount) {} pfs_storage::pfs_storage(const pfs_storage& other) noexcept : storage(other.m_type, other.m_user_id), : storage(other.m_type, other.m_name), m_pimpl(std::make_unique<impl>(*other.m_pimpl)) {} pfs_storage& Loading Loading @@ -1493,7 +1493,7 @@ public: // TODO add a conversion constructor m_adhoc_storage = admire::adhoc_storage( static_cast<enum storage::type>(reqs->r_storage->s_type), reqs->r_storage->s_id, reqs->r_storage->s_adhoc_ctx); reqs->r_storage->s_name, reqs->r_storage->s_adhoc_ctx); if(const auto server_id = reqs->r_storage->s_server_id; server_id != -1) { Loading src/common/net/proto/rpc_types.c +2 −2 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ hg_proc_ADM_storage_t(hg_proc_t proc, void* data) { } // 2. the storage id ret = hg_proc_hg_const_string_t(proc, &tmp->s_id); ret = hg_proc_hg_const_string_t(proc, &tmp->s_name); if(ret != HG_SUCCESS) { break; Loading Loading @@ -475,7 +475,7 @@ hg_proc_ADM_storage_t(hg_proc_t proc, void* data) { } // 2. the storage id ret = hg_proc_hg_const_string_t(proc, &tmp->s_id); ret = hg_proc_hg_const_string_t(proc, &tmp->s_name); if(ret != HG_SUCCESS) { break; Loading Loading
src/common/api/admire_types.h +2 −2 Original line number Diff line number Diff line Loading @@ -412,7 +412,7 @@ ADM_dataset_list_destroy(ADM_dataset_list_t list); * * @remark ADM_STORAGEs need to be freed by calling ADM_storage_destroy(). * * @param[in] id An identifier for the storage tier * @param[in] name A name for the storage tier * @param[in] type The type for the storage tier being created. * @param[in] ctx Some specific context information for the storage tier or * NULL if none is required. For instance, an adhoc storage system may find it Loading @@ -420,7 +420,7 @@ ADM_dataset_list_destroy(ADM_dataset_list_t list); * @return A valid ADM_STORAGE if successful, or NULL in case of failure. */ ADM_storage_t ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx); ADM_storage_create(const char* name, ADM_storage_type_t type, void* ctx); /** * Destroy a ADM_STORAGE created by ADM_storage_destroy(). Loading
src/common/api/admire_types.hpp +10 −10 Original line number Diff line number Diff line Loading @@ -247,12 +247,12 @@ struct storage { virtual ~ctx() = default; }; storage(storage::type type, std::string user_id); storage(storage::type type, std::string name); virtual ~storage() = default; std::string user_id() const; name() const; type type() const; Loading @@ -260,7 +260,7 @@ struct storage { context() const = 0; protected: std::string m_user_id; std::string m_name; enum type m_type; }; Loading Loading @@ -317,13 +317,13 @@ struct adhoc_storage : public storage { bool m_should_flush; }; adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage(enum storage::type type, std::string name, execution_mode exec_mode, access_type access_type, adhoc_storage::resources res, std::uint32_t walltime, bool should_flush); adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage(enum storage::type type, std::string name, ADM_adhoc_context_t ctx); adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage(enum storage::type type, std::string name, const admire::adhoc_storage::ctx& ctx); adhoc_storage(const adhoc_storage& other) noexcept; Loading @@ -334,10 +334,10 @@ struct adhoc_storage : public storage { operator=(adhoc_storage&&) noexcept; ~adhoc_storage() override; const std::optional<std::uint64_t>& const std::uint64_t& id() const; std::optional<std::uint64_t>& std::uint64_t& id(); std::shared_ptr<storage::ctx> Loading Loading @@ -657,8 +657,8 @@ struct fmt::formatter<admire::adhoc_storage> : formatter<std::string_view> { s.context()); const auto str = fmt::format("{{type: {}, id: {}, user_id: {}, context: {}}}", s.type(), s.id(), std::quoted(s.user_id()), fmt::format("{{type: {}, id: {}, name: {}, context: {}}}", s.type(), s.id(), std::quoted(s.name()), (pctx ? fmt::format("{}", *pctx) : "NULL")); return formatter<std::string_view>::format(str, ctx); } Loading
src/common/api/convert.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -113,12 +113,11 @@ convert(const admire::adhoc_storage& st) { convert(*std::static_pointer_cast<admire::adhoc_storage::ctx>( st.context())); ADM_storage_t c_st = ADM_storage_create( st.user_id().c_str(), static_cast<ADM_storage_type_t>(st.type()), st.name().c_str(), static_cast<ADM_storage_type_t>(st.type()), managed_ctx.get()); if(st.id()) { c_st->s_server_id = static_cast<int64_t>(st.id().value()); } // TODO: remove c_st->s_server_id = static_cast<int64_t>(st.id()); return managed_ctype<ADM_storage_t>{c_st, std::move(managed_ctx)}; } Loading
src/common/api/types.cpp +26 −26 Original line number Diff line number Diff line Loading @@ -439,7 +439,7 @@ ADM_dataset_list_destroy(ADM_dataset_list_t list) { } ADM_storage_t ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx) { ADM_storage_create(const char* name, ADM_storage_type_t type, void* ctx) { struct adm_storage* adm_storage = (struct adm_storage*) malloc(sizeof(*adm_storage)); Loading @@ -450,7 +450,7 @@ ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx) { return NULL; } if(!id) { if(!name) { LOGGER_ERROR("Null storage id") return NULL; } Loading @@ -460,8 +460,8 @@ ADM_storage_create(const char* id, ADM_storage_type_t type, void* ctx) { return NULL; } adm_storage->s_id = (const char*) calloc(strlen(id) + 1, sizeof(char)); strcpy((char*) adm_storage->s_id, id); adm_storage->s_name = (const char*) calloc(strlen(name) + 1, sizeof(char)); strcpy((char*) adm_storage->s_name, name); adm_storage->s_type = type; adm_storage->s_server_id = -1; Loading Loading @@ -518,8 +518,8 @@ ADM_storage_destroy(ADM_storage_t storage) { return ADM_EBADARGS; } if(storage->s_id) { free((void*) storage->s_id); if(storage->s_name) { free((void*) storage->s_name); } switch(storage->s_type) { Loading Loading @@ -798,8 +798,8 @@ ADM_job_requirements_create(ADM_dataset_t inputs[], size_t inputs_len, goto cleanup_on_error; } adm_job_reqs->r_storage = ADM_storage_create(storage->s_id, storage->s_type, storage->s_adhoc_ctx); adm_job_reqs->r_storage = ADM_storage_create( storage->s_name, storage->s_type, storage->s_adhoc_ctx); adm_job_reqs->r_storage->s_server_id = storage->s_server_id; return adm_job_reqs; Loading Loading @@ -1254,12 +1254,12 @@ dataset::id() const { return m_pimpl->id(); } storage::storage(enum storage::type type, std::string user_id) : m_user_id(std::move(user_id)), m_type(type) {} storage::storage(enum storage::type type, std::string name) : m_name(std::move(name)), m_type(type) {} std::string storage::user_id() const { return m_user_id; storage::name() const { return m_name; } enum storage::type Loading Loading @@ -1335,12 +1335,12 @@ public: operator=(impl&&) noexcept = default; ~impl() = default; const std::optional<std::uint64_t>& const std::uint64_t& id() const { return m_id; } std::optional<std::uint64_t>& std::uint64_t& id() { return m_id; } Loading @@ -1351,30 +1351,30 @@ public: } private: std::optional<std::uint64_t> m_id; std::uint64_t m_id; adhoc_storage::ctx m_ctx; }; adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage::adhoc_storage(enum storage::type type, std::string name, execution_mode exec_mode, access_type access_type, adhoc_storage::resources res, std::uint32_t walltime, bool should_flush) : storage(type, std::move(user_id)), : storage(type, std::move(name)), m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ exec_mode, access_type, res, walltime, should_flush})) {} adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage::adhoc_storage(enum storage::type type, std::string name, ADM_adhoc_context_t ctx) : storage(type, std::move(user_id)), : storage(type, std::move(name)), m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ctx})) {} adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id, adhoc_storage::adhoc_storage(enum storage::type type, std::string name, const adhoc_storage::ctx& ctx) : storage(type, std::move(user_id)), m_pimpl(std::make_unique<impl>(ctx)) {} : storage(type, std::move(name)), m_pimpl(std::make_unique<impl>(ctx)) {} adhoc_storage::adhoc_storage(const adhoc_storage& other) noexcept : storage(other.m_type, other.m_user_id), : storage(other.m_type, other.m_name), m_pimpl(std::make_unique<impl>(*other.m_pimpl)) {} adhoc_storage::adhoc_storage(adhoc_storage&&) noexcept = default; Loading @@ -1388,12 +1388,12 @@ adhoc_storage::operator=(const adhoc_storage& other) noexcept { adhoc_storage& adhoc_storage::operator=(adhoc_storage&&) noexcept = default; const std::optional<std::uint64_t>& const std::uint64_t& adhoc_storage::id() const { return m_pimpl->id(); } std::optional<std::uint64_t>& std::uint64_t& adhoc_storage::id() { return m_pimpl->id(); } Loading @@ -1410,7 +1410,7 @@ pfs_storage::ctx::ctx(std::filesystem::path mount_point) pfs_storage::ctx::ctx(ADM_pfs_context_t ctx) : pfs_storage::ctx(ctx->c_mount) {} pfs_storage::pfs_storage(const pfs_storage& other) noexcept : storage(other.m_type, other.m_user_id), : storage(other.m_type, other.m_name), m_pimpl(std::make_unique<impl>(*other.m_pimpl)) {} pfs_storage& Loading Loading @@ -1493,7 +1493,7 @@ public: // TODO add a conversion constructor m_adhoc_storage = admire::adhoc_storage( static_cast<enum storage::type>(reqs->r_storage->s_type), reqs->r_storage->s_id, reqs->r_storage->s_adhoc_ctx); reqs->r_storage->s_name, reqs->r_storage->s_adhoc_ctx); if(const auto server_id = reqs->r_storage->s_server_id; server_id != -1) { Loading
src/common/net/proto/rpc_types.c +2 −2 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ hg_proc_ADM_storage_t(hg_proc_t proc, void* data) { } // 2. the storage id ret = hg_proc_hg_const_string_t(proc, &tmp->s_id); ret = hg_proc_hg_const_string_t(proc, &tmp->s_name); if(ret != HG_SUCCESS) { break; Loading Loading @@ -475,7 +475,7 @@ hg_proc_ADM_storage_t(hg_proc_t proc, void* data) { } // 2. the storage id ret = hg_proc_hg_const_string_t(proc, &tmp->s_id); ret = hg_proc_hg_const_string_t(proc, &tmp->s_name); if(ret != HG_SUCCESS) { break; Loading