Loading src/io/task-info.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,17 @@ task_info::update_status(const task_status st, const urd_error ec, m_sys_error = sc; } urd_error task_info::task_error() const { boost::shared_lock<boost::shared_mutex> lock(m_mutex); return m_task_error; } std::error_code task_info::sys_error() const { return m_sys_error; } std::size_t task_info::sent_bytes() const { boost::shared_lock<boost::shared_mutex> lock(m_mutex); Loading src/io/task-info.hpp +6 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,12 @@ struct task_info { void update_status(const task_status st, const urd_error ec, const std::error_code& sc); urd_error task_error() const; std::error_code sys_error() const; std::size_t sent_bytes() const; std::size_t total_bytes() const; double bandwidth() const; Loading src/io/task.hpp +12 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,12 @@ struct generic_task { return boost::get<TaskType>(m_impl).m_task_info->id(); } case iotask_type::remote_transfer: { using TaskType = io::task<iotask_type::remote_transfer>; return boost::get<TaskType>(m_impl).m_task_info->id(); } default: return static_cast<iotask_id>(0); } Loading Loading @@ -164,6 +170,12 @@ struct generic_task { return boost::get<TaskType>(m_impl).m_task_info; } case iotask_type::remote_transfer: { using TaskType = io::task<iotask_type::remote_transfer>; return boost::get<TaskType>(m_impl).m_task_info; } default: return {}; } Loading src/io/transferors/local-path-to-remote-resource.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -126,9 +126,11 @@ local_path_to_remote_resource_transferor::transfer( task_info->record_transfer(input_data.size(), usecs); LOGGER_DEBUG("Remote request completed with retval {} " LOGGER_DEBUG("Remote request completed with output " "{{status: {}, task_error: {}, sys_errnum: {}}} " "({} bytes, {} usecs)", resp.at(0).retval(), input_data.size(), usecs); resp.at(0).status(), resp.at(0).task_error(), resp.at(0).sys_errnum(), input_data.size(), usecs); return std::make_error_code(static_cast<std::errc>(0)); } Loading src/io/transferors/remote-resource-to-local-path.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include "resources.hpp" #include "auth.hpp" #include "io/task-info.hpp" #include "io/task-stats.hpp" #include "hermes.hpp" #include "rpcs.hpp" #include "remote-resource-to-local-path.hpp" Loading Loading @@ -156,7 +157,10 @@ remote_resource_to_local_path_transferor::transfer( if(ec) { if(req.requires_response()) { m_remote_endpoint->respond<rpc::remote_transfer>( std::move(req), static_cast<uint32_t>(urd_error::snafu));//XXX std::move(req), static_cast<uint32_t>(task_status::finished_with_error), static_cast<uint32_t>(urd_error::system_error), static_cast<uint32_t>(ec.value())); } return ec; } Loading @@ -183,7 +187,10 @@ remote_resource_to_local_path_transferor::transfer( if(req.requires_response()) { m_remote_endpoint->respond<rpc::remote_transfer>( std::move(req), static_cast<uint32_t>(urd_error::success)); std::move(req), static_cast<uint32_t>(task_status::finished), static_cast<uint32_t>(urd_error::success), 0); } }; Loading @@ -202,6 +209,11 @@ remote_resource_to_local_path_transferor::transfer( const std::shared_ptr<data::resource_info>& src_rinfo, const std::shared_ptr<data::resource_info>& dst_rinfo) const { (void) auth; (void) task_info; (void) src_rinfo; (void) dst_rinfo; #if 0 (void) auth; const auto src_backend = task_info->src_backend(); Loading Loading
src/io/task-info.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,17 @@ task_info::update_status(const task_status st, const urd_error ec, m_sys_error = sc; } urd_error task_info::task_error() const { boost::shared_lock<boost::shared_mutex> lock(m_mutex); return m_task_error; } std::error_code task_info::sys_error() const { return m_sys_error; } std::size_t task_info::sent_bytes() const { boost::shared_lock<boost::shared_mutex> lock(m_mutex); Loading
src/io/task-info.hpp +6 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,12 @@ struct task_info { void update_status(const task_status st, const urd_error ec, const std::error_code& sc); urd_error task_error() const; std::error_code sys_error() const; std::size_t sent_bytes() const; std::size_t total_bytes() const; double bandwidth() const; Loading
src/io/task.hpp +12 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,12 @@ struct generic_task { return boost::get<TaskType>(m_impl).m_task_info->id(); } case iotask_type::remote_transfer: { using TaskType = io::task<iotask_type::remote_transfer>; return boost::get<TaskType>(m_impl).m_task_info->id(); } default: return static_cast<iotask_id>(0); } Loading Loading @@ -164,6 +170,12 @@ struct generic_task { return boost::get<TaskType>(m_impl).m_task_info; } case iotask_type::remote_transfer: { using TaskType = io::task<iotask_type::remote_transfer>; return boost::get<TaskType>(m_impl).m_task_info; } default: return {}; } Loading
src/io/transferors/local-path-to-remote-resource.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -126,9 +126,11 @@ local_path_to_remote_resource_transferor::transfer( task_info->record_transfer(input_data.size(), usecs); LOGGER_DEBUG("Remote request completed with retval {} " LOGGER_DEBUG("Remote request completed with output " "{{status: {}, task_error: {}, sys_errnum: {}}} " "({} bytes, {} usecs)", resp.at(0).retval(), input_data.size(), usecs); resp.at(0).status(), resp.at(0).task_error(), resp.at(0).sys_errnum(), input_data.size(), usecs); return std::make_error_code(static_cast<std::errc>(0)); } Loading
src/io/transferors/remote-resource-to-local-path.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include "resources.hpp" #include "auth.hpp" #include "io/task-info.hpp" #include "io/task-stats.hpp" #include "hermes.hpp" #include "rpcs.hpp" #include "remote-resource-to-local-path.hpp" Loading Loading @@ -156,7 +157,10 @@ remote_resource_to_local_path_transferor::transfer( if(ec) { if(req.requires_response()) { m_remote_endpoint->respond<rpc::remote_transfer>( std::move(req), static_cast<uint32_t>(urd_error::snafu));//XXX std::move(req), static_cast<uint32_t>(task_status::finished_with_error), static_cast<uint32_t>(urd_error::system_error), static_cast<uint32_t>(ec.value())); } return ec; } Loading @@ -183,7 +187,10 @@ remote_resource_to_local_path_transferor::transfer( if(req.requires_response()) { m_remote_endpoint->respond<rpc::remote_transfer>( std::move(req), static_cast<uint32_t>(urd_error::success)); std::move(req), static_cast<uint32_t>(task_status::finished), static_cast<uint32_t>(urd_error::success), 0); } }; Loading @@ -202,6 +209,11 @@ remote_resource_to_local_path_transferor::transfer( const std::shared_ptr<data::resource_info>& src_rinfo, const std::shared_ptr<data::resource_info>& dst_rinfo) const { (void) auth; (void) task_info; (void) src_rinfo; (void) dst_rinfo; #if 0 (void) auth; const auto src_backend = task_info->src_backend(); Loading