Commit 06b7dffc authored by Ahmad Tarraf's avatar Ahmad Tarraf
Browse files

client: apply clang-format to mutate-reload changes (#393)

parent fe15ce32
Loading
Loading
Loading
Loading
Loading
+5 −4
Changes for include/client/preload_util.hpp: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -129,10 +129,11 @@ read_hosts_file();
 * index into that vector}
 * @throws std::runtime_error through lookup_endpoint()
 *
 * Pure computation -- does not touch PreloadContext. Callers (init_environment()
 * and reload_client_topology()) are responsible for committing the result via
 * PreloadContext::commit_routing(), together with a distributor built from the
 * same (hosts, local_host_id) pair, so the three never drift out of sync.
 * Pure computation -- does not touch PreloadContext. Callers
 * (init_environment() and reload_client_topology()) are responsible for
 * committing the result via PreloadContext::commit_routing(), together with a
 * distributor built from the same (hosts, local_host_id) pair, so the three
 * never drift out of sync.
 */
std::pair<std::vector<thallium::endpoint>, uint64_t>
connect_to_hosts(const std::vector<std::pair<std::string, std::string>>& hosts);
+2 −2
Changes for src/client/preload.cpp: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -393,8 +393,8 @@ init_environment() {
        LOG(INFO, "{}() Distribution strategy: '{}'", __func__,
            config.get_strategy_string());

        distributor = create_from_config(config, local_host_id,
                                         resolved_hosts.size(),
        distributor =
                create_from_config(config, local_host_id, resolved_hosts.size(),
                                   CTX->fwd_host_id());
        if(!distributor) {
            exit_error_msg(EXIT_FAILURE, "Failed to create distributor");
+5 −4
Changes for src/client/preload_context.cpp: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -379,9 +379,9 @@ PreloadContext::hosts() const {
}

void
PreloadContext::commit_routing(std::vector<thallium::endpoint> hosts,
                               std::shared_ptr<gkfs::rpc::Distributor>
                                       distributor,
PreloadContext::commit_routing(
        std::vector<thallium::endpoint> hosts,
        std::shared_ptr<gkfs::rpc::Distributor> distributor,
        uint64_t local_host_id) {
    auto snapshot = std::make_shared<const RoutingSnapshot>(RoutingSnapshot{
            std::move(hosts), std::move(distributor), local_host_id});
@@ -1254,7 +1254,8 @@ PreloadContext::start_reload_watcher_thread() {
        reload_watcher_stop_.store(false);
        reload_watcher_thread_ =
                std::thread(&PreloadContext::reload_watcher_worker, this);
        LOG(INFO, "Started client-side mutate-reload watcher thread "
        LOG(INFO,
            "Started client-side mutate-reload watcher thread "
            "(signal {}).",
            reload_signal_number());
    }
+3 −6
Changes for src/client/preload_util.cpp: 3 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -736,8 +736,7 @@ reload_client_topology() {
                    fwd_host_id, hosts.size());
        } else {
            gkfs::rpc::DistributionConfig config;
            const char* env_val =
                    std::getenv(gkfs::env::DISTRIBUTION_STRATEGY);
            const char* env_val = std::getenv(gkfs::env::DISTRIBUTION_STRATEGY);
            if(env_val != nullptr && env_val[0] != '\0') {
                config.set_strategy(env_val);
            }
@@ -761,14 +760,12 @@ reload_client_topology() {
                    intervals.push_back(
                            {static_cast<float>(comment.start),
                             static_cast<float>(comment.end),
                             static_cast<gkfs::rpc::host_t>(
                                     comment.host_id)});
                             static_cast<gkfs::rpc::host_t>(comment.host_id)});
                }
                if(rs && !intervals.empty()) {
                    const auto layout =
                            gkfs::malleable::parse_rs_layout_comment(path);
                    const auto hash =
                            gkfs::rpc::interval_table_hash(intervals);
                    const auto hash = gkfs::rpc::interval_table_hash(intervals);
                    if(layout &&
                       (layout->version != 1 || layout->hash != hash)) {
                        throw runtime_error(
+2 −2

File changed.

Contains only whitespace changes.