From aa69d5ffb2ffd554f6ad86040a786cbe5ffe2b7b Mon Sep 17 00:00:00 2001 From: Asias He Date: Fri, 29 Jan 2016 11:44:48 +0800 Subject: [PATCH] streaming: Drop update_progress in stream_coordinator Since we have session_info inside stream_session now, we can call update_progress directly in stream_session. --- streaming/stream_coordinator.hh | 9 --------- streaming/stream_result_future.cc | 1 - streaming/stream_session.cc | 4 +++- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/streaming/stream_coordinator.hh b/streaming/stream_coordinator.hh index ab159fed5e..810d0170f1 100644 --- a/streaming/stream_coordinator.hh +++ b/streaming/stream_coordinator.hh @@ -94,15 +94,6 @@ public: return session; } - void update_progress(progress_info info) { - auto peer = info.peer; - auto it = _peer_sessions.find(peer); - if (it == _peer_sessions.end()) { - throw std::runtime_error(sprint("Unknown peer requested: %s", peer)); - } - it->second->update_progress(info); - } - std::vector get_all_session_info(); std::vector get_peer_session_info(inet_address peer); diff --git a/streaming/stream_result_future.cc b/streaming/stream_result_future.cc index 107ff3eb8b..5f01d62166 100644 --- a/streaming/stream_result_future.cc +++ b/streaming/stream_result_future.cc @@ -131,7 +131,6 @@ stream_state stream_result_future::get_current_state() { } void stream_result_future::handle_progress(progress_info progress) { - _coordinator->update_progress(progress); fire_stream_event(progress_event(plan_id, std::move(progress))); } diff --git a/streaming/stream_session.cc b/streaming/stream_session.cc index 8785ac2d9f..09975f7c2f 100644 --- a/streaming/stream_session.cc +++ b/streaming/stream_session.cc @@ -388,7 +388,9 @@ void stream_session::progress(UUID cf_id, progress_info::direction dir, size_t f // FIXME: we can not estimate total number of bytes for a // stream_transfer_task or stream_receive_task, since we don't know the // size of the frozen_mutation until we read it. - _stream_result->handle_progress(progress_info(peer, cf_id.to_sstring(), dir, bytes, bytes)); + progress_info progress(peer, cf_id.to_sstring(), dir, bytes, bytes); + update_progress(progress); + _stream_result->handle_progress(progress); } void stream_session::received(UUID cf_id, int sequence_number) {