From 13a541e4bbcb9af6405d26f3c38ee5a06bd8ccf5 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Fri, 7 Jul 2017 12:17:11 +0530 Subject: [PATCH] Lets do away with this Consistency. Change-Id: Iea670b77ab5f3f668183eac52f3ae8db92d79a40 --- wsd/AdminModel.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/wsd/AdminModel.cpp b/wsd/AdminModel.cpp index 440de191c..c90dd0eb4 100644 --- a/wsd/AdminModel.cpp +++ b/wsd/AdminModel.cpp @@ -50,7 +50,7 @@ int Document::expireView(const std::string& sessionId) if (--_activeViews == 0) _end = std::time(nullptr); } - this->takeSnapshot(); + takeSnapshot(); return _activeViews; } @@ -61,12 +61,12 @@ std::pair Document::getSnapshot() const std::ostringstream oss; oss << "{"; oss << "\"creationTime\"" << ":" << ct << ","; - oss << "\"memoryDirty\"" << ":" << this->getMemoryDirty() << ","; - oss << "\"activeViews\"" << ":" << this->getActiveViews() << ","; + oss << "\"memoryDirty\"" << ":" << getMemoryDirty() << ","; + oss << "\"activeViews\"" << ":" << getActiveViews() << ","; oss << "\"views\"" << ":["; std::string separator; - for (auto view : this->getViews()) + for (auto view : getViews()) { oss << separator << "\""; if(view.second.isExpired()) @@ -78,7 +78,7 @@ std::pair Document::getSnapshot() const } oss << "],"; - oss << "\"lastActivity\"" << ":" << this->_lastActivity; + oss << "\"lastActivity\"" << ":" << _lastActivity; oss << "}"; return std::make_pair(ct, oss.str()); } @@ -87,11 +87,11 @@ const std::string Document::getHistory() const { std::ostringstream oss; oss << "{"; - oss << "\"docKey\"" << ":\"" << this->_docKey << "\","; - oss << "\"filename\"" << ":\"" << this->getFilename() << "\","; - oss << "\"start\"" << ":" << this->_start << ","; - oss << "\"end\"" << ":" << this->_end << ","; - oss << "\"pid\"" << ":" << this->getPid() << ","; + oss << "\"docKey\"" << ":\"" << _docKey << "\","; + oss << "\"filename\"" << ":\"" << getFilename() << "\","; + oss << "\"start\"" << ":" << _start << ","; + oss << "\"end\"" << ":" << _end << ","; + oss << "\"pid\"" << ":" << getPid() << ","; oss << "\"snapshots\"" << ":["; std::string separator; for (auto s : _snapshots) @@ -105,7 +105,7 @@ const std::string Document::getHistory() const void Document::takeSnapshot() { - auto p = this->getSnapshot(); + auto p = getSnapshot(); auto insPoint = _snapshots.upper_bound(p.first); _snapshots.insert(insPoint, p); } @@ -114,13 +114,13 @@ std::string Document::to_string() const { std::ostringstream oss; std::string encodedFilename; - Poco::URI::encode(this->getFilename(), " ", encodedFilename); - oss << this->getPid() << ' ' + Poco::URI::encode(getFilename(), " ", encodedFilename); + oss << getPid() << ' ' << encodedFilename << ' ' - << this->getActiveViews() << ' ' - << this->getMemoryDirty() << ' ' - << this->getElapsedTime() << ' ' - << this->getIdleTime() << ' '; + << getActiveViews() << ' ' + << getMemoryDirty() << ' ' + << getElapsedTime() << ' ' + << getIdleTime() << ' '; return oss.str(); }