Renamed variables in checker library for clarity. Review: https://reviews.apache.org/r/58193
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ace94323 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ace94323 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ace94323 Branch: refs/heads/master Commit: ace943235b5f2b309b6d18e480192fb512ab89c6 Parents: 4b22e0d Author: Alexander Rukletsov <[email protected]> Authored: Tue Apr 4 13:47:25 2017 +0200 Committer: Alexander Rukletsov <[email protected]> Committed: Mon Apr 24 12:04:51 2017 +0200 ---------------------------------------------------------------------- src/checks/checker.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/ace94323/src/checks/checker.cpp ---------------------------------------------------------------------- diff --git a/src/checks/checker.cpp b/src/checks/checker.cpp index 2a7d511..a883656 100644 --- a/src/checks/checker.cpp +++ b/src/checks/checker.cpp @@ -184,14 +184,14 @@ private: void processCommandCheckResult( const Stopwatch& stopwatch, - const Future<int>& result); + const Future<int>& future); Future<int> httpCheck(); Future<int> _httpCheck( const tuple<Future<Option<int>>, Future<string>, Future<string>>& t); void processHttpCheckResult( const Stopwatch& stopwatch, - const Future<int>& result); + const Future<int>& future); const CheckInfo check; Duration checkDelay; @@ -937,7 +937,7 @@ Future<int> CheckerProcess::httpCheck() "-L", // Follows HTTP 3xx redirects. "-k", // Ignores SSL validation when scheme is https. "-w", "%{http_code}", // Displays HTTP response code on stdout. - "-o", os::DEV_NULL, // Ignores output. + "-o", os::DEV_NULL, // Ignores output. url }; @@ -1043,27 +1043,26 @@ Future<int> CheckerProcess::_httpCheck( void CheckerProcess::processHttpCheckResult( const Stopwatch& stopwatch, - const Future<int>& result) + const Future<int>& future) { - CheckStatusInfo checkStatusInfo; - checkStatusInfo.set_type(check.type()); + CheckStatusInfo result; + result.set_type(check.type()); - if (result.isReady()) { + if (future.isReady()) { VLOG(1) << check.type() << " check for task '" - << taskId << "' returned: " << result.get(); + << taskId << "' returned: " << future.get(); - checkStatusInfo.mutable_http()->set_status_code( - static_cast<uint32_t>(result.get())); + result.mutable_http()->set_status_code(static_cast<uint32_t>(future.get())); } else { // Check's status is currently not available, which may indicate a change // that should be reported as an empty `CheckStatusInfo.Http` message. - LOG(WARNING) << "Check for task '" << taskId << "' failed: " - << (result.isFailed() ? result.failure() : "discarded"); + LOG(WARNING) << check.type() << " check for task '" << taskId << "' failed:" + << " " << (future.isFailed() ? future.failure() : "discarded"); - checkStatusInfo.mutable_http(); + result.mutable_http(); } - processCheckResult(stopwatch, checkStatusInfo); + processCheckResult(stopwatch, result); } namespace validation {
