From 19d6029f5dfe27dd5535ddb481af5a3b0693df59 Mon Sep 17 00:00:00 2001 From: Igor Gaponenko Date: Tue, 13 Jun 2023 14:51:58 -0700 Subject: [PATCH] Moved the SSI request classes into a dedicated module xrdreq --- src/CMakeLists.txt | 2 + src/ccontrol/CMakeLists.txt | 1 + src/qana/CMakeLists.txt | 1 + src/qdisp/CMakeLists.txt | 1 + src/qproc/CMakeLists.txt | 1 + src/query/CMakeLists.txt | 1 + src/replica/AddReplicaQservMgtRequest.cc | 14 +-- src/replica/AddReplicaQservMgtRequest.h | 4 +- src/replica/CMakeLists.txt | 5 +- src/replica/GetReplicasQservMgtRequest.cc | 14 +-- src/replica/GetReplicasQservMgtRequest.h | 6 +- src/replica/GetStatusQservMgtRequest.cc | 12 +-- src/replica/GetStatusQservMgtRequest.h | 4 +- src/replica/RemoveReplicaQservMgtRequest.cc | 14 +-- src/replica/RemoveReplicaQservMgtRequest.h | 4 +- src/replica/SetReplicasQservMgtRequest.cc | 22 ++--- src/replica/SetReplicasQservMgtRequest.h | 6 +- src/replica/TestEchoQservMgtRequest.cc | 10 +- src/replica/TestEchoQservMgtRequest.h | 4 +- src/rproc/CMakeLists.txt | 1 + src/wpublish/CMakeLists.txt | 30 ------ src/xrdreq/CMakeLists.txt | 52 ++++++++++ .../ChunkGroupQservRequest.cc | 18 ++-- .../ChunkGroupQservRequest.h | 12 +-- .../ChunkListQservRequest.cc | 14 +-- .../ChunkListQservRequest.h | 12 +-- .../GetChunkListQservRequest.cc | 14 +-- .../GetChunkListQservRequest.h | 12 +-- .../GetStatusQservRequest.cc | 8 +- .../GetStatusQservRequest.h | 12 +-- src/{wpublish => xrdreq}/QservRequest.cc | 8 +- src/{wpublish => xrdreq}/QservRequest.h | 10 +- .../QueryManagementAction.cc | 16 +-- .../QueryManagementAction.h | 10 +- .../QueryManagementRequest.cc | 8 +- .../QueryManagementRequest.h | 12 +-- .../SetChunkListQservRequest.cc | 18 ++-- .../SetChunkListQservRequest.h | 12 +-- .../TestEchoQservRequest.cc | 14 +-- .../TestEchoQservRequest.h | 12 +-- .../qserv-query-management.cc | 16 +-- .../qserv-worker-notify.cc | 99 +++++++++---------- .../qserv-worker-perf-chunks.cc | 6 +- src/{wpublish => xrdreq}/qserv-worker-perf.cc | 24 +++-- .../qserv-worker-status.cc | 22 ++--- 45 files changed, 314 insertions(+), 284 deletions(-) create mode 100644 src/xrdreq/CMakeLists.txt rename src/{wpublish => xrdreq}/ChunkGroupQservRequest.cc (91%) rename src/{wpublish => xrdreq}/ChunkGroupQservRequest.h (95%) rename src/{wpublish => xrdreq}/ChunkListQservRequest.cc (93%) rename src/{wpublish => xrdreq}/ChunkListQservRequest.h (95%) rename src/{wpublish => xrdreq}/GetChunkListQservRequest.cc (91%) rename src/{wpublish => xrdreq}/GetChunkListQservRequest.h (92%) rename src/{wpublish => xrdreq}/GetStatusQservRequest.cc (95%) rename src/{wpublish => xrdreq}/GetStatusQservRequest.h (92%) rename src/{wpublish => xrdreq}/QservRequest.cc (97%) rename src/{wpublish => xrdreq}/QservRequest.h (95%) rename src/{wpublish => xrdreq}/QueryManagementAction.cc (91%) rename src/{wpublish => xrdreq}/QueryManagementAction.h (93%) rename src/{wpublish => xrdreq}/QueryManagementRequest.cc (94%) rename src/{wpublish => xrdreq}/QueryManagementRequest.h (92%) rename src/{wpublish => xrdreq}/SetChunkListQservRequest.cc (90%) rename src/{wpublish => xrdreq}/SetChunkListQservRequest.h (93%) rename src/{wpublish => xrdreq}/TestEchoQservRequest.cc (91%) rename src/{wpublish => xrdreq}/TestEchoQservRequest.h (92%) rename src/{wpublish => xrdreq}/qserv-query-management.cc (89%) rename src/{wpublish => xrdreq}/qserv-worker-notify.cc (73%) rename src/{wpublish => xrdreq}/qserv-worker-perf-chunks.cc (99%) rename src/{wpublish => xrdreq}/qserv-worker-perf.cc (85%) rename src/{wpublish => xrdreq}/qserv-worker-status.cc (87%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 59ebe896c0..c4ce354f95 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -74,6 +74,7 @@ add_subdirectory(wpublish) add_subdirectory(wsched) add_subdirectory(www) add_subdirectory(xrdlog) +add_subdirectory(xrdreq) add_subdirectory(xrdsvc) #----------------------------------------------------------------------------- @@ -127,6 +128,7 @@ target_link_libraries(qserv_czar PUBLIC rproc qserv_css qserv_meta + xrdreq ) install( diff --git a/src/ccontrol/CMakeLists.txt b/src/ccontrol/CMakeLists.txt index 18805d2cdd..91803fca81 100644 --- a/src/ccontrol/CMakeLists.txt +++ b/src/ccontrol/CMakeLists.txt @@ -45,6 +45,7 @@ FUNCTION(ccontrol_tests) qserv_meta query rproc + xrdreq Boost::unit_test_framework Threads::Threads ) diff --git a/src/qana/CMakeLists.txt b/src/qana/CMakeLists.txt index 11945e532e..ccf5634e4c 100644 --- a/src/qana/CMakeLists.txt +++ b/src/qana/CMakeLists.txt @@ -35,6 +35,7 @@ FUNCTION(qana_tests) qserv_css qserv_meta rproc + xrdreq Boost::unit_test_framework Threads::Threads ) diff --git a/src/qdisp/CMakeLists.txt b/src/qdisp/CMakeLists.txt index f4c4f7e0e6..1f34bdd971 100644 --- a/src/qdisp/CMakeLists.txt +++ b/src/qdisp/CMakeLists.txt @@ -41,6 +41,7 @@ target_link_libraries(testQDisp qserv_meta query rproc + xrdreq Boost::unit_test_framework Threads::Threads ) diff --git a/src/qproc/CMakeLists.txt b/src/qproc/CMakeLists.txt index bf1aa04511..1a022694f6 100644 --- a/src/qproc/CMakeLists.txt +++ b/src/qproc/CMakeLists.txt @@ -30,6 +30,7 @@ FUNCTION(qproc_tests) qserv_css qserv_meta rproc + xrdreq Boost::unit_test_framework Threads::Threads ) diff --git a/src/query/CMakeLists.txt b/src/query/CMakeLists.txt index 28a5207e9f..90c351aad2 100644 --- a/src/query/CMakeLists.txt +++ b/src/query/CMakeLists.txt @@ -59,6 +59,7 @@ FUNCTION(query_tests) qserv_meta query rproc + xrdreq Boost::unit_test_framework Threads::Threads ) diff --git a/src/replica/AddReplicaQservMgtRequest.cc b/src/replica/AddReplicaQservMgtRequest.cc index a2f79d66b3..80458cba0d 100644 --- a/src/replica/AddReplicaQservMgtRequest.cc +++ b/src/replica/AddReplicaQservMgtRequest.cc @@ -73,9 +73,9 @@ list> AddReplicaQservMgtRequest::extendedPersistentState() void AddReplicaQservMgtRequest::startImpl(replica::Lock const& lock) { auto const request = shared_from_base(); - _qservRequest = wpublish::AddChunkGroupQservRequest::create( + _qservRequest = xrdreq::AddChunkGroupQservRequest::create( chunk(), databases(), - [request](wpublish::ChunkGroupQservRequest::Status status, string const& error) { + [request](xrdreq::ChunkGroupQservRequest::Status status, string const& error) { if (request->state() == State::FINISHED) return; replica::Lock lock(request->_mtx, request->context() + string(__func__) + "[callback]"); @@ -83,26 +83,26 @@ void AddReplicaQservMgtRequest::startImpl(replica::Lock const& lock) { if (request->state() == State::FINISHED) return; switch (status) { - case wpublish::ChunkGroupQservRequest::Status::SUCCESS: + case xrdreq::ChunkGroupQservRequest::Status::SUCCESS: request->finish(lock, QservMgtRequest::ExtendedState::SUCCESS); break; - case wpublish::ChunkGroupQservRequest::Status::INVALID: + case xrdreq::ChunkGroupQservRequest::Status::INVALID: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_BAD, error); break; - case wpublish::ChunkGroupQservRequest::Status::IN_USE: + case xrdreq::ChunkGroupQservRequest::Status::IN_USE: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_CHUNK_IN_USE, error); break; - case wpublish::ChunkGroupQservRequest::Status::ERROR: + case xrdreq::ChunkGroupQservRequest::Status::ERROR: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_ERROR, error); break; default: throw logic_error("AddReplicaQservMgtRequest::" + string(__func__) + " unhandled server status: " + - wpublish::ChunkGroupQservRequest::status2str(status)); + xrdreq::ChunkGroupQservRequest::status2str(status)); } }); XrdSsiResource resource(ResourceUnit::makeWorkerPath(worker())); diff --git a/src/replica/AddReplicaQservMgtRequest.h b/src/replica/AddReplicaQservMgtRequest.h index da45ebc1de..ba1c3b5509 100644 --- a/src/replica/AddReplicaQservMgtRequest.h +++ b/src/replica/AddReplicaQservMgtRequest.h @@ -29,7 +29,7 @@ // Qserv headers #include "replica/QservMgtRequest.h" #include "replica/ServiceProvider.h" -#include "wpublish/ChunkGroupQservRequest.h" +#include "xrdreq/ChunkGroupQservRequest.h" // This header declarations @@ -101,7 +101,7 @@ class AddReplicaQservMgtRequest : public QservMgtRequest { CallbackType _onFinish; /// @note is reset when the request finishes /// A request to the remote services - wpublish::AddChunkGroupQservRequest::Ptr _qservRequest; + xrdreq::AddChunkGroupQservRequest::Ptr _qservRequest; }; } // namespace lsst::qserv::replica diff --git a/src/replica/CMakeLists.txt b/src/replica/CMakeLists.txt index ba4920e643..cd9163d188 100644 --- a/src/replica/CMakeLists.txt +++ b/src/replica/CMakeLists.txt @@ -463,6 +463,7 @@ target_include_directories(replica PRIVATE target_link_libraries(replica PUBLIC qserv_css + xrdreq xrdsvc XrdCl XrdSsiLib @@ -483,7 +484,9 @@ FUNCTION(REPLICA_UTILS) add_executable(${UTIL}) target_sources(${UTIL} PRIVATE tools/${UTIL}.cc) target_include_directories(${UTIL} PRIVATE ${XROOTD_INCLUDE_DIRS}) - target_link_libraries(${UTIL} PRIVATE replica) + target_link_libraries(${UTIL} PRIVATE + replica + ) install(TARGETS ${UTIL}) ENDFOREACH() ENDFUNCTION() diff --git a/src/replica/GetReplicasQservMgtRequest.cc b/src/replica/GetReplicasQservMgtRequest.cc index 36f230b0c1..6b10a39fab 100644 --- a/src/replica/GetReplicasQservMgtRequest.cc +++ b/src/replica/GetReplicasQservMgtRequest.cc @@ -80,7 +80,7 @@ list> GetReplicasQservMgtRequest::extendedPersistentState() } void GetReplicasQservMgtRequest::_setReplicas( - replica::Lock const& lock, wpublish::GetChunkListQservRequest::ChunkCollection const& collection) { + replica::Lock const& lock, xrdreq::GetChunkListQservRequest::ChunkCollection const& collection) { // Filter results by databases participating in the family set databases; @@ -111,9 +111,9 @@ void GetReplicasQservMgtRequest::startImpl(replica::Lock const& lock) { auto const request = shared_from_base(); - _qservRequest = wpublish::GetChunkListQservRequest::create( - inUseOnly(), [request](wpublish::GetChunkListQservRequest::Status status, string const& error, - wpublish::GetChunkListQservRequest::ChunkCollection const& collection) { + _qservRequest = xrdreq::GetChunkListQservRequest::create( + inUseOnly(), [request](xrdreq::GetChunkListQservRequest::Status status, string const& error, + xrdreq::GetChunkListQservRequest::ChunkCollection const& collection) { if (request->state() == State::FINISHED) return; replica::Lock lock(request->_mtx, request->context() + string(__func__) + "[callback]"); @@ -121,13 +121,13 @@ void GetReplicasQservMgtRequest::startImpl(replica::Lock const& lock) { if (request->state() == State::FINISHED) return; switch (status) { - case wpublish::GetChunkListQservRequest::Status::SUCCESS: + case xrdreq::GetChunkListQservRequest::Status::SUCCESS: request->_setReplicas(lock, collection); request->finish(lock, QservMgtRequest::ExtendedState::SUCCESS); break; - case wpublish::GetChunkListQservRequest::Status::ERROR: + case xrdreq::GetChunkListQservRequest::Status::ERROR: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_ERROR, error); break; @@ -135,7 +135,7 @@ void GetReplicasQservMgtRequest::startImpl(replica::Lock const& lock) { default: throw logic_error("GetReplicasQservMgtRequest::" + string(__func__) + " unhandled server status: " + - wpublish::GetChunkListQservRequest::status2str(status)); + xrdreq::GetChunkListQservRequest::status2str(status)); } }); XrdSsiResource resource(ResourceUnit::makeWorkerPath(worker())); diff --git a/src/replica/GetReplicasQservMgtRequest.h b/src/replica/GetReplicasQservMgtRequest.h index b8864e1719..508bf75cc7 100644 --- a/src/replica/GetReplicasQservMgtRequest.h +++ b/src/replica/GetReplicasQservMgtRequest.h @@ -30,7 +30,7 @@ #include "replica/QservMgtRequest.h" #include "replica/ReplicaInfo.h" #include "replica/ServiceProvider.h" -#include "wpublish/GetChunkListQservRequest.h" +#include "xrdreq/GetChunkListQservRequest.h" // This header declarations namespace lsst::qserv::replica { @@ -109,7 +109,7 @@ class GetReplicasQservMgtRequest : public QservMgtRequest { * @param collection The input collection of replicas. */ void _setReplicas(replica::Lock const& lock, - wpublish::GetChunkListQservRequest::ChunkCollection const& collection); + xrdreq::GetChunkListQservRequest::ChunkCollection const& collection); // Input parameters @@ -118,7 +118,7 @@ class GetReplicasQservMgtRequest : public QservMgtRequest { CallbackType _onFinish; /// @note is reset when the request finishes /// A request to the remote services - wpublish::GetChunkListQservRequest::Ptr _qservRequest; + xrdreq::GetChunkListQservRequest::Ptr _qservRequest; /// A collection of replicas reported by the Qserr worker QservReplicaCollection _replicas; diff --git a/src/replica/GetStatusQservMgtRequest.cc b/src/replica/GetStatusQservMgtRequest.cc index aa3483a580..ba43289a61 100644 --- a/src/replica/GetStatusQservMgtRequest.cc +++ b/src/replica/GetStatusQservMgtRequest.cc @@ -79,15 +79,15 @@ list> GetStatusQservMgtRequest::extendedPersistentState() c void GetStatusQservMgtRequest::startImpl(replica::Lock const& lock) { auto const request = shared_from_base(); - _qservRequest = wpublish::GetStatusQservRequest::create( - _taskSelector, [request](wpublish::GetStatusQservRequest::Status status, string const& error, - string const& info) { + _qservRequest = xrdreq::GetStatusQservRequest::create( + _taskSelector, + [request](xrdreq::GetStatusQservRequest::Status status, string const& error, string const& info) { if (request->state() == State::FINISHED) return; replica::Lock const lock(request->_mtx, request->context() + string(__func__) + "[callback]"); if (request->state() == State::FINISHED) return; switch (status) { - case wpublish::GetStatusQservRequest::Status::SUCCESS: + case xrdreq::GetStatusQservRequest::Status::SUCCESS: try { request->_setInfo(lock, info); request->finish(lock, QservMgtRequest::ExtendedState::SUCCESS); @@ -98,13 +98,13 @@ void GetStatusQservMgtRequest::startImpl(replica::Lock const& lock) { request->finish(lock, QservMgtRequest::ExtendedState::SERVER_BAD_RESPONSE, msg); } break; - case wpublish::GetStatusQservRequest::Status::ERROR: + case xrdreq::GetStatusQservRequest::Status::ERROR: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_ERROR, error); break; default: throw logic_error("GetStatusQservMgtRequest::" + string(__func__) + " unhandled server status: " + - wpublish::GetStatusQservRequest::status2str(status)); + xrdreq::GetStatusQservRequest::status2str(status)); } }); XrdSsiResource resource(ResourceUnit::makeWorkerPath(worker())); diff --git a/src/replica/GetStatusQservMgtRequest.h b/src/replica/GetStatusQservMgtRequest.h index ca9a6e5e8b..4242906d53 100644 --- a/src/replica/GetStatusQservMgtRequest.h +++ b/src/replica/GetStatusQservMgtRequest.h @@ -33,7 +33,7 @@ #include "replica/QservMgtRequest.h" #include "replica/ServiceProvider.h" #include "wbase/TaskState.h" -#include "wpublish/GetStatusQservRequest.h" +#include "xrdreq/GetStatusQservRequest.h" // This header declarations namespace lsst::qserv::replica { @@ -109,7 +109,7 @@ class GetStatusQservMgtRequest : public QservMgtRequest { CallbackType _onFinish; ///< this object is reset after finishing the request /// A request to the remote services - wpublish::GetStatusQservRequest::Ptr _qservRequest; + xrdreq::GetStatusQservRequest::Ptr _qservRequest; /// The info object returned by the Qserv worker nlohmann::json _info; diff --git a/src/replica/RemoveReplicaQservMgtRequest.cc b/src/replica/RemoveReplicaQservMgtRequest.cc index 2d89b2f14e..83e4de4f30 100644 --- a/src/replica/RemoveReplicaQservMgtRequest.cc +++ b/src/replica/RemoveReplicaQservMgtRequest.cc @@ -76,9 +76,9 @@ list> RemoveReplicaQservMgtRequest::extendedPersistentState void RemoveReplicaQservMgtRequest::startImpl(replica::Lock const& lock) { auto const request = shared_from_base(); - _qservRequest = wpublish::RemoveChunkGroupQservRequest::create( + _qservRequest = xrdreq::RemoveChunkGroupQservRequest::create( chunk(), databases(), force(), - [request](wpublish::ChunkGroupQservRequest::Status status, string const& error) { + [request](xrdreq::ChunkGroupQservRequest::Status status, string const& error) { if (request->state() == State::FINISHED) return; replica::Lock lock(request->_mtx, request->context() + string(__func__) + "[callback]"); @@ -86,26 +86,26 @@ void RemoveReplicaQservMgtRequest::startImpl(replica::Lock const& lock) { if (request->state() == State::FINISHED) return; switch (status) { - case wpublish::ChunkGroupQservRequest::Status::SUCCESS: + case xrdreq::ChunkGroupQservRequest::Status::SUCCESS: request->finish(lock, QservMgtRequest::ExtendedState::SUCCESS); break; - case wpublish::ChunkGroupQservRequest::Status::INVALID: + case xrdreq::ChunkGroupQservRequest::Status::INVALID: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_BAD, error); break; - case wpublish::ChunkGroupQservRequest::Status::IN_USE: + case xrdreq::ChunkGroupQservRequest::Status::IN_USE: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_CHUNK_IN_USE, error); break; - case wpublish::ChunkGroupQservRequest::Status::ERROR: + case xrdreq::ChunkGroupQservRequest::Status::ERROR: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_ERROR, error); break; default: throw logic_error("RemoveReplicaQservMgtRequest::" + string(__func__) + " unhandled server status: " + - wpublish::ChunkGroupQservRequest::status2str(status)); + xrdreq::ChunkGroupQservRequest::status2str(status)); } }); XrdSsiResource resource(ResourceUnit::makeWorkerPath(worker())); diff --git a/src/replica/RemoveReplicaQservMgtRequest.h b/src/replica/RemoveReplicaQservMgtRequest.h index d6a06c6518..77f4a379a4 100644 --- a/src/replica/RemoveReplicaQservMgtRequest.h +++ b/src/replica/RemoveReplicaQservMgtRequest.h @@ -29,7 +29,7 @@ // Qserv headers #include "replica/QservMgtRequest.h" #include "replica/ServiceProvider.h" -#include "wpublish/ChunkGroupQservRequest.h" +#include "xrdreq/ChunkGroupQservRequest.h" // This header declarations namespace lsst::qserv::replica { @@ -107,7 +107,7 @@ class RemoveReplicaQservMgtRequest : public QservMgtRequest { CallbackType _onFinish; /// A request to the remote services - wpublish::RemoveChunkGroupQservRequest::Ptr _qservRequest; + xrdreq::RemoveChunkGroupQservRequest::Ptr _qservRequest; }; } // namespace lsst::qserv::replica diff --git a/src/replica/SetReplicasQservMgtRequest.cc b/src/replica/SetReplicasQservMgtRequest.cc index e031ab67d3..f5badd1f95 100644 --- a/src/replica/SetReplicasQservMgtRequest.cc +++ b/src/replica/SetReplicasQservMgtRequest.cc @@ -88,7 +88,7 @@ list> SetReplicasQservMgtRequest::extendedPersistentState() } void SetReplicasQservMgtRequest::_setReplicas( - replica::Lock const& lock, wpublish::SetChunkListQservRequest::ChunkCollection const& collection) { + replica::Lock const& lock, xrdreq::SetChunkListQservRequest::ChunkCollection const& collection) { _replicas.clear(); for (auto&& replica : collection) { _replicas.push_back(QservReplica{replica.chunk, replica.database, replica.use_count}); @@ -96,18 +96,18 @@ void SetReplicasQservMgtRequest::_setReplicas( } void SetReplicasQservMgtRequest::startImpl(replica::Lock const& lock) { - wpublish::SetChunkListQservRequest::ChunkCollection chunks; + xrdreq::SetChunkListQservRequest::ChunkCollection chunks; for (auto&& chunkEntry : newReplicas()) { - chunks.push_back(wpublish::SetChunkListQservRequest::Chunk{ + chunks.push_back(xrdreq::SetChunkListQservRequest::Chunk{ chunkEntry.chunk, chunkEntry.database, 0 /* UNUSED: use_count */ }); } auto const request = shared_from_base(); - _qservRequest = wpublish::SetChunkListQservRequest::create( + _qservRequest = xrdreq::SetChunkListQservRequest::create( chunks, _databases, force(), - [request](wpublish::SetChunkListQservRequest::Status status, string const& error, - wpublish::SetChunkListQservRequest::ChunkCollection const& collection) { + [request](xrdreq::SetChunkListQservRequest::Status status, string const& error, + xrdreq::SetChunkListQservRequest::ChunkCollection const& collection) { if (request->state() == State::FINISHED) return; replica::Lock lock(request->_mtx, request->context() + string(__func__) + "[callback]"); @@ -115,27 +115,27 @@ void SetReplicasQservMgtRequest::startImpl(replica::Lock const& lock) { if (request->state() == State::FINISHED) return; switch (status) { - case wpublish::SetChunkListQservRequest::Status::SUCCESS: + case xrdreq::SetChunkListQservRequest::Status::SUCCESS: request->_setReplicas(lock, collection); request->finish(lock, QservMgtRequest::ExtendedState::SUCCESS); break; - case wpublish::SetChunkListQservRequest::Status::ERROR: + case xrdreq::SetChunkListQservRequest::Status::ERROR: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_ERROR, error); break; - case wpublish::SetChunkListQservRequest::Status::INVALID: + case xrdreq::SetChunkListQservRequest::Status::INVALID: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_BAD, error); break; - case wpublish::SetChunkListQservRequest::Status::IN_USE: + case xrdreq::SetChunkListQservRequest::Status::IN_USE: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_CHUNK_IN_USE, error); break; default: throw logic_error("SetReplicasQservMgtRequest:: " + string(__func__) + " unhandled server status: " + - wpublish::SetChunkListQservRequest::status2str(status)); + xrdreq::SetChunkListQservRequest::status2str(status)); } }); XrdSsiResource resource(ResourceUnit::makeWorkerPath(worker())); diff --git a/src/replica/SetReplicasQservMgtRequest.h b/src/replica/SetReplicasQservMgtRequest.h index 49b9057b94..4da0d1d595 100644 --- a/src/replica/SetReplicasQservMgtRequest.h +++ b/src/replica/SetReplicasQservMgtRequest.h @@ -30,7 +30,7 @@ #include "replica/QservMgtRequest.h" #include "replica/ReplicaInfo.h" #include "replica/ServiceProvider.h" -#include "wpublish/SetChunkListQservRequest.h" +#include "xrdreq/SetChunkListQservRequest.h" // This header declarations namespace lsst::qserv::replica { @@ -109,7 +109,7 @@ class SetReplicasQservMgtRequest : public QservMgtRequest { * @param collection The input collection of replicas. */ void _setReplicas(replica::Lock const& lock, - wpublish::SetChunkListQservRequest::ChunkCollection const& collection); + xrdreq::SetChunkListQservRequest::ChunkCollection const& collection); // Input parameters. @@ -120,7 +120,7 @@ class SetReplicasQservMgtRequest : public QservMgtRequest { CallbackType _onFinish; /// A request to the remote services. - wpublish::SetChunkListQservRequest::Ptr _qservRequest; + xrdreq::SetChunkListQservRequest::Ptr _qservRequest; /// A collection of replicas reported by the Qserv worker. QservReplicaCollection _replicas; diff --git a/src/replica/TestEchoQservMgtRequest.cc b/src/replica/TestEchoQservMgtRequest.cc index 04f4c48aad..b84988de56 100644 --- a/src/replica/TestEchoQservMgtRequest.cc +++ b/src/replica/TestEchoQservMgtRequest.cc @@ -78,8 +78,8 @@ void TestEchoQservMgtRequest::startImpl(replica::Lock const& lock) { auto const request = shared_from_base(); - _qservRequest = wpublish::TestEchoQservRequest::create( - data(), [request](wpublish::TestEchoQservRequest::Status status, string const& error, + _qservRequest = xrdreq::TestEchoQservRequest::create( + data(), [request](xrdreq::TestEchoQservRequest::Status status, string const& error, string const& data, string const& dataEcho) { if (request->state() == State::FINISHED) return; @@ -88,13 +88,13 @@ void TestEchoQservMgtRequest::startImpl(replica::Lock const& lock) { if (request->state() == State::FINISHED) return; switch (status) { - case wpublish::TestEchoQservRequest::Status::SUCCESS: + case xrdreq::TestEchoQservRequest::Status::SUCCESS: request->_setData(lock, dataEcho); request->finish(lock, QservMgtRequest::ExtendedState::SUCCESS); break; - case wpublish::TestEchoQservRequest::Status::ERROR: + case xrdreq::TestEchoQservRequest::Status::ERROR: request->finish(lock, QservMgtRequest::ExtendedState::SERVER_ERROR, error); break; @@ -102,7 +102,7 @@ void TestEchoQservMgtRequest::startImpl(replica::Lock const& lock) { default: throw logic_error("TestEchoQservMgtRequest::" + string(__func__) + " unhandled server status: " + - wpublish::TestEchoQservRequest::status2str(status)); + xrdreq::TestEchoQservRequest::status2str(status)); } }); XrdSsiResource resource(ResourceUnit::makeWorkerPath(worker())); diff --git a/src/replica/TestEchoQservMgtRequest.h b/src/replica/TestEchoQservMgtRequest.h index 4bbdd6bae0..ba0113bcce 100644 --- a/src/replica/TestEchoQservMgtRequest.h +++ b/src/replica/TestEchoQservMgtRequest.h @@ -29,7 +29,7 @@ // Qserv headers #include "replica/QservMgtRequest.h" #include "replica/ServiceProvider.h" -#include "wpublish/TestEchoQservRequest.h" +#include "xrdreq/TestEchoQservRequest.h" // This header declarations namespace lsst::qserv::replica { @@ -107,7 +107,7 @@ class TestEchoQservMgtRequest : public QservMgtRequest { CallbackType _onFinish; ///< @note this object is reset after finishing the request /// A request to the remote services - wpublish::TestEchoQservRequest::Ptr _qservRequest; + xrdreq::TestEchoQservRequest::Ptr _qservRequest; /// The data string returned by the Qserv worker std::string _dataEcho; diff --git a/src/rproc/CMakeLists.txt b/src/rproc/CMakeLists.txt index 98c8e7a4b4..91910dd95e 100644 --- a/src/rproc/CMakeLists.txt +++ b/src/rproc/CMakeLists.txt @@ -28,6 +28,7 @@ FUNCTION(rproc_tests) qserv_css qserv_meta rproc + xrdreq Boost::unit_test_framework Threads::Threads ) diff --git a/src/wpublish/CMakeLists.txt b/src/wpublish/CMakeLists.txt index 3d76fd102c..985020656e 100644 --- a/src/wpublish/CMakeLists.txt +++ b/src/wpublish/CMakeLists.txt @@ -3,24 +3,15 @@ add_dependencies(wpublish proto) target_sources(wpublish PRIVATE AddChunkGroupCommand.cc - ChunkGroupQservRequest.cc ChunkInventory.cc ChunkListCommand.cc - ChunkListQservRequest.cc GetChunkListCommand.cc - GetChunkListQservRequest.cc GetStatusCommand.cc - GetStatusQservRequest.cc - QservRequest.cc QueriesAndChunks.cc - QueryManagementAction.cc - QueryManagementRequest.cc RemoveChunkGroupCommand.cc ResourceMonitor.cc SetChunkListCommand.cc - SetChunkListQservRequest.cc TestEchoCommand.cc - TestEchoQservRequest.cc ) target_include_directories(wpublish PRIVATE @@ -45,27 +36,6 @@ target_link_libraries(testChunkInventory PUBLIC add_test(NAME testChunkInventory COMMAND testChunkInventory) - -FUNCTION(WPUBLISH_UTILS) - FOREACH(UTIL IN ITEMS ${ARGV}) - add_executable(${UTIL}) - target_sources(${UTIL} PRIVATE ${UTIL}.cc) - target_include_directories(${UTIL} PRIVATE ${XROOTD_INCLUDE_DIRS}) - target_link_libraries(${UTIL} PRIVATE - crypto - pthread - util - wpublish - xrdsvc - ) - install(TARGETS ${UTIL}) - ENDFOREACH() -ENDFUNCTION() - -wpublish_utils( - qserv-query-management -) - install( TARGETS wpublish ) diff --git a/src/xrdreq/CMakeLists.txt b/src/xrdreq/CMakeLists.txt new file mode 100644 index 0000000000..6aa8cf95dc --- /dev/null +++ b/src/xrdreq/CMakeLists.txt @@ -0,0 +1,52 @@ +add_library(xrdreq OBJECT) +add_dependencies(xrdreq proto) + +target_sources(xrdreq PRIVATE + ChunkGroupQservRequest.cc + ChunkListQservRequest.cc + GetChunkListQservRequest.cc + GetStatusQservRequest.cc + QservRequest.cc + QueryManagementAction.cc + QueryManagementRequest.cc + SetChunkListQservRequest.cc + TestEchoQservRequest.cc +) + +target_include_directories(xrdreq PRIVATE + ${XROOTD_INCLUDE_DIRS} +) + +target_link_libraries(xrdreq PUBLIC + log + proto + protobuf + XrdSsiLib + XrdCl +) + +FUNCTION(XRDREQ_UTILS) + FOREACH(UTIL IN ITEMS ${ARGV}) + add_executable(${UTIL}) + target_sources(${UTIL} PRIVATE ${UTIL}.cc) + target_include_directories(${UTIL} PRIVATE ${XROOTD_INCLUDE_DIRS}) + target_link_libraries(${UTIL} PRIVATE + crypto + pthread + proto + util + global + xrdreq + ) + install(TARGETS ${UTIL}) + ENDFOREACH() +ENDFUNCTION() + +xrdreq_utils( + qserv-query-management + qserv-worker-perf +) + +install( + TARGETS xrdreq +) diff --git a/src/wpublish/ChunkGroupQservRequest.cc b/src/xrdreq/ChunkGroupQservRequest.cc similarity index 91% rename from src/wpublish/ChunkGroupQservRequest.cc rename to src/xrdreq/ChunkGroupQservRequest.cc index 0da4d7fd48..b5bd2f291d 100644 --- a/src/wpublish/ChunkGroupQservRequest.cc +++ b/src/xrdreq/ChunkGroupQservRequest.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/ChunkGroupQservRequest.h" +#include "xrdreq/ChunkGroupQservRequest.h" // System headers #include @@ -34,20 +34,20 @@ using namespace std; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.ChunkGroupQservRequest"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.ChunkGroupQservRequest"); using namespace lsst::qserv; -wpublish::ChunkGroupQservRequest::Status translate(proto::WorkerCommandChunkGroupR::Status status) { +xrdreq::ChunkGroupQservRequest::Status translate(proto::WorkerCommandChunkGroupR::Status status) { switch (status) { case proto::WorkerCommandChunkGroupR::SUCCESS: - return wpublish::ChunkGroupQservRequest::SUCCESS; + return xrdreq::ChunkGroupQservRequest::SUCCESS; case proto::WorkerCommandChunkGroupR::INVALID: - return wpublish::ChunkGroupQservRequest::INVALID; + return xrdreq::ChunkGroupQservRequest::INVALID; case proto::WorkerCommandChunkGroupR::IN_USE: - return wpublish::ChunkGroupQservRequest::IN_USE; + return xrdreq::ChunkGroupQservRequest::IN_USE; case proto::WorkerCommandChunkGroupR::ERROR: - return wpublish::ChunkGroupQservRequest::ERROR; + return xrdreq::ChunkGroupQservRequest::ERROR; } throw domain_error("ChunkGroupQservRequest::" + string(__func__) + " no match for Protobuf status: " + proto::WorkerCommandChunkGroupR_Status_Name(status)); @@ -55,7 +55,7 @@ wpublish::ChunkGroupQservRequest::Status translate(proto::WorkerCommandChunkGrou } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { string ChunkGroupQservRequest::status2str(Status status) { switch (status) { @@ -161,4 +161,4 @@ RemoveChunkGroupQservRequest::RemoveChunkGroupQservRequest(unsigned int chunk, CallbackType onFinish) : ChunkGroupQservRequest(false, chunk, databases, force, onFinish) {} -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/ChunkGroupQservRequest.h b/src/xrdreq/ChunkGroupQservRequest.h similarity index 95% rename from src/wpublish/ChunkGroupQservRequest.h rename to src/xrdreq/ChunkGroupQservRequest.h index 5792e8768b..2927ba3f71 100644 --- a/src/wpublish/ChunkGroupQservRequest.h +++ b/src/xrdreq/ChunkGroupQservRequest.h @@ -21,8 +21,8 @@ * see . */ /// ChunkGroupQservRequest.h -#ifndef LSST_QSERV_WPUBLISH_CHUNK_GROUP_QSERV_REQUEST_H -#define LSST_QSERV_WPUBLISH_CHUNK_GROUP_QSERV_REQUEST_H +#ifndef LSST_QSERV_XRDREQ_CHUNK_GROUP_QSERV_REQUEST_H +#define LSST_QSERV_XRDREQ_CHUNK_GROUP_QSERV_REQUEST_H // System headers #include @@ -30,10 +30,10 @@ #include // Qserv headers -#include "wpublish/QservRequest.h" +#include "xrdreq/QservRequest.h" // This header declarations -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class ChunkGroupQservRequest implements a client-side request to @@ -170,6 +170,6 @@ class RemoveChunkGroupQservRequest : public ChunkGroupQservRequest { CallbackType onFinish); }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_CHUNK_GROUP_QSERV_REQUEST_H +#endif // LSST_QSERV_XRDREQ_CHUNK_GROUP_QSERV_REQUEST_H diff --git a/src/wpublish/ChunkListQservRequest.cc b/src/xrdreq/ChunkListQservRequest.cc similarity index 93% rename from src/wpublish/ChunkListQservRequest.cc rename to src/xrdreq/ChunkListQservRequest.cc index b5c0016d17..16914cc567 100644 --- a/src/wpublish/ChunkListQservRequest.cc +++ b/src/xrdreq/ChunkListQservRequest.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/ChunkListQservRequest.h" +#include "xrdreq/ChunkListQservRequest.h" // System headers #include @@ -35,21 +35,21 @@ using namespace std; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.ChunkListQservRequest"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.ChunkListQservRequest"); -wpublish::ChunkListQservRequest::Status translate(proto::WorkerCommandUpdateChunkListR::Status status) { +xrdreq::ChunkListQservRequest::Status translate(proto::WorkerCommandUpdateChunkListR::Status status) { switch (status) { case proto::WorkerCommandUpdateChunkListR::SUCCESS: - return wpublish::ChunkListQservRequest::SUCCESS; + return xrdreq::ChunkListQservRequest::SUCCESS; case proto::WorkerCommandUpdateChunkListR::ERROR: - return wpublish::ChunkListQservRequest::ERROR; + return xrdreq::ChunkListQservRequest::ERROR; } throw domain_error("ChunkListQservRequest::translate no match for Protobuf status: " + proto::WorkerCommandUpdateChunkListR_Status_Name(status)); } } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { string ChunkListQservRequest::status2str(Status status) { switch (status) { @@ -161,4 +161,4 @@ RebuildChunkListQservRequest::RebuildChunkListQservRequest(bool reload, ChunkListQservRequest::CallbackType onFinish) : ChunkListQservRequest(true, reload, onFinish) {} -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/ChunkListQservRequest.h b/src/xrdreq/ChunkListQservRequest.h similarity index 95% rename from src/wpublish/ChunkListQservRequest.h rename to src/xrdreq/ChunkListQservRequest.h index b637c5d671..35f451b342 100644 --- a/src/wpublish/ChunkListQservRequest.h +++ b/src/xrdreq/ChunkListQservRequest.h @@ -20,8 +20,8 @@ * the GNU General Public License along with this program. If not, * see . */ -#ifndef LSST_QSERV_WPUBLISH_CHUNK_LIST_QSERV_REQUEST_H -#define LSST_QSERV_WPUBLISH_CHUNK_LIST_QSERV_REQUEST_H +#ifndef LSST_QSERV_XRDREQ_CHUNK_LIST_QSERV_REQUEST_H +#define LSST_QSERV_XRDREQ_CHUNK_LIST_QSERV_REQUEST_H // System headers #include @@ -29,9 +29,9 @@ #include // Qserv headers -#include "wpublish/QservRequest.h" +#include "xrdreq/QservRequest.h" -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class ChunkListQservRequest the base class for client-side requests @@ -165,6 +165,6 @@ class RebuildChunkListQservRequest : public ChunkListQservRequest { RebuildChunkListQservRequest(bool reload, CallbackType onFinish); }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_CHUNK_LIST_QSERV_REQUEST_H +#endif // LSST_QSERV_XRDREQ_CHUNK_LIST_QSERV_REQUEST_H diff --git a/src/wpublish/GetChunkListQservRequest.cc b/src/xrdreq/GetChunkListQservRequest.cc similarity index 91% rename from src/wpublish/GetChunkListQservRequest.cc rename to src/xrdreq/GetChunkListQservRequest.cc index c2b593a7df..fb46026f06 100644 --- a/src/wpublish/GetChunkListQservRequest.cc +++ b/src/xrdreq/GetChunkListQservRequest.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/GetChunkListQservRequest.h" +#include "xrdreq/GetChunkListQservRequest.h" // System headers #include @@ -35,21 +35,21 @@ using namespace std; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.GetChunkListQservRequest"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.GetChunkListQservRequest"); -wpublish::GetChunkListQservRequest::Status translate(proto::WorkerCommandGetChunkListR::Status status) { +xrdreq::GetChunkListQservRequest::Status translate(proto::WorkerCommandGetChunkListR::Status status) { switch (status) { case proto::WorkerCommandGetChunkListR::SUCCESS: - return wpublish::GetChunkListQservRequest::SUCCESS; + return xrdreq::GetChunkListQservRequest::SUCCESS; case proto::WorkerCommandGetChunkListR::ERROR: - return wpublish::GetChunkListQservRequest::ERROR; + return xrdreq::GetChunkListQservRequest::ERROR; } throw domain_error("GetChunkListQservRequest::translate no match for Protobuf status: " + proto::WorkerCommandGetChunkListR_Status_Name(status)); } } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { string GetChunkListQservRequest::status2str(Status status) { switch (status) { @@ -135,4 +135,4 @@ void GetChunkListQservRequest::onError(string const& error) { } } -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/GetChunkListQservRequest.h b/src/xrdreq/GetChunkListQservRequest.h similarity index 92% rename from src/wpublish/GetChunkListQservRequest.h rename to src/xrdreq/GetChunkListQservRequest.h index 6e9c35c021..20627b9015 100644 --- a/src/wpublish/GetChunkListQservRequest.h +++ b/src/xrdreq/GetChunkListQservRequest.h @@ -20,8 +20,8 @@ * the GNU General Public License along with this program. If not, * see . */ -#ifndef LSST_QSERV_WPUBLISH_GET_CHUNK_LIST_QSERV_REQUEST_H -#define LSST_QSERV_WPUBLISH_GET_CHUNK_LIST_QSERV_REQUEST_H +#ifndef LSST_QSERV_XRDREQ_GET_CHUNK_LIST_QSERV_REQUEST_H +#define LSST_QSERV_XRDREQ_GET_CHUNK_LIST_QSERV_REQUEST_H // System headers #include @@ -29,9 +29,9 @@ #include // Qserv headers -#include "wpublish/QservRequest.h" +#include "xrdreq/QservRequest.h" -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class GetChunkListQservRequest implements the client-side requests @@ -108,6 +108,6 @@ class GetChunkListQservRequest : public QservRequest { CallbackType _onFinish; }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_GET_CHUNK_LIST_QSERV_REQUEST_H +#endif // LSST_QSERV_XRDREQ_GET_CHUNK_LIST_QSERV_REQUEST_H diff --git a/src/wpublish/GetStatusQservRequest.cc b/src/xrdreq/GetStatusQservRequest.cc similarity index 95% rename from src/wpublish/GetStatusQservRequest.cc rename to src/xrdreq/GetStatusQservRequest.cc index f4522ecfd6..56c1960af6 100644 --- a/src/wpublish/GetStatusQservRequest.cc +++ b/src/xrdreq/GetStatusQservRequest.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/GetStatusQservRequest.h" +#include "xrdreq/GetStatusQservRequest.h" // LSST headers #include "lsst/log/Log.h" @@ -30,11 +30,11 @@ using namespace std; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.GetStatusQservRequest"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.GetStatusQservRequest"); } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { string GetStatusQservRequest::status2str(Status status) { switch (status) { @@ -114,4 +114,4 @@ void GetStatusQservRequest::onError(string const& error) { } } -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/GetStatusQservRequest.h b/src/xrdreq/GetStatusQservRequest.h similarity index 92% rename from src/wpublish/GetStatusQservRequest.h rename to src/xrdreq/GetStatusQservRequest.h index 45b1189362..d557eb7a83 100644 --- a/src/wpublish/GetStatusQservRequest.h +++ b/src/xrdreq/GetStatusQservRequest.h @@ -20,8 +20,8 @@ * the GNU General Public License along with this program. If not, * see . */ -#ifndef LSST_QSERV_WPUBLISH_GET_STATUS_QSERV_REQUEST_H -#define LSST_QSERV_WPUBLISH_GET_STATUS_QSERV_REQUEST_H +#ifndef LSST_QSERV_XRDREQ_GET_STATUS_QSERV_REQUEST_H +#define LSST_QSERV_XRDREQ_GET_STATUS_QSERV_REQUEST_H // System headers #include @@ -32,9 +32,9 @@ // Qserv headers #include "wbase/TaskState.h" -#include "wpublish/QservRequest.h" +#include "xrdreq/QservRequest.h" -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class GetStatusQservRequest represents a request returning various info @@ -95,6 +95,6 @@ class GetStatusQservRequest : public QservRequest { CallbackType _onFinish; }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_GET_STATUS_QSERV_REQUEST_H +#endif // LSST_QSERV_XRDREQ_GET_STATUS_QSERV_REQUEST_H diff --git a/src/wpublish/QservRequest.cc b/src/xrdreq/QservRequest.cc similarity index 97% rename from src/wpublish/QservRequest.cc rename to src/xrdreq/QservRequest.cc index a591d0bdde..6b038dc696 100644 --- a/src/wpublish/QservRequest.cc +++ b/src/xrdreq/QservRequest.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/QservRequest.h" +#include "xrdreq/QservRequest.h" // System headers #include @@ -34,14 +34,14 @@ using namespace std; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.QservRequest"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.QservRequest"); // Set this parameter to some reasonable default int const bufInitialSize = 1024; } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { atomic QservRequest::_numClassInstances(0); @@ -213,4 +213,4 @@ void QservRequest::ProcessResponseData(const XrdSsiErrInfo& eInfo, char* buff, i } } -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/QservRequest.h b/src/xrdreq/QservRequest.h similarity index 95% rename from src/wpublish/QservRequest.h rename to src/xrdreq/QservRequest.h index 835cdab3f9..efd57cb670 100644 --- a/src/wpublish/QservRequest.h +++ b/src/xrdreq/QservRequest.h @@ -20,8 +20,8 @@ * the GNU General Public License along with this program. If not, * see . */ -#ifndef LSST_QSERV_WPUBLISH_QSERV_REQUEST_H -#define LSST_QSERV_WPUBLISH_QSERV_REQUEST_H +#ifndef LSST_QSERV_XRDREQ_QSERV_REQUEST_H +#define LSST_QSERV_XRDREQ_QSERV_REQUEST_H // System headers #include @@ -35,7 +35,7 @@ #include "proto/FrameBuffer.h" #include "proto/worker.pb.h" -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class QservRequest is a base class for a family of the client-side requests @@ -115,6 +115,6 @@ class QservRequest : public XrdSsiRequest { std::shared_ptr _refToSelf4keepAlive; }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_QSERV_REQUEST_H \ No newline at end of file +#endif // LSST_QSERV_XRDREQ_QSERV_REQUEST_H \ No newline at end of file diff --git a/src/wpublish/QueryManagementAction.cc b/src/xrdreq/QueryManagementAction.cc similarity index 91% rename from src/wpublish/QueryManagementAction.cc rename to src/xrdreq/QueryManagementAction.cc index 5533430b68..759cf3b1dc 100644 --- a/src/wpublish/QueryManagementAction.cc +++ b/src/xrdreq/QueryManagementAction.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/QueryManagementAction.h" +#include "xrdreq/QueryManagementAction.h" // System headers #include @@ -33,7 +33,7 @@ #include "XrdSsi/XrdSsiService.hh" // Qserv headers -#include "wpublish/QueryManagementRequest.h" +#include "xrdreq/QueryManagementRequest.h" // LSST headers #include "lsst/log/Log.h" @@ -44,7 +44,7 @@ extern XrdSsiProvider* XrdSsiProviderClient; using namespace std; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.QueryManagementAction"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.QueryManagementAction"); string xrootdStatus2str(XrdCl::XRootDStatus const& s) { return "status=" + to_string(s.status) + ", code=" + to_string(s.code) + ", errNo=" + to_string(s.errNo) + @@ -60,7 +60,7 @@ struct LocationInfoRAII { } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { void QueryManagementAction::notifyAllWorkers(string const& xrootdFrontendUrl, proto::QueryManagement::Operation op, QueryId queryId, @@ -117,11 +117,11 @@ void QueryManagementAction::_notifyAllWorkers(std::string const& xrootdFrontendU } // Make and configure the request object - auto request = wpublish::QueryManagementRequest::create( + auto request = xrdreq::QueryManagementRequest::create( op, queryId, - [self, workerAddress, onFinish](wpublish::QueryManagementRequest::Status status, + [self, workerAddress, onFinish](xrdreq::QueryManagementRequest::Status status, string const& error) { - if (status != wpublish::QueryManagementRequest::Status::SUCCESS) { + if (status != xrdreq::QueryManagementRequest::Status::SUCCESS) { self->_response[workerAddress] = error; } if (++(self->_numWorkerRequestsFinished) == self->_response.size()) { @@ -135,4 +135,4 @@ void QueryManagementAction::_notifyAllWorkers(std::string const& xrootdFrontendU } } -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/QueryManagementAction.h b/src/xrdreq/QueryManagementAction.h similarity index 93% rename from src/wpublish/QueryManagementAction.h rename to src/xrdreq/QueryManagementAction.h index 78f79e3250..aa63c9ddec 100644 --- a/src/wpublish/QueryManagementAction.h +++ b/src/xrdreq/QueryManagementAction.h @@ -19,8 +19,8 @@ * the GNU General Public License along with this program. If not, * see . */ -#ifndef LSST_QSERV_WPUBLISH_QUERY_MANAGEMENT_ACTION_H -#define LSST_QSERV_WPUBLISH_QUERY_MANAGEMENT_ACTION_H +#ifndef LSST_QSERV_XRDREQ_QUERY_MANAGEMENT_ACTION_H +#define LSST_QSERV_XRDREQ_QUERY_MANAGEMENT_ACTION_H // System headers #include @@ -33,7 +33,7 @@ #include "global/intTypes.h" #include "proto/worker.pb.h" -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class QueryManagementAction is an interface for managing query completion/cancellation @@ -91,6 +91,6 @@ class QueryManagementAction : public std::enable_shared_from_this _numWorkerRequestsFinished{0}; }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_QUERY_MANAGEMENT_ACTION_H +#endif // LSST_QSERV_XRDREQ_QUERY_MANAGEMENT_ACTION_H diff --git a/src/wpublish/QueryManagementRequest.cc b/src/xrdreq/QueryManagementRequest.cc similarity index 94% rename from src/wpublish/QueryManagementRequest.cc rename to src/xrdreq/QueryManagementRequest.cc index c352c01c16..e37a907c20 100644 --- a/src/wpublish/QueryManagementRequest.cc +++ b/src/xrdreq/QueryManagementRequest.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/QueryManagementRequest.h" +#include "xrdreq/QueryManagementRequest.h" // System headers #include @@ -32,10 +32,10 @@ using namespace std; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.QueryManagementRequest"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.QueryManagementRequest"); } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { string QueryManagementRequest::status2str(Status status) { switch (status) { @@ -103,4 +103,4 @@ void QueryManagementRequest::onError(string const& error) { } } -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/QueryManagementRequest.h b/src/xrdreq/QueryManagementRequest.h similarity index 92% rename from src/wpublish/QueryManagementRequest.h rename to src/xrdreq/QueryManagementRequest.h index 50287c79a9..93471abf96 100644 --- a/src/wpublish/QueryManagementRequest.h +++ b/src/xrdreq/QueryManagementRequest.h @@ -19,8 +19,8 @@ * the GNU General Public License along with this program. If not, * see . */ -#ifndef LSST_QSERV_WPUBLISH_QUERY_MANAGEMENT_REQUEST_H -#define LSST_QSERV_WPUBLISH_QUERY_MANAGEMENT_REQUEST_H +#ifndef LSST_QSERV_XRDREQ_QUERY_MANAGEMENT_REQUEST_H +#define LSST_QSERV_XRDREQ_QUERY_MANAGEMENT_REQUEST_H // System headers #include @@ -30,9 +30,9 @@ // Qserv headers #include "global/intTypes.h" #include "proto/worker.pb.h" -#include "wpublish/QservRequest.h" +#include "xrdreq/QservRequest.h" -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class QueryManagementRequest represents requests for managing query @@ -96,6 +96,6 @@ class QueryManagementRequest : public QservRequest { CallbackType _onFinish; }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_QUERY_MANAGEMENT_REQUEST_H +#endif // LSST_QSERV_XRDREQ_QUERY_MANAGEMENT_REQUEST_H diff --git a/src/wpublish/SetChunkListQservRequest.cc b/src/xrdreq/SetChunkListQservRequest.cc similarity index 90% rename from src/wpublish/SetChunkListQservRequest.cc rename to src/xrdreq/SetChunkListQservRequest.cc index 12806701d4..8038b96b06 100644 --- a/src/wpublish/SetChunkListQservRequest.cc +++ b/src/xrdreq/SetChunkListQservRequest.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/SetChunkListQservRequest.h" +#include "xrdreq/SetChunkListQservRequest.h" // System headers #include @@ -35,25 +35,25 @@ using namespace lsst::qserv; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.SetChunkListQservRequest"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.SetChunkListQservRequest"); -wpublish::SetChunkListQservRequest::Status translate(proto::WorkerCommandSetChunkListR::Status status) { +xrdreq::SetChunkListQservRequest::Status translate(proto::WorkerCommandSetChunkListR::Status status) { switch (status) { case proto::WorkerCommandSetChunkListR::SUCCESS: - return wpublish::SetChunkListQservRequest::SUCCESS; + return xrdreq::SetChunkListQservRequest::SUCCESS; case proto::WorkerCommandSetChunkListR::INVALID: - return wpublish::SetChunkListQservRequest::INVALID; + return xrdreq::SetChunkListQservRequest::INVALID; case proto::WorkerCommandSetChunkListR::IN_USE: - return wpublish::SetChunkListQservRequest::IN_USE; + return xrdreq::SetChunkListQservRequest::IN_USE; case proto::WorkerCommandSetChunkListR::ERROR: - return wpublish::SetChunkListQservRequest::ERROR; + return xrdreq::SetChunkListQservRequest::ERROR; } throw domain_error("SetChunkListQservRequest::translate no match for Protobuf status: " + proto::WorkerCommandSetChunkListR_Status_Name(status)); } } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { string SetChunkListQservRequest::status2str(Status status) { switch (status) { @@ -156,4 +156,4 @@ void SetChunkListQservRequest::onError(string const& error) { } } -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/SetChunkListQservRequest.h b/src/xrdreq/SetChunkListQservRequest.h similarity index 93% rename from src/wpublish/SetChunkListQservRequest.h rename to src/xrdreq/SetChunkListQservRequest.h index 3ed03ac845..d43f2c0f96 100644 --- a/src/wpublish/SetChunkListQservRequest.h +++ b/src/xrdreq/SetChunkListQservRequest.h @@ -20,8 +20,8 @@ * the GNU General Public License along with this program. If not, * see . */ -#ifndef LSST_QSERV_WPUBLISH_SET_CHUNK_LIST_QSERV_REQUEST_H -#define LSST_QSERV_WPUBLISH_SET_CHUNK_LIST_QSERV_REQUEST_H +#ifndef LSST_QSERV_XRDREQ_SET_CHUNK_LIST_QSERV_REQUEST_H +#define LSST_QSERV_XRDREQ_SET_CHUNK_LIST_QSERV_REQUEST_H // System headers #include @@ -30,9 +30,9 @@ #include // Qserv headers -#include "wpublish/QservRequest.h" +#include "xrdreq/QservRequest.h" -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class SetChunkListQservRequest implements the client-side requests @@ -116,6 +116,6 @@ class SetChunkListQservRequest : public QservRequest { CallbackType _onFinish; }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_SET_CHUNK_LIST_QSERV_REQUEST_H +#endif // LSST_QSERV_XRDREQ_SET_CHUNK_LIST_QSERV_REQUEST_H diff --git a/src/wpublish/TestEchoQservRequest.cc b/src/xrdreq/TestEchoQservRequest.cc similarity index 91% rename from src/wpublish/TestEchoQservRequest.cc rename to src/xrdreq/TestEchoQservRequest.cc index d6df7166ff..ad9bda0342 100644 --- a/src/wpublish/TestEchoQservRequest.cc +++ b/src/xrdreq/TestEchoQservRequest.cc @@ -21,7 +21,7 @@ */ // Class header -#include "wpublish/TestEchoQservRequest.h" +#include "xrdreq/TestEchoQservRequest.h" // System headers #include @@ -34,23 +34,23 @@ using namespace std; namespace { -LOG_LOGGER _log = LOG_GET("lsst.qserv.wpublish.TestEchoQservRequest"); +LOG_LOGGER _log = LOG_GET("lsst.qserv.xrdreq.TestEchoQservRequest"); using namespace lsst::qserv; -wpublish::TestEchoQservRequest::Status translate(proto::WorkerCommandTestEchoR::Status status) { +xrdreq::TestEchoQservRequest::Status translate(proto::WorkerCommandTestEchoR::Status status) { switch (status) { case proto::WorkerCommandTestEchoR::SUCCESS: - return wpublish::TestEchoQservRequest::SUCCESS; + return xrdreq::TestEchoQservRequest::SUCCESS; case proto::WorkerCommandTestEchoR::ERROR: - return wpublish::TestEchoQservRequest::ERROR; + return xrdreq::TestEchoQservRequest::ERROR; } throw domain_error("TestEchoQservRequest::" + string(__func__) + " no match for Protobuf status: " + proto::WorkerCommandTestEchoR_Status_Name(status)); } } // namespace -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { string TestEchoQservRequest::status2str(Status status) { switch (status) { @@ -126,4 +126,4 @@ void TestEchoQservRequest::onError(string const& error) { } } -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq diff --git a/src/wpublish/TestEchoQservRequest.h b/src/xrdreq/TestEchoQservRequest.h similarity index 92% rename from src/wpublish/TestEchoQservRequest.h rename to src/xrdreq/TestEchoQservRequest.h index 0c613598c1..2a375e408d 100644 --- a/src/wpublish/TestEchoQservRequest.h +++ b/src/xrdreq/TestEchoQservRequest.h @@ -20,8 +20,8 @@ * the GNU General Public License along with this program. If not, * see . */ -#ifndef LSST_QSERV_WPUBLISH_TEST_ECHO_QSERV_REQUEST_H -#define LSST_QSERV_WPUBLISH_TEST_ECHO_QSERV_REQUEST_H +#ifndef LSST_QSERV_XRDREQ_TEST_ECHO_QSERV_REQUEST_H +#define LSST_QSERV_XRDREQ_TEST_ECHO_QSERV_REQUEST_H // System headers #include @@ -29,9 +29,9 @@ #include // Qserv headers -#include "wpublish/QservRequest.h" +#include "xrdreq/QservRequest.h" -namespace lsst::qserv::wpublish { +namespace lsst::qserv::xrdreq { /** * Class TestEchoQservRequest represents a simple test request sending a string @@ -99,6 +99,6 @@ class TestEchoQservRequest : public QservRequest { CallbackType _onFinish; }; -} // namespace lsst::qserv::wpublish +} // namespace lsst::qserv::xrdreq -#endif // LSST_QSERV_WPUBLISH_TEST_ECHO_QSERV_REQUEST_H +#endif // LSST_QSERV_XRDREQ_TEST_ECHO_QSERV_REQUEST_H diff --git a/src/wpublish/qserv-query-management.cc b/src/xrdreq/qserv-query-management.cc similarity index 89% rename from src/wpublish/qserv-query-management.cc rename to src/xrdreq/qserv-query-management.cc index d50d0f81ee..65a7b87757 100644 --- a/src/wpublish/qserv-query-management.cc +++ b/src/xrdreq/qserv-query-management.cc @@ -35,8 +35,8 @@ #include "proto/worker.pb.h" #include "util/BlockPost.h" #include "util/CmdLineParser.h" -#include "wpublish/QueryManagementAction.h" -#include "wpublish/QueryManagementRequest.h" +#include "xrdreq/QueryManagementAction.h" +#include "xrdreq/QueryManagementRequest.h" /// This C++ symbol is provided by the SSI shared library extern XrdSsiProvider* XrdSsiProviderClient; @@ -44,7 +44,7 @@ extern XrdSsiProvider* XrdSsiProviderClient; namespace global = lsst::qserv; namespace proto = lsst::qserv::proto; namespace util = lsst::qserv::util; -namespace wpublish = lsst::qserv::wpublish; +namespace xrdreq = lsst::qserv::xrdreq; using namespace std; @@ -72,9 +72,9 @@ proto::QueryManagement::Operation str2operation(string const& str) { int test() { bool finished = false; if (allWorkers) { - wpublish::QueryManagementAction::notifyAllWorkers( + xrdreq::QueryManagementAction::notifyAllWorkers( serviceProviderLocation, operation, queryId, - [&finished](wpublish::QueryManagementAction::Response const& response) { + [&finished](xrdreq::QueryManagementAction::Response const& response) { for (auto itr : response) { cout << "worker: " << itr.first << " error: " << itr.second << endl; } @@ -92,10 +92,10 @@ int test() { cout << "connected to service provider at: " << serviceProviderLocation << endl; // Prepare the request - auto request = wpublish::QueryManagementRequest::create( + auto request = xrdreq::QueryManagementRequest::create( operation, queryId, - [&finished](wpublish::QueryManagementRequest::Status status, string const& error) { - cout << "status=" << wpublish::QueryManagementRequest::status2str(status) << ", error='" + [&finished](xrdreq::QueryManagementRequest::Status status, string const& error) { + cout << "status=" << xrdreq::QueryManagementRequest::status2str(status) << ", error='" << error << "'" << endl; finished = true; }); diff --git a/src/wpublish/qserv-worker-notify.cc b/src/xrdreq/qserv-worker-notify.cc similarity index 73% rename from src/wpublish/qserv-worker-notify.cc rename to src/xrdreq/qserv-worker-notify.cc index a90d7c59c3..e82e135340 100644 --- a/src/wpublish/qserv-worker-notify.cc +++ b/src/xrdreq/qserv-worker-notify.cc @@ -17,19 +17,19 @@ #include "proto/worker.pb.h" #include "util/BlockPost.h" #include "util/CmdLineParser.h" -#include "wpublish/ChunkGroupQservRequest.h" -#include "wpublish/ChunkListQservRequest.h" -#include "wpublish/GetChunkListQservRequest.h" -#include "wpublish/GetStatusQservRequest.h" -#include "wpublish/SetChunkListQservRequest.h" -#include "wpublish/TestEchoQservRequest.h" +#include "xrdreq/ChunkGroupQservRequest.h" +#include "xrdreq/ChunkListQservRequest.h" +#include "xrdreq/GetChunkListQservRequest.h" +#include "xrdreq/GetStatusQservRequest.h" +#include "xrdreq/SetChunkListQservRequest.h" +#include "xrdreq/TestEchoQservRequest.h" /// This C++ symbol is provided by the SSI shared library extern XrdSsiProvider* XrdSsiProviderClient; namespace global = lsst::qserv; namespace util = lsst::qserv::util; -namespace wpublish = lsst::qserv::wpublish; +namespace xrdreq = lsst::qserv::xrdreq; using namespace std; @@ -65,7 +65,7 @@ bool printReport; * * @param chunk - collection to be initialize */ -void readInFile(wpublish::SetChunkListQservRequest::ChunkCollection& chunks, vector& databases) { +void readInFile(xrdreq::SetChunkListQservRequest::ChunkCollection& chunks, vector& databases) { chunks.clear(); databases.clear(); @@ -90,7 +90,7 @@ void readInFile(wpublish::SetChunkListQservRequest::ChunkCollection& chunks, vec } unsigned long const chunk = stoul(databaseAndChunk.substr(pos + 1)); string const database = databaseAndChunk.substr(0, pos); - chunks.emplace_back(wpublish::SetChunkListQservRequest::Chunk{ + chunks.emplace_back(xrdreq::SetChunkListQservRequest::Chunk{ (unsigned int)chunk, database, 0 /* use_count (UNUSED) */ }); uniqueDatabaseNames.insert(database); @@ -105,14 +105,14 @@ int test() { atomic finished(false); - shared_ptr request = nullptr; + shared_ptr request = nullptr; if ("GET_CHUNK_LIST" == operation) { - request = wpublish::GetChunkListQservRequest::create( - inUseOnly, [&finished](wpublish::GetChunkListQservRequest::Status status, string const& error, - wpublish::GetChunkListQservRequest::ChunkCollection const& chunks) { - if (status != wpublish::GetChunkListQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::GetChunkListQservRequest::status2str(status) << "\n" + request = xrdreq::GetChunkListQservRequest::create( + inUseOnly, [&finished](xrdreq::GetChunkListQservRequest::Status status, string const& error, + xrdreq::GetChunkListQservRequest::ChunkCollection const& chunks) { + if (status != xrdreq::GetChunkListQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::GetChunkListQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { cout << "# total chunks: " << chunks.size() << "\n" << endl; @@ -131,16 +131,16 @@ int test() { }); } else if ("SET_CHUNK_LIST" == operation) { - wpublish::SetChunkListQservRequest::ChunkCollection chunks; + xrdreq::SetChunkListQservRequest::ChunkCollection chunks; vector databases; readInFile(chunks, databases); - request = wpublish::SetChunkListQservRequest::create( + request = xrdreq::SetChunkListQservRequest::create( chunks, databases, force, - [&finished](wpublish::SetChunkListQservRequest::Status status, string const& error, - wpublish::SetChunkListQservRequest::ChunkCollection const& chunks) { - if (status != wpublish::SetChunkListQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::SetChunkListQservRequest::status2str(status) << "\n" + [&finished](xrdreq::SetChunkListQservRequest::Status status, string const& error, + xrdreq::SetChunkListQservRequest::ChunkCollection const& chunks) { + if (status != xrdreq::SetChunkListQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::SetChunkListQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { cout << "# total chunks: " << chunks.size() << "\n" << endl; @@ -159,12 +159,12 @@ int test() { }); } else if ("REBUILD_CHUNK_LIST" == operation) { - request = wpublish::RebuildChunkListQservRequest::create( - reload, [&finished](wpublish::ChunkListQservRequest::Status status, string const& error, - wpublish::ChunkListQservRequest::ChunkCollection const& added, - wpublish::ChunkListQservRequest::ChunkCollection const& removed) { - if (status != wpublish::ChunkListQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::ChunkListQservRequest::status2str(status) << "\n" + request = xrdreq::RebuildChunkListQservRequest::create( + reload, [&finished](xrdreq::ChunkListQservRequest::Status status, string const& error, + xrdreq::ChunkListQservRequest::ChunkCollection const& added, + xrdreq::ChunkListQservRequest::ChunkCollection const& removed) { + if (status != xrdreq::ChunkListQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::ChunkListQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { cout << "# chunks added: " << added.size() << "\n" @@ -174,12 +174,12 @@ int test() { }); } else if ("RELOAD_CHUNK_LIST" == operation) { - request = wpublish::ReloadChunkListQservRequest::create( - [&finished](wpublish::ChunkListQservRequest::Status status, string const& error, - wpublish::ChunkListQservRequest::ChunkCollection const& added, - wpublish::ChunkListQservRequest::ChunkCollection const& removed) { - if (status != wpublish::ChunkListQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::ChunkListQservRequest::status2str(status) << "\n" + request = xrdreq::ReloadChunkListQservRequest::create( + [&finished](xrdreq::ChunkListQservRequest::Status status, string const& error, + xrdreq::ChunkListQservRequest::ChunkCollection const& added, + xrdreq::ChunkListQservRequest::ChunkCollection const& removed) { + if (status != xrdreq::ChunkListQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::ChunkListQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { cout << "# chunks added: " << added.size() << "\n" @@ -189,33 +189,32 @@ int test() { }); } else if ("ADD_CHUNK_GROUP" == operation) { - request = wpublish::AddChunkGroupQservRequest::create( - chunk, dbs, - [&finished](wpublish::ChunkGroupQservRequest::Status status, string const& error) { - if (status != wpublish::ChunkGroupQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::ChunkGroupQservRequest::status2str(status) << "\n" + request = xrdreq::AddChunkGroupQservRequest::create( + chunk, dbs, [&finished](xrdreq::ChunkGroupQservRequest::Status status, string const& error) { + if (status != xrdreq::ChunkGroupQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::ChunkGroupQservRequest::status2str(status) << "\n" << "error: " << error << endl; } finished = true; }); } else if ("REMOVE_CHUNK_GROUP" == operation) { - request = wpublish::RemoveChunkGroupQservRequest::create( + request = xrdreq::RemoveChunkGroupQservRequest::create( chunk, dbs, force, - [&finished](wpublish::ChunkGroupQservRequest::Status status, string const& error) { - if (status != wpublish::ChunkGroupQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::ChunkGroupQservRequest::status2str(status) << "\n" + [&finished](xrdreq::ChunkGroupQservRequest::Status status, string const& error) { + if (status != xrdreq::ChunkGroupQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::ChunkGroupQservRequest::status2str(status) << "\n" << "error: " << error << endl; } finished = true; }); } else if ("TEST_ECHO" == operation) { - request = wpublish::TestEchoQservRequest::create( - value, [&finished](wpublish::TestEchoQservRequest::Status status, string const& error, + request = xrdreq::TestEchoQservRequest::create( + value, [&finished](xrdreq::TestEchoQservRequest::Status status, string const& error, string const& sent, string const& received) { - if (status != wpublish::TestEchoQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::TestEchoQservRequest::status2str(status) << "\n" + if (status != xrdreq::TestEchoQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::TestEchoQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { cout << "value sent: " << sent << "\n" @@ -225,12 +224,12 @@ int test() { }); } else if ("GET_STATUS" == operation) { - request = wpublish::GetStatusQservRequest::create( + request = xrdreq::GetStatusQservRequest::create( includeTasks, queryIds, - [&finished](wpublish::GetStatusQservRequest::Status status, string const& error, + [&finished](xrdreq::GetStatusQservRequest::Status status, string const& error, string const& info) { - if (status != wpublish::GetStatusQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::GetStatusQservRequest::status2str(status) << "\n" + if (status != xrdreq::GetStatusQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::GetStatusQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { cout << "worker info: " << info << endl; diff --git a/src/wpublish/qserv-worker-perf-chunks.cc b/src/xrdreq/qserv-worker-perf-chunks.cc similarity index 99% rename from src/wpublish/qserv-worker-perf-chunks.cc rename to src/xrdreq/qserv-worker-perf-chunks.cc index cce8270fb3..78efb09bf1 100644 --- a/src/wpublish/qserv-worker-perf-chunks.cc +++ b/src/xrdreq/qserv-worker-perf-chunks.cc @@ -48,19 +48,19 @@ #include "util/BlockPost.h" #include "util/CmdLineParser.h" #include "util/File.h" -#include "wpublish/TestEchoQservRequest.h" +#include "xrdreq/TestEchoQservRequest.h" /// This C++ symbol is provided by the SSI shared library extern XrdSsiProvider* XrdSsiProviderClient; namespace global = lsst::qserv; namespace util = lsst::qserv::util; -namespace wpublish = lsst::qserv::wpublish; +namespace xrdreq = lsst::qserv::xrdreq; using namespace std; using namespace std::placeholders; -using RequestT = wpublish::TestEchoQservRequest; +using RequestT = xrdreq::TestEchoQservRequest; namespace { diff --git a/src/wpublish/qserv-worker-perf.cc b/src/xrdreq/qserv-worker-perf.cc similarity index 85% rename from src/wpublish/qserv-worker-perf.cc rename to src/xrdreq/qserv-worker-perf.cc index 3a17fa6cf2..03d6b633c8 100644 --- a/src/wpublish/qserv-worker-perf.cc +++ b/src/xrdreq/qserv-worker-perf.cc @@ -16,14 +16,14 @@ #include "util/BlockPost.h" #include "util/CmdLineParser.h" #include "util/File.h" -#include "wpublish/TestEchoQservRequest.h" +#include "xrdreq/TestEchoQservRequest.h" /// This C++ symbol is provided by the SSI shared library extern XrdSsiProvider* XrdSsiProviderClient; namespace global = lsst::qserv; namespace util = lsst::qserv::util; -namespace wpublish = lsst::qserv::wpublish; +namespace xrdreq = lsst::qserv::xrdreq; using namespace std; @@ -57,7 +57,7 @@ int test() { cout << "connected to service provider at: " << serviceProviderLocation << endl; // Store request pointers here to prevent them deleted too early - vector requests; + vector requests; atomic finished(0); @@ -66,12 +66,11 @@ int test() { string const& worker = workers[j]; for (unsigned int i = 0; i < numRequests; ++i) { - auto request = wpublish::TestEchoQservRequest::create( - value, [&finished](wpublish::TestEchoQservRequest::Status status, string const& error, + auto request = xrdreq::TestEchoQservRequest::create( + value, [&finished](xrdreq::TestEchoQservRequest::Status status, string const& error, string const& sent, string const& received) { - if (status != wpublish::TestEchoQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::TestEchoQservRequest::status2str(status) - << "\n" + if (status != xrdreq::TestEchoQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::TestEchoQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { cout << "value sent: " << sent << "\n" @@ -92,12 +91,11 @@ int test() { for (unsigned int i = 0; i < numRequests; ++i) { for (unsigned int j = 0; j < numWorkers; ++j) { string const& worker = workers[j]; - auto request = wpublish::TestEchoQservRequest::create( - value, [&finished](wpublish::TestEchoQservRequest::Status status, string const& error, + auto request = xrdreq::TestEchoQservRequest::create( + value, [&finished](xrdreq::TestEchoQservRequest::Status status, string const& error, string const& sent, string const& received) { - if (status != wpublish::TestEchoQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::TestEchoQservRequest::status2str(status) - << "\n" + if (status != xrdreq::TestEchoQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::TestEchoQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { cout << "value sent: " << sent << "\n" diff --git a/src/wpublish/qserv-worker-status.cc b/src/xrdreq/qserv-worker-status.cc similarity index 87% rename from src/wpublish/qserv-worker-status.cc rename to src/xrdreq/qserv-worker-status.cc index 9ce7c580f3..4e16a43d22 100644 --- a/src/wpublish/qserv-worker-status.cc +++ b/src/xrdreq/qserv-worker-status.cc @@ -16,14 +16,14 @@ #include "util/BlockPost.h" #include "util/CmdLineParser.h" #include "util/File.h" -#include "wpublish/GetStatusQservRequest.h" +#include "xrdreq/GetStatusQservRequest.h" /// This C++ symbol is provided by the SSI shared library extern XrdSsiProvider* XrdSsiProviderClient; namespace global = lsst::qserv; namespace util = lsst::qserv::util; -namespace wpublish = lsst::qserv::wpublish; +namespace xrdreq = lsst::qserv::xrdreq; using namespace std; @@ -58,7 +58,7 @@ int test() { cout << "connected to service provider at: " << serviceProviderLocation << endl; // Store request pointers here to prevent them deleted too early - vector requests; + vector requests; atomic finished(0); @@ -67,12 +67,12 @@ int test() { string const& worker = workers[j]; for (unsigned int i = 0; i < numRequests; ++i) { - auto request = wpublish::GetStatusQservRequest::create( + auto request = xrdreq::GetStatusQservRequest::create( includeTasks, queryIds, - [&finished](wpublish::GetStatusQservRequest::Status status, string const& error, + [&finished](xrdreq::GetStatusQservRequest::Status status, string const& error, string const& info) { - if (status != wpublish::GetStatusQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::GetStatusQservRequest::status2str(status) + if (status != xrdreq::GetStatusQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::GetStatusQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else { @@ -93,11 +93,11 @@ int test() { for (unsigned int i = 0; i < numRequests; ++i) { for (unsigned int j = 0; j < numWorkers; ++j) { string const& worker = workers[j]; - auto request = wpublish::GetStatusQservRequest::create( - [&finished](wpublish::GetStatusQservRequest::Status status, string const& error, + auto request = xrdreq::GetStatusQservRequest::create( + [&finished](xrdreq::GetStatusQservRequest::Status status, string const& error, string const& info) { - if (status != wpublish::GetStatusQservRequest::Status::SUCCESS) { - cout << "status: " << wpublish::GetStatusQservRequest::status2str(status) + if (status != xrdreq::GetStatusQservRequest::Status::SUCCESS) { + cout << "status: " << xrdreq::GetStatusQservRequest::status2str(status) << "\n" << "error: " << error << endl; } else {