Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DF41B200C38 for ; Wed, 15 Mar 2017 18:51:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DDF79160B9D; Wed, 15 Mar 2017 17:51:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 91511160B96 for ; Wed, 15 Mar 2017 18:51:06 +0100 (CET) Received: (qmail 10760 invoked by uid 500); 15 Mar 2017 17:51:05 -0000 Mailing-List: contact commits-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list commits@geode.apache.org Received: (qmail 10091 invoked by uid 99); 15 Mar 2017 17:51:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Mar 2017 17:51:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 18145F4B66; Wed, 15 Mar 2017 17:51:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jbarrett@apache.org To: commits@geode.apache.org Date: Wed, 15 Mar 2017 17:51:27 -0000 Message-Id: <2499a6f03a054666945264b93d135a07@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [26/34] geode-native git commit: GEODE-2494: Replace global statics with class scoped statics. archived-at: Wed, 15 Mar 2017 17:51:08 -0000 GEODE-2494: Replace global statics with class scoped statics. Project: http://git-wip-us.apache.org/repos/asf/geode-native/repo Commit: http://git-wip-us.apache.org/repos/asf/geode-native/commit/3dd36d60 Tree: http://git-wip-us.apache.org/repos/asf/geode-native/tree/3dd36d60 Diff: http://git-wip-us.apache.org/repos/asf/geode-native/diff/3dd36d60 Branch: refs/heads/feature/GEODE-2602 Commit: 3dd36d608a27696bba28f7b1dde6d8453f6217e2 Parents: 4dd2335 Author: Jacob Barrett Authored: Mon Feb 27 18:09:46 2017 -0800 Committer: Jacob Barrett Committed: Wed Mar 15 10:44:23 2017 -0700 ---------------------------------------------------------------------- src/cppcache/src/CqQueryVsdStats.cpp | 5 +---- src/cppcache/src/CqQueryVsdStats.hpp | 2 ++ src/cppcache/src/CqServiceVsdStats.cpp | 6 +----- src/cppcache/src/CqServiceVsdStats.hpp | 2 ++ src/cppcache/src/LRUList.hpp | 9 ++++----- src/cppcache/src/RegionStats.cpp | 3 --- src/cppcache/src/RegionStats.hpp | 2 ++ 7 files changed, 12 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode-native/blob/3dd36d60/src/cppcache/src/CqQueryVsdStats.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/src/CqQueryVsdStats.cpp b/src/cppcache/src/CqQueryVsdStats.cpp index ceb40a6..f24208a 100644 --- a/src/cppcache/src/CqQueryVsdStats.cpp +++ b/src/cppcache/src/CqQueryVsdStats.cpp @@ -26,9 +26,6 @@ #include "util/concurrent/spinlock_mutex.hpp" -const char* cqStatsName = "CqQueryStatistics"; -const char* cqStatsDesc = "Statistics for this cq query"; - //////////////////////////////////////////////////////////////////////////////// namespace apache { @@ -65,7 +62,7 @@ StatisticsType* CqQueryStatType::getStatType() { "events", "The total number of events for this cq query", "entries", largerIsBetter); - statsType = factory->createType(cqStatsName, cqStatsDesc, m_stats, 4); + statsType = factory->createType(statsName, statsDesc, m_stats, 4); m_numInsertsId = statsType->nameToId("inserts"); m_numUpdatesId = statsType->nameToId("updates"); http://git-wip-us.apache.org/repos/asf/geode-native/blob/3dd36d60/src/cppcache/src/CqQueryVsdStats.hpp ---------------------------------------------------------------------- diff --git a/src/cppcache/src/CqQueryVsdStats.hpp b/src/cppcache/src/CqQueryVsdStats.hpp index 3cc5672..fdfae5a 100644 --- a/src/cppcache/src/CqQueryVsdStats.hpp +++ b/src/cppcache/src/CqQueryVsdStats.hpp @@ -79,6 +79,8 @@ class CPPCACHE_EXPORT CqQueryVsdStats : public CqStatistics { class CqQueryStatType { private: static spinlock_mutex m_statTypeLock; + static constexpr const char* statsName = "CqQueryStatistics"; + static constexpr const char* statsDesc = "Statistics for this cq query"; public: static CqQueryStatType& getInstance(); http://git-wip-us.apache.org/repos/asf/geode-native/blob/3dd36d60/src/cppcache/src/CqServiceVsdStats.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/src/CqServiceVsdStats.cpp b/src/cppcache/src/CqServiceVsdStats.cpp index 08f331b..562224f 100644 --- a/src/cppcache/src/CqServiceVsdStats.cpp +++ b/src/cppcache/src/CqServiceVsdStats.cpp @@ -26,9 +26,6 @@ #include "util/concurrent/spinlock_mutex.hpp" -const char* cqServiceStatsName = "CqServiceStatistics"; -const char* cqServiceStatsDesc = "Statistics for this cq Service"; - //////////////////////////////////////////////////////////////////////////////// namespace apache { @@ -69,8 +66,7 @@ StatisticsType* CqServiceStatType::getStatType() { "The total number of Cqs on the client for this cq Service", "entries", largerIsBetter); - statsType = - factory->createType(cqServiceStatsName, cqServiceStatsDesc, m_stats, 5); + statsType = factory->createType(statsName, statsDesc, m_stats, 5); m_numCqsActiveId = statsType->nameToId("CqsActive"); m_numCqsCreatedId = statsType->nameToId("CqsCreated"); http://git-wip-us.apache.org/repos/asf/geode-native/blob/3dd36d60/src/cppcache/src/CqServiceVsdStats.hpp ---------------------------------------------------------------------- diff --git a/src/cppcache/src/CqServiceVsdStats.hpp b/src/cppcache/src/CqServiceVsdStats.hpp index 710dfdb..9946e2b 100644 --- a/src/cppcache/src/CqServiceVsdStats.hpp +++ b/src/cppcache/src/CqServiceVsdStats.hpp @@ -113,6 +113,8 @@ class CPPCACHE_EXPORT CqServiceVsdStats : public CqServiceStatistics { class CqServiceStatType { private: static spinlock_mutex m_statTypeLock; + static constexpr const char* statsName = "CqServiceStatistics"; + static constexpr const char* statsDesc = "Statistics for this cq Service"; public: static CqServiceStatType& getInstance(); http://git-wip-us.apache.org/repos/asf/geode-native/blob/3dd36d60/src/cppcache/src/LRUList.hpp ---------------------------------------------------------------------- diff --git a/src/cppcache/src/LRUList.hpp b/src/cppcache/src/LRUList.hpp index fc18fcd..0364ac6 100644 --- a/src/cppcache/src/LRUList.hpp +++ b/src/cppcache/src/LRUList.hpp @@ -31,11 +31,6 @@ namespace apache { namespace geode { namespace client { -// Bit mask for recently used -#define RECENTLY_USED_BITS 1u -// Bit mask for evicted -#define EVICTED_BITS 2u - /** * @brief This class encapsulates LRU specific properties for a LRUList node. */ @@ -72,6 +67,10 @@ class CPPCACHE_EXPORT LRUEntryProperties { private: std::atomic m_bits; void* m_persistenceInfo; + // Bit mask for recently used + static constexpr uint32_t RECENTLY_USED_BITS = 1u; + // Bit mask for evicted + static constexpr uint32_t EVICTED_BITS = 2u; }; using util::concurrent::spinlock_mutex; http://git-wip-us.apache.org/repos/asf/geode-native/blob/3dd36d60/src/cppcache/src/RegionStats.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/src/RegionStats.cpp b/src/cppcache/src/RegionStats.cpp index 285cf76..677ec7c 100644 --- a/src/cppcache/src/RegionStats.cpp +++ b/src/cppcache/src/RegionStats.cpp @@ -27,9 +27,6 @@ #include "util/concurrent/spinlock_mutex.hpp" -const char* statsName = "RegionStatistics"; -const char* statsDesc = "Statistics for this region"; - //////////////////////////////////////////////////////////////////////////////// namespace apache { http://git-wip-us.apache.org/repos/asf/geode-native/blob/3dd36d60/src/cppcache/src/RegionStats.hpp ---------------------------------------------------------------------- diff --git a/src/cppcache/src/RegionStats.hpp b/src/cppcache/src/RegionStats.hpp index 1f72d77..30ad7df 100644 --- a/src/cppcache/src/RegionStats.hpp +++ b/src/cppcache/src/RegionStats.hpp @@ -132,6 +132,8 @@ class RegionStatType { static RegionStatType* single; static spinlock_mutex m_singletonLock; static spinlock_mutex m_statTypeLock; + static constexpr const char* statsName = "RegionStatistics"; + static constexpr const char* statsDesc = "Statistics for this region"; public: static RegionStatType* getInstance();