Verified Commit c66b64f2 authored by ANA MANZANO RODRIGUEZ's avatar ANA MANZANO RODRIGUEZ Committed by Alberto Miranda
Browse files

Rename id to user_id in public APIs of register_adhoc_storage

parent cd5df869
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -236,12 +236,12 @@ struct storage {
        virtual ~ctx() = default;
    };

    storage(storage::type type, std::string id);
    storage(storage::type type, std::string user_id);

    virtual ~storage() = default;

    std::string
    id() const;
    user_id() const;
    type
    type() const;

@@ -249,7 +249,7 @@ struct storage {
    context() const = 0;

protected:
    std::string m_id;
    std::string m_user_id;
    enum type m_type;
};

+2 −2
Original line number Diff line number Diff line
@@ -72,8 +72,8 @@ 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(
            (std::to_string(st.id())).c_str(),
            static_cast<ADM_storage_type_t>(st.type()), managed_ctx.get());
            st.user_id().c_str(), static_cast<ADM_storage_type_t>(st.type()),
            managed_ctx.get());

    return managed_ctype<ADM_storage_t>{c_st, std::move(managed_ctx)};
}
+12 −13
Original line number Diff line number Diff line
@@ -1058,13 +1058,12 @@ dataset::id() const {
    return m_pimpl->id();
}


storage::storage(enum storage::type type, std::string id)
    : m_id(std::move(id)), m_type(type) {}
storage::storage(enum storage::type type, std::string user_id)
    : m_user_id(std::move(user_id)), m_type(type) {}

std::string
storage::id() const {
    return m_id;
storage::user_id() const {
    return m_user_id;
}

enum storage::type
@@ -1144,25 +1143,25 @@ private:
};


adhoc_storage::adhoc_storage(enum storage::type type, std::string id,
adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id,
                             execution_mode exec_mode, access_type access_type,
                             std::uint32_t nodes, std::uint32_t walltime,
                             bool should_flush)
    : storage(type, std::move(id)),
    : storage(type, std::move(user_id)),
      m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{
              exec_mode, access_type, nodes, walltime, should_flush})) {}

adhoc_storage::adhoc_storage(enum storage::type type, std::string id,
adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id,
                             ADM_adhoc_context_t ctx)
    : storage(type, std::move(id)),
    : storage(type, std::move(user_id)),
      m_pimpl(std::make_unique<impl>(adhoc_storage::ctx{ctx})) {}

adhoc_storage::adhoc_storage(enum storage::type type, std::string id,
adhoc_storage::adhoc_storage(enum storage::type type, std::string user_id,
                             const adhoc_storage::ctx& ctx)
    : storage(type, std::move(id)), m_pimpl(std::make_unique<impl>(ctx)) {}
    : storage(type, std::move(user_id)), m_pimpl(std::make_unique<impl>(ctx)) {}

adhoc_storage::adhoc_storage(const adhoc_storage& other) noexcept
    : storage(other.m_type, other.m_id),
    : storage(other.m_type, other.m_user_id),
      m_pimpl(std::make_unique<impl>(*other.m_pimpl)) {}

adhoc_storage&
@@ -1189,7 +1188,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_id),
    : storage(other.m_type, other.m_user_id),
      m_pimpl(std::make_unique<impl>(*other.m_pimpl)) {}

pfs_storage&
+3 −2
Original line number Diff line number Diff line
@@ -233,10 +233,11 @@ remove_job(const server& srv, const job& job) {
}

admire::adhoc_storage
register_adhoc_storage(const server& srv, const job& job, const std::string& id,
register_adhoc_storage(const server& srv, const job& job,
                       const std::string& user_id,
                       const adhoc_storage::ctx& ctx) {

    const auto rv = detail::register_adhoc_storage(srv, job, id, ctx);
    const auto rv = detail::register_adhoc_storage(srv, job, user_id, ctx);

    if(!rv) {
        throw std::runtime_error(
+3 −3
Original line number Diff line number Diff line
@@ -79,14 +79,14 @@ ADM_remove_job(ADM_server_t server, ADM_job_t job) {
}

ADM_return_t
ADM_register_adhoc_storage(ADM_server_t server, ADM_job_t job, const char* id,
                           ADM_adhoc_context_t ctx,
ADM_register_adhoc_storage(ADM_server_t server, ADM_job_t job,
                           const char* user_id, ADM_adhoc_context_t ctx,
                           ADM_storage_t* adhoc_storage) {

    const admire::server srv{server};

    const auto rv = admire::detail::register_adhoc_storage(
            srv, admire::job{job}, id, admire::adhoc_storage::ctx{ctx});
            srv, admire::job{job}, user_id, admire::adhoc_storage::ctx{ctx});


    if(!rv) {
Loading