Skip to content

Commit f64e22c

Browse files
committed
Improved comments.
1 parent d567ab3 commit f64e22c

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

src/wbase/FileChannelShared.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ string FileChannelShared::makeIdStr(int qId, int jId) {
317317

318318
bool FileChannelShared::buildAndTransmitError(util::MultiError& multiErr, shared_ptr<Task> const& task,
319319
bool cancelled) {
320-
// &&& Arena may not really be needed.
321320
std::unique_ptr<google::protobuf::Arena> protobufArena = make_unique<google::protobuf::Arena>();
322321
lock_guard<mutex> const tMtxLock(_tMtx);
323322
if (!_sendResponse(tMtxLock, protobufArena, task, cancelled, multiErr)) {
@@ -329,7 +328,6 @@ bool FileChannelShared::buildAndTransmitError(util::MultiError& multiErr, shared
329328

330329
bool FileChannelShared::buildAndTransmitResult(MYSQL_RES* mResult, shared_ptr<Task> const& task,
331330
util::MultiError& multiErr, atomic<bool>& cancelled) {
332-
LOGS(_log, LOG_LVL_WARN, "&&& FileChannelShared::buildAndTransmitResult start");
333331
// Operation stats. Note that "buffer fill time" included the amount
334332
// of time needed to write the result set to disk.
335333
util::Timer transmitT;
@@ -347,7 +345,6 @@ bool FileChannelShared::buildAndTransmitResult(MYSQL_RES* mResult, shared_ptr<Ta
347345
bool erred = false;
348346
bool hasMoreRows = true;
349347

350-
// &&& Arena may not really be needed.
351348
std::unique_ptr<google::protobuf::Arena> protobufArena = make_unique<google::protobuf::Arena>();
352349
proto::ResponseData* responseData = nullptr;
353350

@@ -389,9 +386,7 @@ bool FileChannelShared::buildAndTransmitResult(MYSQL_RES* mResult, shared_ptr<Ta
389386
// the current request (note that certain classes of requests may require
390387
// more than one task for processing).
391388
if (!hasMoreRows && transmitTaskLast()) {
392-
LOGS(_log, LOG_LVL_WARN, "&&& FileChannelShared::buildAndTransmitResult e");
393389
lock_guard<mutex> const tMtxLock(_tMtx);
394-
LOGS(_log, LOG_LVL_WARN, "&&& FileChannelShared::buildAndTransmitResult e1");
395390

396391
// Make sure the file is sync to disk before notifying Czar.
397392
_file.flush();
@@ -424,11 +419,6 @@ bool FileChannelShared::buildAndTransmitResult(MYSQL_RES* mResult, shared_ptr<Ta
424419
// successfully processing the query and writing all results into the file.
425420
// The file is not going to be used by Czar in either of these scenarios.
426421
if (cancelled || erred || isDead()) {
427-
/* &&&
428-
//&&& it may be better to set a flag and call _removeFile in the destructor.
429-
lock_guard<mutex> const tMtxLockA(_tMtx);
430-
_removeFile(tMtxLockA);
431-
*/
432422
// Set a flag to delete the file in the destructor. That should prevent any
433423
// possible race conditions with other threads expecting the file to exist.
434424
_issueRequiresFileRemoval = true;
@@ -446,7 +436,6 @@ bool FileChannelShared::_writeToFile(proto::ResponseData* responseData,
446436
shared_ptr<Task> const& task, MYSQL_RES* mResult, int& bytes, int& rows,
447437
util::MultiError& multiErr) {
448438
// Transfer rows from a result set into the response data object.
449-
LOGS(_log, LOG_LVL_WARN, "&&& _writeToFile start");
450439
if (nullptr == responseData) {
451440
responseData = google::protobuf::Arena::CreateMessage<proto::ResponseData>(protobufArena.get());
452441
} else {
@@ -464,9 +453,7 @@ bool FileChannelShared::_writeToFile(proto::ResponseData* responseData,
464453
bytes = msg.size();
465454

466455
LOGS(_log, LOG_LVL_TRACE, __func__ << " file write " << task->getIdStr() << " start");
467-
LOGS(_log, LOG_LVL_WARN, "&&& _writeToFile d");
468456
lock_guard<mutex> const tMtxLock(_tMtx);
469-
LOGS(_log, LOG_LVL_WARN, "&&& _writeToFile d1");
470457
// Create the file if not open.
471458
if (!_file.is_open()) {
472459
_fileName = task->resultFilePath();
@@ -488,7 +475,6 @@ bool FileChannelShared::_writeToFile(proto::ResponseData* responseData,
488475
throw runtime_error("FileChannelShared::" + string(__func__) + " failed to write " +
489476
to_string(msg.size()) + " bytes into the file '" + _fileName + "'.");
490477
}
491-
LOGS(_log, LOG_LVL_WARN, "&&& _writeToFile end");
492478
return hasMoreRows;
493479
}
494480

src/wbase/FileChannelShared.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ class FileChannelShared {
182182
* implementation. Also, the iterative approach to the data extraction allows
183183
* the driving code to be interrupted should the correponding query be cancelled
184184
* during the lengthy data processing phase.
185-
* @param tMtxLock - a lock on the mutex tMtx
185+
* @param responseData - proto buffer to hold the response being constructed.
186+
* @param protobufArena - proto buffer memory management control.
186187
* @param task - a task that produced the result set
187188
* @param mResult - MySQL result to be used as a source
188189
* @param bytes - the number of bytes in the result message recorded into the file
@@ -192,7 +193,6 @@ class FileChannelShared {
192193
* @throws std::runtime_error for problems encountered when attemting to create the file
193194
* or write into the file.
194195
*/
195-
// &&& fix doc tMtxLock responseData protobufArena
196196
bool _writeToFile(proto::ResponseData* responseData,
197197
std::unique_ptr<google::protobuf::Arena> const& protobufArena,
198198
std::shared_ptr<Task> const& task, MYSQL_RES* mResult, int& bytes, int& rows,
@@ -201,13 +201,13 @@ class FileChannelShared {
201201
/**
202202
* Extract as many rows as allowed by the Google Protobuf implementation from
203203
* from the input result set into the output result object.
204-
* @param tMtxLock - a lock on the mutex tMtx
204+
* @param responseData - proto buffer to hold the response being constructed.
205+
* @param protobufArena - proto buffer memory management control.
205206
* @param mResult - MySQL result to be used as a source
206207
* @param rows - the number of rows extracted from the result set
207208
* @param tSize - the approximate amount of data extracted from the result set
208209
* @return 'true' if there are more rows left in the result set.
209210
*/
210-
//&&& fix doc
211211
static bool _fillRows(proto::ResponseData* responseData, MYSQL_RES* mResult, int& rows, size_t& tSize);
212212

213213
/**

src/wdb/QueryRunner.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ size_t QueryRunner::_getDesiredLimit() {
147147
util::TimerHistogram memWaitHisto("memWait Hist", {1, 5, 10, 20, 40});
148148

149149
bool QueryRunner::runQuery() {
150-
LOGS(_log, LOG_LVL_WARN, "&&& runQuery start");
151150
util::InstanceCount ic(to_string(_task->getQueryId()) + "_rq_LDB"); // LockupDB
152151
util::HoldTrack::Mark runQueryMarkA(ERR_LOC, "runQuery " + to_string(_task->getQueryId()));
153152
QSERV_LOGCONTEXT_QUERY_JOB(_task->getQueryId(), _task->getJobId());
@@ -255,7 +254,6 @@ class ChunkResourceRequest {
255254
};
256255

257256
bool QueryRunner::_dispatchChannel() {
258-
LOGS(_log, LOG_LVL_WARN, "&&& dispatch start");
259257
bool erred = false;
260258
bool needToFreeRes = false; // set to true once there are results to be freed.
261259
// Collect the result in _transmitData. When a reasonable amount of data has been collected,
@@ -300,9 +298,7 @@ bool QueryRunner::_dispatchChannel() {
300298
if (sendChan == nullptr) {
301299
throw util::Bug(ERR_LOC, "QueryRunner::_dispatchChannel() sendChan==null");
302300
}
303-
LOGS(_log, LOG_LVL_WARN, "&&& dispatch calling buildAndTransmitResult a");
304301
erred = sendChan->buildAndTransmitResult(res, _task, _multiError, _cancelled);
305-
LOGS(_log, LOG_LVL_WARN, "&&& dispatch calling buildAndTransmitResult a1");
306302
}
307303
}
308304
} catch (sql::SqlErrorObject const& e) {
@@ -325,12 +321,10 @@ bool QueryRunner::_dispatchChannel() {
325321
erred = true;
326322
// Send results. This needs to happen after the error check.
327323
// If any errors were found, send an error back.
328-
LOGS(_log, LOG_LVL_WARN, "&&& dispatch calling buildAndTransmiError b");
329324
if (!_task->getSendChannel()->buildAndTransmitError(_multiError, _task, _cancelled)) {
330325
LOGS(_log, LOG_LVL_WARN,
331326
" Could not report error to czar as sendChannel not accepting msgs." << _task->getIdStr());
332327
}
333-
LOGS(_log, LOG_LVL_WARN, "&&& dispatch calling buildAndTransmiError b1");
334328
}
335329
return !erred;
336330
}

0 commit comments

Comments
 (0)