@@ -49,36 +49,18 @@ namespace lsst {
4949namespace qserv {
5050namespace loader {
5151
52- /* &&&
53- CentralClient::CentralClient(boost::asio::io_service& ioService_,
54- std::string const& hostName, ClientConfig const& cfg)
55- : Central(ioService_, cfg.getMasterHost(), cfg.getMasterPortUdp(), cfg.getThreadPoolSize(), cfg.getLoopSleepTime(), cfg.getIOThreads()),
56- _hostName(hostName), _udpPort(cfg.getClientPortUdp()),
57- _defWorkerHost(cfg.getDefWorkerHost()),
58- _defWorkerPortUdp(cfg.getDefWorkerPortUdp()),
59- _doListMaxLookups(cfg.getMaxLookups()),
60- _doListMaxInserts(cfg.getMaxInserts()),
61- _maxRequestSleepTime(cfg.getMaxRequestSleepTime()) {
62- }
63- */
52+
6453CentralClient::CentralClient (boost::asio::io_service& ioService_,
6554 std::string const & hostName, ClientConfig const & cfg)
6655 : CentralFollower(ioService_, hostName, cfg.getMasterHost(), cfg.getMasterPortUdp(),
6756 cfg.getThreadPoolSize(),cfg.getLoopSleepTime(), cfg.getIOThreads(), cfg.getClientPortUdp()),
68- // &&& _hostName(hostName),
69- // &&& _udpPort(cfg.getClientPortUdp()),
7057 _defWorkerHost (cfg.getDefWorkerHost()),
7158 _defWorkerPortUdp(cfg.getDefWorkerPortUdp()),
7259 _doListMaxLookups(cfg.getMaxLookups()),
7360 _doListMaxInserts(cfg.getMaxInserts()),
7461 _maxRequestSleepTime(cfg.getMaxRequestSleepTime()) {
7562}
7663
77- /* &&&
78- void CentralClient::start() {
79- _server = std::make_shared<ClientServer>(ioService, _hostName, _udpPort, this);
80- }
81- */
8264
8365void CentralClient::startService () {
8466 _server = std::make_shared<ClientServer>(ioService, _hostName, _udpPort, this );
@@ -92,7 +74,7 @@ CentralClient::~CentralClient() {
9274void CentralClient::handleKeyLookup (LoaderMsg const & inMsg, BufferUdp::Ptr const & data) {
9375 LOGS (_log, LOG_LVL_DEBUG, " CentralClient::handleKeyLookup" );
9476
95- auto const sData = std::dynamic_pointer_cast<StringElement>(MsgElement::retrieve (*data, " CentralClient::handleKeyLookup&&& " ));
77+ auto const sData = std::dynamic_pointer_cast<StringElement>(MsgElement::retrieve (*data, " CentralClient::handleKeyLookup " ));
9678 if (sData == nullptr ) {
9779 LOGS (_log, LOG_LVL_WARN, " CentralClient::handleKeyLookup Failed to parse list" );
9880 return ;
@@ -128,14 +110,14 @@ void CentralClient::_handleKeyLookup(LoaderMsg const& inMsg, std::unique_ptr<pro
128110 _waitingKeyLookupMap.erase (iter);
129111 }
130112 keyLookupOneShot->keyInfoComplete (key, chunkInfo.chunk , chunkInfo.subchunk , protoData->success ());
131- LOGS (_log, LOG_LVL_WARN , " &&&INFO Successful KEY_LOOKUP key=" << key << " " << chunkInfo);
113+ LOGS (_log, LOG_LVL_INFO , " Successful KEY_LOOKUP key=" << key << " " << chunkInfo);
132114}
133115
134116
135117void CentralClient::handleKeyInsertComplete (LoaderMsg const & inMsg, BufferUdp::Ptr const & data) {
136118 LOGS (_log, LOG_LVL_DEBUG, " CentralClient::handleKeyInsertComplete" );
137119
138- auto sData = std::dynamic_pointer_cast<StringElement>(MsgElement::retrieve (*data, " CentralClient::handleKeyInsertComplete&&& " ));
120+ auto sData = std::dynamic_pointer_cast<StringElement>(MsgElement::retrieve (*data, " CentralClient::handleKeyInsertComplete " ));
139121 if (sData == nullptr ) {
140122 LOGS (_log, LOG_LVL_WARN, " CentralClient::handleKeyInsertComplete Failed to retrieve element" );
141123 return ;
@@ -173,7 +155,7 @@ void CentralClient::_handleKeyInsertComplete(LoaderMsg const& inMsg, std::unique
173155 mapSize = _waitingKeyInsertMap.size ();
174156 }
175157 keyInsertOneShot->keyInsertComplete ();
176- LOGS (_log, LOG_LVL_WARN , " &&&INFO Successful KEY_INSERT_COMPLETE key=" << key << " " << chunkInfo <<
158+ LOGS (_log, LOG_LVL_INFO , " Successful KEY_INSERT_COMPLETE key=" << key << " " << chunkInfo <<
177159 " mapSize=" << mapSize);
178160}
179161
@@ -199,11 +181,10 @@ KeyInfoData::Ptr CentralClient::keyInsertReq(CompositeKey const& key, int chunk,
199181 size_t sz = _waitingKeyInsertMap.size ();
200182 lck.unlock ();
201183 if (loopCount % 100 == 0 ) {
202- LOGS (_log, LOG_LVL_INFO , " keyInsertReq waiting key=" << key <<
184+ LOGS (_log, LOG_LVL_DEBUG , " keyInsertReq waiting key=" << key <<
203185 " size=" << sz << " loopCount=" << loopCount);
204186 }
205187 // Let the CPU do something else while waiting for some requests to finish.
206- LOGS (_log, LOG_LVL_INFO, " &&& SLEEP" );
207188 usleep (_maxRequestSleepTime);
208189 ++loopCount;
209190 lck.lock ();
@@ -294,7 +275,6 @@ KeyInfoData::Ptr CentralClient::keyLookupReq(CompositeKey const& key) {
294275 " size=" << sz << " loopCount=" << loopCount);
295276 }
296277 // Let the CPU do something else while waiting for some requests to finish.
297- LOGS (_log, LOG_LVL_INFO, " &&& SLEEP" );
298278 usleep (_maxRequestSleepTime);
299279 sleptForMicroSec += _maxRequestSleepTime;
300280 ++loopCount;
0 commit comments