Release 0.3.2

Solves #31 (closed)

Merge request reports

Loading
+2 −2
Changes for cli/shaping.cpp: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ main(int argc, char* argv[]) {

        if(const auto result = rpc_client.lookup(address); result.has_value()) {
            const auto& endpoint = result.value();
            const auto retval = endpoint.call("bw_shaping", cfg.tid, cfg.shaping);
            const auto retval = endpoint.call("bw_control", cfg.tid, cfg.shaping);

            if(retval.has_value()) {

@@ -100,7 +100,7 @@ main(int argc, char* argv[]) {
                return EXIT_SUCCESS;
            }

            fmt::print(stderr, "bw_shaping RPC failed\n");
            fmt::print(stderr, "bw_control RPC failed\n");
            return EXIT_FAILURE;

        } else {
+3 −0
Changes for etc/cargo.conf.in: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -23,4 +23,7 @@ global_settings: [

  # number of worker threads to serve I/O requests
  workers: 4,

  # Block Size (in kb) for I/O requestss
  blocksize: 512,
]
+12 −3
Changes for lib/cargo.hpp: 12 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -61,12 +61,12 @@ private:
class dataset {

public:
    enum class type { posix, parallel };
    enum class type { posix, parallel, none, gekkofs, hercules, expand, dataclay };

    dataset() noexcept = default;

    explicit dataset(std::string path,
                     dataset::type type = dataset::type::posix) noexcept;
                     dataset::type type = dataset::type::none) noexcept;

    [[nodiscard]] std::string
    path() const noexcept;
@@ -86,7 +86,7 @@ public:

private:
    std::string m_path;
    dataset::type m_type = dataset::type::posix;
    dataset::type m_type = dataset::type::none;
};


@@ -121,6 +121,15 @@ public:
    [[nodiscard]] transfer_status
    status() const;


    /**
     * @brief updates the bw control of the transfer
     * 
     * @param bw_control 
     */
    void
    bw_control (std::int16_t bw_control) const;

    /**
     * Wait for the associated transfer to complete.
     *
+1 −0
Changes for lib/fmt_formatters.hpp: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#define CARGO_FMT_FORMATTERS_HPP

#include <iomanip>
#include <vector>
#include <string_view>
#include <optional>
#include <fmt/format.h>
+37 −2
Changes for lib/libcargo.cpp: 37 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ transfer::status() const {
            const response_type resp{call_rv.value()};
            const auto& [s, bw, ec] = resp.value();

            LOGGER_EVAL(resp.error_code(), INFO, ERROR,
            LOGGER_EVAL(resp.error_code(), ERROR, INFO,
                        "rpc {:>} body: {{retval: {}}} [op_id: {}]", rpc,
                        resp.error_code(), resp.op_id());

@@ -128,6 +128,41 @@ transfer::status() const {
    throw std::runtime_error("rpc lookup failed");
}

void
transfer::bw_control(std::int16_t bw_control) const {

    using proto::generic_response;

    network::client rpc_client{m_srv.protocol()};
    const auto rpc = network::rpc_info::create("bw_control", m_srv.address());
    using response_type = generic_response<error_code>;

    if(const auto lookup_rv = rpc_client.lookup(m_srv.address());
       lookup_rv.has_value()) {
        const auto& endp = lookup_rv.value();

        LOGGER_INFO("rpc {:<} body: {{tid: {}}}", rpc, m_id);

        if(const auto call_rv = endp.call(rpc.name(), m_id, bw_control);
           call_rv.has_value()) {

            const response_type resp{call_rv.value()};

            LOGGER_EVAL(resp.error_code(), ERROR, INFO,
                        "rpc {:>} body: {{retval: {}}} [op_id: {}]", rpc,
                        resp.error_code(), resp.op_id());

            if(resp.error_code()) {
                throw std::runtime_error(
                        fmt::format("rpc call failed: {}", resp.error_code()));
            }
        }
        return;
    }

    throw std::runtime_error("rpc lookup failed");
}

transfer_status::transfer_status(transfer_state status, float bw,
                                 error_code error) noexcept
    : m_state(status), m_bw(bw), m_error(error) {}
@@ -189,7 +224,7 @@ transfer_datasets(const server& srv, const std::vector<dataset>& sources,

            const response_with_id resp{call_rv.value()};

            LOGGER_EVAL(resp.error_code(), INFO, ERROR,
            LOGGER_EVAL(resp.error_code(), ERROR, INFO,
                        "rpc {:>} body: {{retval: {}}} [op_id: {}]", rpc,
                        resp.error_code(), resp.op_id());

Loading
Loading