geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbarr...@apache.org
Subject [04/23] geode-native git commit: GEODE-2741: Code cleanup to move to std::shared_ptr
Date Tue, 06 Jun 2017 17:56:30 GMT
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/ThinClientRegion.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/ThinClientRegion.cpp b/src/cppcache/src/ThinClientRegion.cpp
index d9ee994..00ae127 100644
--- a/src/cppcache/src/ThinClientRegion.cpp
+++ b/src/cppcache/src/ThinClientRegion.cpp
@@ -406,7 +406,7 @@ void ThinClientRegion::registerKeys(const VectorOfCacheableKey& keys,
   LOGDEBUG("ThinClientRegion::registerKeys : interestpolicy is %d",
            interestPolicy.ordinal);
 
-  GfErrType err = registerKeysNoThrow(keys, true, NULL, isDurable,
+  GfErrType err = registerKeysNoThrow(keys, true, nullptr, isDurable,
                                       interestPolicy, receiveValues);
 
   if (m_tcrdm->isFatalError(err)) {
@@ -491,8 +491,9 @@ void ThinClientRegion::registerAllKeys(bool isDurable,
   //  if we need to fetch initial data, then we get the keys in
   // that call itself using the special GET_ALL message and do not need
   // to get the keys in the initial  register interest  call
-  GfErrType err = registerRegexNoThrow(".*", true, NULL, isDurable, resultKeys,
-                                       interestPolicy, receiveValues);
+  GfErrType err =
+      registerRegexNoThrow(".*", true, nullptr, isDurable, resultKeys,
+                           interestPolicy, receiveValues);
 
   if (m_tcrdm->isFatalError(err)) {
     GfErrTypeToException("Region::registerAllKeys", err);
@@ -527,7 +528,7 @@ void ThinClientRegion::registerRegex(const char* regex, bool isDurable,
         "Durable flag only applicable for durable clients");
   }
 
-  if (regex == NULL || regex[0] == '\0') {
+  if (regex == nullptr || regex[0] == '\0') {
     throw IllegalArgumentException(
         "Region::registerRegex: Regex string is empty");
   }
@@ -555,8 +556,9 @@ void ThinClientRegion::registerRegex(const char* regex, bool isDurable,
   //  if we need to fetch initial data for "allKeys" case, then we
   // get the keys in that call itself using the special GET_ALL message and
   // do not need to get the keys in the initial  register interest  call
-  GfErrType err = registerRegexNoThrow(
-      sregex, true, NULL, isDurable, resultKeys, interestPolicy, receiveValues);
+  GfErrType err =
+      registerRegexNoThrow(sregex, true, nullptr, isDurable, resultKeys,
+                           interestPolicy, receiveValues);
 
   if (m_tcrdm->isFatalError(err)) {
     GfErrTypeToException("Region::registerRegex", err);
@@ -582,7 +584,7 @@ void ThinClientRegion::unregisterRegex(const char* regex) {
     }
   }
 
-  if (regex == NULL || regex[0] == '\0') {
+  if (regex == nullptr || regex[0] == '\0') {
     LOGERROR("Unregister regex string is empty");
     throw IllegalArgumentException("Unregister regex string is empty");
   }
@@ -614,7 +616,7 @@ SelectResultsPtr ThinClientRegion::query(const char* predicate,
                                          uint32_t timeout) {
   CHECK_DESTROY_PENDING(TryReadGuard, Region::query);
 
-  if (predicate == NULL || predicate[0] == '\0') {
+  if (predicate == nullptr || predicate[0] == '\0') {
     LOGERROR("Region query predicate string is empty");
     throw IllegalArgumentException("Region query predicate string is empty");
   }
@@ -798,7 +800,7 @@ bool ThinClientRegion::containsKeyOnServer(
   bool ret = false;
   TXState* txState = getTXState();
 
-  if (txState != NULL) {
+  if (txState != nullptr) {
     //		if (!txState->isReplay()) {
     //			auto args = std::make_shared<VectorOfCacheable>();
     //			txState->recordTXOperation(GF_CONTAINS_KEY,
@@ -854,7 +856,7 @@ bool ThinClientRegion::containsValueForKey_remote(
   bool ret = false;
   TXState* txState = getTXState();
 
-  if (txState != NULL) {
+  if (txState != nullptr) {
     //		if (!txState->isReplay()) {
     //			auto args = std::make_shared<VectorOfCacheable>();
     //			txState->recordTXOperation(GF_CONTAINS_VALUE_FOR_KEY,
@@ -1030,7 +1032,7 @@ GfErrType ThinClientRegion::putNoThrow_remote(
   bool delta = false;
   const char* conFlationValue =
       DistributedSystem::getSystemProperties()->conflateEvents();
-  if (checkDelta && valuePtr != nullptr && conFlationValue != NULL &&
+  if (checkDelta && valuePtr != nullptr && conFlationValue != nullptr &&
       strcmp(conFlationValue, "true") != 0 &&
       ThinClientBaseDM::isDeltaEnabledOnServer()) {
     Delta* temp = dynamic_cast<Delta*>(valuePtr.get());
@@ -1077,7 +1079,7 @@ GfErrType ThinClientRegion::putNoThrow_remote(
     }
   }
   delete reply;
-  reply = NULL;
+  reply = nullptr;
   return err;
 }
 
@@ -1222,7 +1224,7 @@ GfErrType ThinClientRegion::getAllNoThrow_remote(
   addToLocalCache = addToLocalCache && m_regionAttributes->getCachingEnabled();
   if (addToLocalCache && !m_regionAttributes->getConcurrencyChecksEnabled()) {
     // start tracking the entries
-    if (keys == NULL) {
+    if (keys == nullptr) {
       // track all entries with destroy tracking for non-existent entries
       destroyTracker = m_entries->addTrackerForAllEntries(updateCountMap, true);
     } else {
@@ -1307,34 +1309,27 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
   /*Step-1::
    * populate the keys vector from the user Map and pass it to the
    * getServerToFilterMap to generate locationMap
-   * If locationMap is NULL try the old, existing putAll impl that may take
+   * If locationMap is nullptr try the old, existing putAll impl that may take
    * multiple n/w hops
    */
-  VectorOfCacheableKey* userKeys = new VectorOfCacheableKey();
-  for (HashMapOfCacheable::Iterator iter = map.begin(); iter != map.end();
-       ++iter) {
-    userKeys->push_back(iter.first());
+  VectorOfCacheableKey userKeys = VectorOfCacheableKey();
+  for (const auto& iter : map) {
+    userKeys.push_back(iter.first);
   }
   // last param in getServerToFilterMap() is false for putAll
 
   // LOGDEBUG("ThinClientRegion::singleHopPutAllNoThrow_remote keys.size() = %d
   // ", userKeys->size());
-  HashMapT<BucketServerLocationPtr, VectorOfCacheableKeyPtr>* locationMap =
-      tcrdm->getClientMetaDataService()->getServerToFilterMap(userKeys, region,
-                                                              true);
-  if (locationMap == NULL) {
+  auto locationMap = tcrdm->getClientMetaDataService()->getServerToFilterMap(
+      userKeys, region, true);
+  if (!locationMap) {
     // putAll with multiple hop implementation
     LOGDEBUG("locationMap is Null or Empty");
-    delete userKeys;
-    userKeys = NULL;
 
     return multiHopPutAllNoThrow_remote(map, versionedObjPartList, timeout,
                                         aCallbackArgument);
   }
 
-  delete userKeys;
-  userKeys = NULL;
-
   // set this flag that indicates putAll on PR is invoked with singlehop
   // enabled.
   m_isPRSingleHopEnabled = true;
@@ -1354,24 +1349,20 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
   std::vector<PutAllWork*> putAllWorkers;
   ThreadPool* threadPool = TPSingleton::instance();
   int locationMapIndex = 0;
-  for (HashMapT<BucketServerLocationPtr, VectorOfCacheableKeyPtr>::Iterator
-           locationIter = locationMap->begin();
-       locationIter != locationMap->end(); locationIter++) {
-    BucketServerLocationPtr serverLocation = locationIter.first();
+  for (const auto& locationIter : *locationMap) {
+    const auto& serverLocation = locationIter.first;
     if (serverLocation == nullptr) {
       LOGDEBUG("serverLocation is nullptr");
     }
-    VectorOfCacheableKeyPtr keys = locationIter.second();
+    const auto& keys = locationIter.second;
 
     // Create server specific Sub-Map by iterating over keys.
     auto filteredMap = std::make_shared<HashMapOfCacheable>();
     if (keys != nullptr && keys->size() > 0) {
-      for (int32_t index = 0; index < keys->size(); index++) {
-        HashMapOfCacheable::Iterator iter = map.find(keys->at(index));
+      for (const auto& key : *keys) {
+        const auto& iter = map.find(key);
         if (iter != map.end()) {
-          filteredMap->insert(iter.first(), iter.second());
-        } else {
-          LOGDEBUG("DEBUG:: KEY not found in user MAP");
+          filteredMap->emplace(iter->first, iter->second);
         }
       }
     }
@@ -1379,8 +1370,7 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
     // TEST-CODE :: PRINT each sub-Map entries
     /*
     LOGDEBUG("Printing map at %d locationMapindex ", locationMapIndex);
-    for (HashMapOfCacheable::Iterator filteredMapIter = filteredMap->begin();
-    filteredMapIter != filteredMap->end(); ++filteredMapIter) {
+    for (const auto& filteredMapIter : *filteredMap){
       auto kPtr =
     std::dynamic_pointer_cast<CacheableInt32>(filteredMapIter.first()) ;
       auto vPtr =
@@ -1413,36 +1403,31 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
    * Value is a ErrorCode.
    * b. delete the worker
    */
-  HashMapT<BucketServerLocationPtr, SerializablePtr>* resultMap =
-      new HashMapT<BucketServerLocationPtr, SerializablePtr>();
-  HashMapT<BucketServerLocationPtr, CacheableInt32Ptr>* failedServers =
-      new HashMapT<BucketServerLocationPtr, CacheableInt32Ptr>();
-
-  for (std::vector<PutAllWork*>::iterator iter = putAllWorkers.begin();
-       iter != putAllWorkers.end(); iter++) {
-    PutAllWork* worker = *iter;
+  auto resultMap = ResultMap();
+  auto failedServers = FailedServersMap();
 
-    GfErrType err =
+  for (const auto& worker : putAllWorkers) {
+    auto err =
         worker->getResult();  // wait() or blocking call for worker thread.
     LOGDEBUG("Error code :: %s:%d err = %d ", __FILE__, __LINE__, err);
 
-    if (err != GF_NOERR) {
+    if (GF_NOERR == err) {
+      // No Exception from server
+      resultMap.emplace(worker->getServerLocation(),
+                        worker->getResultCollector()->getList());
+    } else {
       error = err;
 
       if (error == GF_PUTALL_PARTIAL_RESULT_EXCEPTION) {
-        resultMap->insert(worker->getServerLocation(),
+        resultMap.emplace(worker->getServerLocation(),
                           worker->getPaPResultException());
       } else if (error == GF_NOTCON) {
         // Refresh the metadata in case of GF_NOTCON.
         tcrdm->getClientMetaDataService()->enqueueForMetadataRefresh(
             region->getFullPath(), 0);
       }
-      failedServers->insert(worker->getServerLocation(),
+      failedServers.emplace(worker->getServerLocation(),
                             CacheableInt32::create(error));
-    } else {
-      // No Exception from server
-      resultMap->insert(worker->getServerLocation(),
-                        worker->getResultCollector()->getList());
     }
 
     LOGDEBUG("worker->getPutAllMap()->size() = %d ",
@@ -1472,50 +1457,36 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
    * PutAllPartialResultServerException
    */
   ACE_Recursive_Thread_Mutex responseLock;
-  auto result = std::make_shared<PutAllPartialResult>(map.size(), responseLock);
+  auto result = std::make_shared<PutAllPartialResult>(
+      static_cast<int>(map.size()), responseLock);
   LOGDEBUG(
       " TCRegion:: %s:%d  "
       "result->getSucceededKeysAndVersions()->getVersionedTagsize() = %d ",
       __FILE__, __LINE__,
       result->getSucceededKeysAndVersions()->getVersionedTagsize());
   LOGDEBUG(" TCRegion:: %s:%d resultMap->size() ", __FILE__, __LINE__,
-           resultMap->size());
-  for (HashMapT<BucketServerLocationPtr, SerializablePtr>::Iterator
-           resultMapIter = resultMap->begin();
-       resultMapIter != resultMap->end(); resultMapIter++) {
-    SerializablePtr value = resultMapIter.second();
-    PutAllPartialResultServerException* papException = NULL;
-    VersionedCacheableObjectPartListPtr list = nullptr;
+           resultMap.size());
+  for (const auto& resultMapIter : resultMap) {
+    const auto& value = resultMapIter.second;
 
-    papException =
-        dynamic_cast<PutAllPartialResultServerException*>(value.get());
-    // LOGDEBUG(" TCRegion:: %s:%d
-    // result->getSucceededKeysAndVersions()->getVersionedTagsize() = %d ",
-    // __FILE__, __LINE__,
-    // result->getSucceededKeysAndVersions()->getVersionedTagsize());
-    if (papException != NULL) {
+    if (const auto papException =
+            std::dynamic_pointer_cast<PutAllPartialResultServerException>(
+                value)) {
       // PutAllPartialResultServerException CASE:: value in resultMap is of type
       // PutAllPartialResultServerException.
       // TODO:: Add failedservers.keySet= all fialed servers, i.e list out all
       // keys in map failedServers,
       //       that is set view of the keys contained in failedservers map.
-      // LOGDEBUG("TCRegion:: PutAll SingleHop encountered
-      // PutAllPartialResultServerException exception: %s , failedServers are:
-      // ", papException->getMessage()->asChar());
       // TODO:: need to read  papException and populate PutAllPartialResult.
       result->consolidate(papException->getResult());
-    } else if (value != nullptr &&
-               (list =
-                    std::dynamic_pointer_cast<VersionedCacheableObjectPartList>(
-                        value)) != nullptr) {
+    } else if (const auto list =
+                   std::dynamic_pointer_cast<VersionedCacheableObjectPartList>(
+                       value)) {
       // value in resultMap is of type VCOPL.
-      // LOGDEBUG("TCRegion::  %s:%d :: list->getSucceededKeys()->size()=%d
-      // list->getVersionedTagsize() = %d", __FILE__, __LINE__,
-      // list->getSucceededKeys()->size(), list->getVersionedTagsize());
       result->addKeysAndVersions(list);
     } else {
       // ERROR CASE
-      if (value != nullptr) {
+      if (value) {
         LOGERROR(
             "ERROR:: ThinClientRegion::singleHopPutAllNoThrow_remote value "
             "could not Cast to either VCOPL or "
@@ -1524,7 +1495,7 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
       } else {
         LOGERROR(
             "ERROR:: ThinClientRegion::singleHopPutAllNoThrow_remote value is "
-            "NULL");
+            "nullptr");
       }
     }
   }
@@ -1538,21 +1509,19 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
    */
 
   LOGDEBUG("ThinClientRegion:: %s:%d failedServers->size() = %d", __FILE__,
-           __LINE__, failedServers->size());
+           __LINE__, failedServers.size());
 
   // if the partial result set doesn't already have keys (for tracking version
   // tags)
   // then we need to gather up the keys that we know have succeeded so far and
   // add them to the partial result set (See bug Id #955)
-  if (failedServers->size() > 0) {
+  if (!failedServers.empty()) {
     auto succeedKeySet = std::make_shared<VectorOfCacheableKey>();
     if (result->getSucceededKeysAndVersions()->size() == 0) {
-      for (HashMapT<BucketServerLocationPtr, VectorOfCacheableKeyPtr>::Iterator
-               locationIter = locationMap->begin();
-           locationIter != locationMap->end(); locationIter++) {
-        if (!failedServers->contains(locationIter.first())) {
-          for (int32_t i = 0; i < locationIter.second()->size(); i++) {
-            succeedKeySet->push_back(locationIter.second()->at(i));
+      for (const auto& locationIter : *locationMap) {
+        if (failedServers.find(locationIter.first) != failedServers.end()) {
+          for (const auto& i : *(locationIter.second)) {
+            succeedKeySet->push_back(i);
           }
         }
       }
@@ -1570,10 +1539,8 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
    */
   error = GF_NOERR;
   bool oneSubMapRetryFailed = false;
-  for (HashMapT<BucketServerLocationPtr, CacheableInt32Ptr>::Iterator
-           failedServerIter = failedServers->begin();
-       failedServerIter != failedServers->end(); failedServerIter++) {
-    if (failedServerIter.second()->value() ==
+  for (const auto& failedServerIter : failedServers) {
+    if (failedServerIter.second->value() ==
         GF_PUTALL_PARTIAL_RESULT_EXCEPTION) {  // serverLocation
       // will not retry for PutAllPartialResultException
       // but it means at least one sub map ever failed
@@ -1581,25 +1548,26 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
       error = GF_PUTALL_PARTIAL_RESULT_EXCEPTION;
       continue;
     }
-    HashMapT<BucketServerLocationPtr, VectorOfCacheableKeyPtr>::Iterator
-        failedSerInLocMapIter = locationMap->find(failedServerIter.first());
+
     VectorOfCacheableKeyPtr failedKeys = nullptr;
+    const auto& failedSerInLocMapIter =
+        locationMap->find(failedServerIter.first);
     if (failedSerInLocMapIter != locationMap->end()) {
-      failedKeys = failedSerInLocMapIter.second();
+      failedKeys = failedSerInLocMapIter->second;
     }
 
     if (failedKeys == nullptr) {
       LOGERROR(
-          "TCRegion::singleHopPutAllNoThrow_remote :: failedKeys are NULL that "
-          "is not valid");
+          "TCRegion::singleHopPutAllNoThrow_remote :: failedKeys are nullptr "
+          "that is not valid");
     }
 
     auto newSubMap = std::make_shared<HashMapOfCacheable>();
-    if (failedKeys != nullptr && failedKeys->size() > 0) {
-      for (int32_t index = 0; index < failedKeys->size(); index++) {
-        HashMapOfCacheable::Iterator iter = map.find(failedKeys->at(index));
+    if (failedKeys && !failedKeys->empty()) {
+      for (const auto& key : *failedKeys) {
+        const auto& iter = map.find(key);
         if (iter != map.end()) {
-          newSubMap->insert(iter.first(), iter.second());
+          newSubMap->emplace(iter->first, iter->second);
         } else {
           LOGERROR(
               "DEBUG:: TCRegion.cpp singleHopPutAllNoThrow_remote KEY not "
@@ -1621,7 +1589,7 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
       error = errCode;
     } else /*if(errCode != GF_NOERR)*/ {
       oneSubMapRetryFailed = true;
-      CacheableKeyPtr firstKey = newSubMap->begin().first();
+      const auto& firstKey = newSubMap->begin()->first;
       ExceptionPtr excptPtr = nullptr;
       // TODO:: formulat excptPtr from the errCode
       result->saveFailedKey(firstKey, excptPtr);
@@ -1635,9 +1603,6 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
   versionedObjPartList = result->getSucceededKeysAndVersions();
   LOGDEBUG("singlehop versionedObjPartList = %d error=%d",
            versionedObjPartList->size(), error);
-  delete locationMap;
-  delete failedServers;
-  delete resultMap;
 
   return error;
 }
@@ -1715,10 +1680,10 @@ GfErrType ThinClientRegion::putAllNoThrow_remote(
   ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm);
   TXState* txState = TSSTXStateWrapper::s_geodeTSSTXState->getTXState();
 
-  if (poolDM != NULL) {
+  if (poolDM != nullptr) {
     if (poolDM->getPRSingleHopEnabled() &&
-        poolDM->getClientMetaDataService() != NULL &&
-        txState == NULL /*For Tx use multi-hop*/) {
+        poolDM->getClientMetaDataService() != nullptr &&
+        txState == nullptr /*For Tx use multi-hop*/) {
       return singleHopPutAllNoThrow_remote(poolDM, map, versionedObjPartList,
                                            timeout, aCallbackArgument);
     } else {
@@ -1740,10 +1705,9 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
   RegionPtr region = shared_from_this();
   GfErrType error = GF_NOERR;
 
-  HashMapT<BucketServerLocationPtr, VectorOfCacheableKeyPtr>* locationMap =
-      tcrdm->getClientMetaDataService()->getServerToFilterMap(&keys, region,
-                                                              true);
-  if (locationMap == NULL) {
+  auto locationMap = tcrdm->getClientMetaDataService()->getServerToFilterMap(
+      keys, region, true);
+  if (!locationMap) {
     // removeAll with multiple hop implementation
     LOGDEBUG("locationMap is Null or Empty");
     return multiHopRemoveAllNoThrow_remote(keys, versionedObjPartList,
@@ -1769,15 +1733,13 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
   std::vector<RemoveAllWork*> removeAllWorkers;
   ThreadPool* threadPool = TPSingleton::instance();
   int locationMapIndex = 0;
-  for (HashMapT<BucketServerLocationPtr, VectorOfCacheableKeyPtr>::Iterator
-           locationIter = locationMap->begin();
-       locationIter != locationMap->end(); locationIter++) {
-    BucketServerLocationPtr serverLocation = locationIter.first();
+  for (const auto& locationIter : *locationMap) {
+    const auto& serverLocation = locationIter.first;
     if (serverLocation == nullptr) {
       LOGDEBUG("serverLocation is nullptr");
     }
-    VectorOfCacheableKeyPtr mappedkeys = locationIter.second();
-    RemoveAllWork* worker = new RemoveAllWork(
+    const auto& mappedkeys = locationIter.second;
+    auto worker = new RemoveAllWork(
         tcrdm, serverLocation, region, true /*attemptFailover*/,
         false /*isBGThread*/, mappedkeys, aCallbackArgument);
     threadPool->perform(worker);
@@ -1800,35 +1762,30 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
    * Value is a ErrorCode.
    * b. delete the worker
    */
-  HashMapT<BucketServerLocationPtr, SerializablePtr>* resultMap =
-      new HashMapT<BucketServerLocationPtr, SerializablePtr>();
-  HashMapT<BucketServerLocationPtr, CacheableInt32Ptr>* failedServers =
-      new HashMapT<BucketServerLocationPtr, CacheableInt32Ptr>();
-  for (std::vector<RemoveAllWork*>::iterator iter = removeAllWorkers.begin();
-       iter != removeAllWorkers.end(); iter++) {
-    RemoveAllWork* worker = *iter;
-
-    GfErrType err =
+  auto resultMap = ResultMap();
+  auto failedServers = FailedServersMap();
+  for (const auto& worker : removeAllWorkers) {
+    auto err =
         worker->getResult();  // wait() or blocking call for worker thread.
     LOGDEBUG("Error code :: %s:%d err = %d ", __FILE__, __LINE__, err);
 
-    if (err != GF_NOERR) {
+    if (GF_NOERR == err) {
+      // No Exception from server
+      resultMap.emplace(worker->getServerLocation(),
+                        worker->getResultCollector()->getList());
+    } else {
       error = err;
 
       if (error == GF_PUTALL_PARTIAL_RESULT_EXCEPTION) {
-        resultMap->insert(worker->getServerLocation(),
+        resultMap.emplace(worker->getServerLocation(),
                           worker->getPaPResultException());
       } else if (error == GF_NOTCON) {
         // Refresh the metadata in case of GF_NOTCON.
         tcrdm->getClientMetaDataService()->enqueueForMetadataRefresh(
             region->getFullPath(), 0);
       }
-      failedServers->insert(worker->getServerLocation(),
+      failedServers.emplace(worker->getServerLocation(),
                             CacheableInt32::create(error));
-    } else {
-      // No Exception from server
-      resultMap->insert(worker->getServerLocation(),
-                        worker->getResultCollector()->getList());
     }
 
     LOGDEBUG(
@@ -1847,47 +1804,38 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
    * PutAllPartialResultServerException
    */
   ACE_Recursive_Thread_Mutex responseLock;
-  auto result =
-      std::make_shared<PutAllPartialResult>(keys.size(), responseLock);
+  auto result = std::make_shared<PutAllPartialResult>(
+      static_cast<int>(keys.size()), responseLock);
   LOGDEBUG(
       " TCRegion:: %s:%d  "
       "result->getSucceededKeysAndVersions()->getVersionedTagsize() = %d ",
       __FILE__, __LINE__,
       result->getSucceededKeysAndVersions()->getVersionedTagsize());
   LOGDEBUG(" TCRegion:: %s:%d resultMap->size() ", __FILE__, __LINE__,
-           resultMap->size());
-  for (HashMapT<BucketServerLocationPtr, SerializablePtr>::Iterator
-           resultMapIter = resultMap->begin();
-       resultMapIter != resultMap->end(); resultMapIter++) {
-    SerializablePtr value = resultMapIter.second();
-    PutAllPartialResultServerException* papException = NULL;
+           resultMap.size());
+  for (const auto& resultMapIter : resultMap) {
+    const auto& value = resultMapIter.second;
+    PutAllPartialResultServerException* papException = nullptr;
     VersionedCacheableObjectPartListPtr list = nullptr;
 
-    papException =
-        dynamic_cast<PutAllPartialResultServerException*>(value.get());
-    if (papException != NULL) {
+    if (const auto papException =
+            std::dynamic_pointer_cast<PutAllPartialResultServerException>(
+                value)) {
       // PutAllPartialResultServerException CASE:: value in resultMap is of type
       // PutAllPartialResultServerException.
       // TODO:: Add failedservers.keySet= all fialed servers, i.e list out all
       // keys in map failedServers,
       //       that is set view of the keys contained in failedservers map.
-      // LOGDEBUG("TCRegion:: PutAll SingleHop encountered
-      // PutAllPartialResultServerException exception: %s , failedServers are:
-      // ", papException->getMessage()->asChar());
       // TODO:: need to read  papException and populate PutAllPartialResult.
       result->consolidate(papException->getResult());
-    } else if (value != nullptr &&
-               (list =
-                    std::dynamic_pointer_cast<VersionedCacheableObjectPartList>(
-                        value)) != nullptr) {
+    } else if (const auto list =
+                   std::dynamic_pointer_cast<VersionedCacheableObjectPartList>(
+                       value)) {
       // value in resultMap is of type VCOPL.
-      // LOGDEBUG("TCRegion::  %s:%d :: list->getSucceededKeys()->size()=%d
-      // list->getVersionedTagsize() = %d", __FILE__, __LINE__,
-      // list->getSucceededKeys()->size(), list->getVersionedTagsize());
       result->addKeysAndVersions(list);
     } else {
       // ERROR CASE
-      if (value != nullptr) {
+      if (value) {
         LOGERROR(
             "ERROR:: ThinClientRegion::singleHopRemoveAllNoThrow_remote value "
             "could not Cast to either VCOPL or "
@@ -1896,7 +1844,7 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
       } else {
         LOGERROR(
             "ERROR:: ThinClientRegion::singleHopRemoveAllNoThrow_remote value "
-            "is NULL");
+            "is nullptr");
       }
     }
   }
@@ -1910,21 +1858,19 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
    */
 
   LOGDEBUG("ThinClientRegion:: %s:%d failedServers->size() = %d", __FILE__,
-           __LINE__, failedServers->size());
+           __LINE__, failedServers.size());
 
   // if the partial result set doesn't already have keys (for tracking version
   // tags)
   // then we need to gather up the keys that we know have succeeded so far and
   // add them to the partial result set (See bug Id #955)
-  if (failedServers->size() > 0) {
+  if (!failedServers.empty()) {
     auto succeedKeySet = std::make_shared<VectorOfCacheableKey>();
     if (result->getSucceededKeysAndVersions()->size() == 0) {
-      for (HashMapT<BucketServerLocationPtr, VectorOfCacheableKeyPtr>::Iterator
-               locationIter = locationMap->begin();
-           locationIter != locationMap->end(); locationIter++) {
-        if (!failedServers->contains(locationIter.first())) {
-          for (int32_t i = 0; i < locationIter.second()->size(); i++) {
-            succeedKeySet->push_back(locationIter.second()->at(i));
+      for (const auto& locationIter : *locationMap) {
+        if (failedServers.find(locationIter.first) != failedServers.end()) {
+          for (const auto& i : *(locationIter.second)) {
+            succeedKeySet->push_back(i);
           }
         }
       }
@@ -1942,10 +1888,8 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
    */
   error = GF_NOERR;
   bool oneSubMapRetryFailed = false;
-  for (HashMapT<BucketServerLocationPtr, CacheableInt32Ptr>::Iterator
-           failedServerIter = failedServers->begin();
-       failedServerIter != failedServers->end(); failedServerIter++) {
-    if (failedServerIter.second()->value() ==
+  for (const auto& failedServerIter : failedServers) {
+    if (failedServerIter.second->value() ==
         GF_PUTALL_PARTIAL_RESULT_EXCEPTION) {  // serverLocation
       // will not retry for PutAllPartialResultException
       // but it means at least one sub map ever failed
@@ -1953,16 +1897,18 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
       error = GF_PUTALL_PARTIAL_RESULT_EXCEPTION;
       continue;
     }
-    HashMapT<BucketServerLocationPtr, VectorOfCacheableKeyPtr>::Iterator
-        failedSerInLocMapIter = locationMap->find(failedServerIter.first());
+
     VectorOfCacheableKeyPtr failedKeys = nullptr;
+    const auto& failedSerInLocMapIter =
+        locationMap->find(failedServerIter.first);
     if (failedSerInLocMapIter != locationMap->end()) {
-      failedKeys = failedSerInLocMapIter.second();
+      failedKeys = failedSerInLocMapIter->second;
     }
 
     if (failedKeys == nullptr) {
       LOGERROR(
-          "TCRegion::singleHopRemoveAllNoThrow_remote :: failedKeys are NULL "
+          "TCRegion::singleHopRemoveAllNoThrow_remote :: failedKeys are "
+          "nullptr "
           "that is not valid");
     }
 
@@ -1989,9 +1935,6 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
   versionedObjPartList = result->getSucceededKeysAndVersions();
   LOGDEBUG("singlehop versionedObjPartList = %d error=%d",
            versionedObjPartList->size(), error);
-  delete locationMap;
-  delete failedServers;
-  delete resultMap;
   return error;
 }
 
@@ -2058,10 +2001,10 @@ GfErrType ThinClientRegion::removeAllNoThrow_remote(
   ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm);
   TXState* txState = TSSTXStateWrapper::s_geodeTSSTXState->getTXState();
 
-  if (poolDM != NULL) {
+  if (poolDM != nullptr) {
     if (poolDM->getPRSingleHopEnabled() &&
-        poolDM->getClientMetaDataService() != NULL &&
-        txState == NULL /*For Tx use multi-hop*/) {
+        poolDM->getClientMetaDataService() != nullptr &&
+        txState == nullptr /*For Tx use multi-hop*/) {
       return singleHopRemoveAllNoThrow_remote(
           poolDM, keys, versionedObjPartList, aCallbackArgument);
     } else {
@@ -2181,17 +2124,17 @@ GfErrType ThinClientRegion::registerKeys(TcrEndpoint* endpoint,
                               endpoint, true, interestPolicy, false);
   err = opErr != GF_NOERR ? opErr : err;
 
-  if (request != NULL && request->getRegionName() == m_fullPath &&
+  if (request != nullptr && request->getRegionName() == m_fullPath &&
       (request->getMessageType() == TcrMessage::REGISTER_INTEREST ||
        request->getMessageType() == TcrMessage::REGISTER_INTEREST_LIST)) {
     const VectorOfCacheableKey* newKeysVec = request->getKeys();
     bool isDurable = request->isDurable();
     bool receiveValues = request->receiveValues();
-    if (newKeysVec == NULL || newKeysVec->empty()) {
+    if (newKeysVec == nullptr || newKeysVec->empty()) {
       const std::string& newRegex = request->getRegex();
       if (!newRegex.empty()) {
         if (request->getRegionName() != m_fullPath) {
-          reply = NULL;
+          reply = nullptr;
         }
         opErr = registerRegexNoThrow(
             newRegex, false, endpoint, isDurable, nullptr,
@@ -2331,7 +2274,7 @@ GfErrType ThinClientRegion::registerKeysNoThrow(
 
   TcrMessageReply replyLocal(true, m_tcrdm);
   bool needToCreateRC = true;
-  if (reply == NULL) {
+  if (reply == nullptr) {
     reply = &replyLocal;
   } else {
     needToCreateRC = false;
@@ -2344,7 +2287,7 @@ GfErrType ThinClientRegion::registerKeysNoThrow(
       this, keys, isDurable, getAttributes()->getCachingEnabled(),
       receiveValues, interestPolicy, m_tcrdm);
   ACE_Recursive_Thread_Mutex responseLock;
-  TcrChunkedResult* resultCollector = NULL;
+  TcrChunkedResult* resultCollector = nullptr;
   if (interestPolicy.ordinal == InterestResultPolicy::KEYS_VALUES.ordinal) {
     auto values = std::make_shared<HashMapOfCacheable>();
     auto exceptions = std::make_shared<HashMapOfException>();
@@ -2410,12 +2353,11 @@ GfErrType ThinClientRegion::unregisterKeysNoThrow(
   err = m_tcrdm->sendSyncRequestRegisterInterest(request, reply);
   if (err == GF_NOERR /*|| err == GF_CACHE_REDUNDANCY_FAILURE*/) {
     if (attemptFailover) {
-      for (VectorOfCacheableKey::Iterator iter = keys.begin();
-           iter != keys.end(); ++iter) {
-        m_interestList.erase(*iter);
-        m_durableInterestList.erase(*iter);
-        m_interestListForUpdatesAsInvalidates.erase(*iter);
-        m_durableInterestListForUpdatesAsInvalidates.erase(*iter);
+      for (const auto& key : keys) {
+        m_interestList.erase(key);
+        m_durableInterestList.erase(key);
+        m_interestListForUpdatesAsInvalidates.erase(key);
+        m_durableInterestListForUpdatesAsInvalidates.erase(key);
       }
     }
   }
@@ -2445,12 +2387,11 @@ GfErrType ThinClientRegion::unregisterKeysNoThrowLocalDestroy(
   err = m_tcrdm->sendSyncRequestRegisterInterest(request, reply);
   if (err == GF_NOERR) {
     if (attemptFailover) {
-      for (VectorOfCacheableKey::Iterator iter = keys.begin();
-           iter != keys.end(); ++iter) {
-        m_interestList.erase(*iter);
-        m_durableInterestList.erase(*iter);
-        m_interestListForUpdatesAsInvalidates.erase(*iter);
-        m_durableInterestListForUpdatesAsInvalidates.erase(*iter);
+      for (const auto& key : keys) {
+        m_interestList.erase(key);
+        m_durableInterestList.erase(key);
+        m_interestListForUpdatesAsInvalidates.erase(key);
+        m_durableInterestListForUpdatesAsInvalidates.erase(key);
       }
     }
   }
@@ -2494,13 +2435,13 @@ GfErrType ThinClientRegion::registerRegexNoThrow(
   }
 
   TcrMessageReply replyLocal(true, m_tcrdm);
-  ChunkedInterestResponse* resultCollector = NULL;
-  ChunkedGetAllResponse* getAllResultCollector = NULL;
-  if (reply != NULL) {
+  ChunkedInterestResponse* resultCollector = nullptr;
+  ChunkedGetAllResponse* getAllResultCollector = nullptr;
+  if (reply != nullptr) {
     // need to check
     resultCollector = dynamic_cast<ChunkedInterestResponse*>(
         reply->getChunkedResultHandler());
-    if (resultCollector != NULL) {
+    if (resultCollector != nullptr) {
       resultKeys = resultCollector->getResultKeys();
     } else {
       getAllResultCollector = dynamic_cast<ChunkedGetAllResponse*>(
@@ -2518,7 +2459,7 @@ GfErrType ThinClientRegion::registerRegexNoThrow(
       m_fullPath, regex.c_str(), interestPolicy, isDurable,
       getAttributes()->getCachingEnabled(), receiveValues, m_tcrdm);
   ACE_Recursive_Thread_Mutex responseLock;
-  if (reply == NULL) {
+  if (reply == nullptr) {
     reply = &replyLocal;
     if (interestPolicy.ordinal == InterestResultPolicy::KEYS_VALUES.ordinal) {
       auto values = std::make_shared<HashMapOfCacheable>();
@@ -2530,7 +2471,7 @@ GfErrType ThinClientRegion::registerRegexNoThrow(
       }
       // need to check
       getAllResultCollector = (new ChunkedGetAllResponse(
-          request, this, NULL, values, exceptions, resultKeys, trackers,
+          request, this, nullptr, values, exceptions, resultKeys, trackers,
           destroyTracker, true, responseLock));
       reply->setChunkedResultHandler(getAllResultCollector);
       isRCCreatedLocally = true;
@@ -2557,8 +2498,9 @@ GfErrType ThinClientRegion::registerRegexNoThrow(
           localInvalidateRegion_internal();
         } else {
           const VectorOfCacheableKeyPtr& keys =
-              resultCollector != NULL ? resultCollector->getResultKeys()
-                                      : getAllResultCollector->getResultKeys();
+              resultCollector != nullptr
+                  ? resultCollector->getResultKeys()
+                  : getAllResultCollector->getResultKeys();
           if (keys != nullptr) {
             localInvalidateForRegisterInterest(*keys);
           }
@@ -2568,8 +2510,8 @@ GfErrType ThinClientRegion::registerRegexNoThrow(
   }
 
   if (isRCCreatedLocally == true) {
-    if (resultCollector != NULL) delete resultCollector;
-    if (getAllResultCollector != NULL) delete getAllResultCollector;
+    if (resultCollector != nullptr) delete resultCollector;
+    if (getAllResultCollector != nullptr) delete getAllResultCollector;
   }
   return err;
 }
@@ -2653,10 +2595,9 @@ void ThinClientRegion::addKeys(const VectorOfCacheableKey& keys, bool isDurable,
                 : (receiveValues ? m_interestList
                                  : m_interestListForUpdatesAsInvalidates);
 
-  for (VectorOfCacheableKey::Iterator iter = keys.begin(); iter != keys.end();
-       ++iter) {
-    interestList.insert(std::pair<CacheableKeyPtr, InterestResultPolicy>(
-        *iter, interestpolicy));
+  for (const auto& key : keys) {
+    interestList.insert(
+        std::pair<CacheableKeyPtr, InterestResultPolicy>(key, interestpolicy));
   }
 }
 
@@ -2805,36 +2746,37 @@ GfErrType ThinClientRegion::handleServerException(const char* func,
   GfErrType error = GF_NOERR;
   setTSSExceptionMessage(exceptionMsg);
   if (strstr(exceptionMsg,
-             "org.apache.geode.security.NotAuthorizedException") != NULL) {
+             "org.apache.geode.security.NotAuthorizedException") != nullptr) {
     error = GF_NOT_AUTHORIZED_EXCEPTION;
   } else if (strstr(exceptionMsg,
-                    "org.apache.geode.cache.CacheWriterException") != NULL) {
+                    "org.apache.geode.cache.CacheWriterException") != nullptr) {
     error = GF_CACHE_WRITER_EXCEPTION;
   } else if (strstr(
                  exceptionMsg,
                  "org.apache.geode.security.AuthenticationFailedException") !=
-             NULL) {
+             nullptr) {
     error = GF_AUTHENTICATION_FAILED_EXCEPTION;
   } else if (strstr(exceptionMsg,
                     "org.apache.geode.internal.cache.execute."
-                    "InternalFunctionInvocationTargetException") != NULL) {
+                    "InternalFunctionInvocationTargetException") != nullptr) {
     error = GF_FUNCTION_EXCEPTION;
   } else if (strstr(exceptionMsg,
-                    "org.apache.geode.cache.CommitConflictException") != NULL) {
+                    "org.apache.geode.cache.CommitConflictException") !=
+             nullptr) {
     error = GF_COMMIT_CONFLICT_EXCEPTION;
   } else if (strstr(exceptionMsg,
                     "org.apache.geode.cache."
-                    "TransactionDataNodeHasDepartedException") != NULL) {
+                    "TransactionDataNodeHasDepartedException") != nullptr) {
     error = GF_TRANSACTION_DATA_NODE_HAS_DEPARTED_EXCEPTION;
   } else if (strstr(
                  exceptionMsg,
                  "org.apache.geode.cache.TransactionDataRebalancedException") !=
-             NULL) {
+             nullptr) {
     error = GF_TRANSACTION_DATA_REBALANCED_EXCEPTION;
   } else if (strstr(
                  exceptionMsg,
                  "org.apache.geode.security.AuthenticationRequiredException") !=
-             NULL) {
+             nullptr) {
     error = GF_AUTHENTICATION_REQUIRED_EXCEPTION;
   } else {
     error = GF_CACHESERVER_EXCEPTION;
@@ -2878,10 +2820,9 @@ void ThinClientRegion::localInvalidateRegion_internal() {
 
   VectorOfCacheableKey keysVec;
   keys_internal(keysVec);
-  for (VectorOfCacheableKey::Iterator iter = keysVec.begin();
-       iter != keysVec.end(); ++iter) {
+  for (const auto& key : keysVec) {
     VersionTagPtr versionTag;
-    m_entries->invalidate(*iter, me, oldValue, versionTag);
+    m_entries->invalidate(key, me, oldValue, versionTag);
   }
 }
 
@@ -2893,11 +2834,9 @@ void ThinClientRegion::invalidateInterestList(
   if (!m_regionAttributes->getCachingEnabled()) {
     return;
   }
-  for (std::unordered_map<CacheableKeyPtr, InterestResultPolicy>::iterator
-           iter = interestList.begin();
-       iter != interestList.end(); ++iter) {
+  for (const auto& iter : interestList) {
     VersionTagPtr versionTag;
-    m_entries->invalidate(iter->first, me, oldValue, versionTag);
+    m_entries->invalidate(iter.first, me, oldValue, versionTag);
   }
 }
 
@@ -2926,11 +2865,9 @@ void ThinClientRegion::localInvalidateForRegisterInterest(
   CacheablePtr oldValue;
   MapEntryImplPtr me;
 
-  for (VectorOfCacheableKey::Iterator iter = keys.begin(); iter != keys.end();
-       ++iter) {
+  for (const auto& key : keys) {
     VersionTagPtr versionTag;
-    m_entries->invalidate(*iter, me, oldValue, versionTag);
-    // KN: New
+    m_entries->invalidate(key, me, oldValue, versionTag);
     updateAccessAndModifiedTimeForEntry(me, true);
   }
 }
@@ -2958,24 +2895,23 @@ void ThinClientRegion::registerInterestGetValues(
                                          true, nullptr);
     GfErrTypeToException(method, err);
     // log any exceptions here
-    for (HashMapOfException::Iterator iter = exceptions->begin();
-         iter != exceptions->end(); ++iter) {
+    for (const auto& iter : *exceptions) {
       LOGWARN("%s Exception for key %s:: %s: %s", method,
-              Utils::getCacheableKeyString(iter.first())->asChar(),
-              iter.second()->getName(), iter.second()->getMessage());
+              Utils::getCacheableKeyString(iter.first)->asChar(),
+              iter.second->getName(), iter.second->getMessage());
     }
   } catch (const Exception& ex) {
     LOGWARN("%s Exception while getting values: %s: %s", method, ex.getName(),
             ex.getMessage());
     std::string msg(method);
     msg += " failed in getting values";
-    throw EntryNotFoundException(msg.c_str(), NULL, false,
+    throw EntryNotFoundException(msg.c_str(), nullptr, false,
                                  ExceptionPtr(ex.clone()));
   }
 }
 
 void ThinClientRegion::destroyDM(bool keepEndpoints) {
-  if (m_tcrdm != NULL) {
+  if (m_tcrdm != nullptr) {
     m_tcrdm->destroy(keepEndpoints);
   }
 }
@@ -3035,7 +2971,7 @@ void ThinClientRegion::releaseGlobals(bool isFailover) {
 //	//if (csArray != nullptr && csArray->length() != 0) {
 //	//	for (int i = 0; i < csArray->length(); i++) {
 //	//		CacheableStringPtr cs = csArray[i];
-//	//		TcrEndpoint *ep = NULL;
+//	//		TcrEndpoint *ep = nullptr;
 // //     /*
 //	//		std::string endpointStr =
 // Utils::convertHostToCanonicalForm(
@@ -3151,15 +3087,12 @@ void ThinClientRegion::executeFunction(const char* func,
         rc->clearResults();
         CacheableHashSetPtr failedNodesIds(reply.getFailedNode());
         failedNodes->clear();
-        if (failedNodesIds != nullptr && failedNodesIds->size() > 0) {
+        if (failedNodesIds) {
           LOGDEBUG(
               "ThinClientRegion::executeFunction with GF_FUNCTION_EXCEPTION "
               "failedNodesIds size = %d ",
               failedNodesIds->size());
-          for (CacheableHashSet::Iterator itr = failedNodesIds->begin();
-               itr != failedNodesIds->end(); ++itr) {
-            failedNodes->insert(*itr);
-          }
+          failedNodes->insert(failedNodesIds->begin(), failedNodesIds->end());
         }
       } else if (err == GF_NOTCON) {
         attempt++;
@@ -3246,20 +3179,19 @@ CacheableVectorPtr ThinClientRegion::reExecuteFunction(
         rc->clearResults();
         CacheableHashSetPtr failedNodesIds(reply.getFailedNode());
         failedNodes->clear();
-        if (failedNodesIds != nullptr && failedNodesIds->size() > 0) {
+        if (failedNodesIds) {
           LOGDEBUG(
               "ThinClientRegion::reExecuteFunction with GF_FUNCTION_EXCEPTION "
               "failedNodesIds size = %d ",
               failedNodesIds->size());
-          for (CacheableHashSet::Iterator itr = failedNodesIds->begin();
-               itr != failedNodesIds->end(); ++itr) {
-            failedNodes->insert(*itr);
-          }
+          failedNodes->insert(failedNodesIds->begin(), failedNodesIds->end());
         }
-      } else if ((err == GF_NOTCON) || (err == GF_CLIENT_WAIT_TIMEOUT) || (err == GF_CLIENT_WAIT_TIMEOUT_REFRESH_PRMETADATA)) {
+      } else if ((err == GF_NOTCON) || (err == GF_CLIENT_WAIT_TIMEOUT) ||
+                 (err == GF_CLIENT_WAIT_TIMEOUT_REFRESH_PRMETADATA)) {
         attempt++;
         LOGDEBUG(
-            "ThinClientRegion::reExecuteFunction with GF_NOTCON OR TIMEOUT retry attempt "
+            "ThinClientRegion::reExecuteFunction with GF_NOTCON OR TIMEOUT "
+            "retry attempt "
             "= %d ",
             attempt);
         if (attempt > retryAttempts) {
@@ -3283,36 +3215,29 @@ CacheableVectorPtr ThinClientRegion::reExecuteFunction(
 bool ThinClientRegion::executeFunctionSH(
     const char* func, const CacheablePtr& args, uint8_t getResult,
     ResultCollectorPtr rc,
-    HashMapT<BucketServerLocationPtr, CacheableHashSetPtr>* locationMap,
+    const ClientMetadataService::ServerToKeysMapPtr& locationMap,
     CacheableHashSetPtr& failedNodes, uint32_t timeout, bool allBuckets) {
   bool reExecute = false;
   auto resultCollectorLock = std::make_shared<ACE_Recursive_Thread_Mutex>();
-  UserAttributesPtr userAttr =
+  auto& userAttr =
       TSSUserAttributesWrapper::s_geodeTSSUserAttributes->getUserAttributes();
   std::vector<OnRegionFunctionExecution*> feWorkers;
-  ThreadPool* threadPool = TPSingleton::instance();
+  auto threadPool = TPSingleton::instance();
 
-  for (HashMapT<BucketServerLocationPtr, CacheableHashSetPtr>::Iterator
-           locationIter = locationMap->begin();
-       locationIter != locationMap->end(); ++locationIter) {
-    BucketServerLocationPtr serverLocation = locationIter.first();
-    CacheableHashSetPtr buckets = locationIter.second();
-    OnRegionFunctionExecution* worker = new OnRegionFunctionExecution(
-        func, this, args, buckets, getResult, timeout,
+  for (const auto& locationIter : *locationMap) {
+    const auto& serverLocation = locationIter.first;
+    const auto& routingObj = locationIter.second;
+    auto worker = new OnRegionFunctionExecution(
+        func, this, args, routingObj, getResult, timeout,
         dynamic_cast<ThinClientPoolDM*>(m_tcrdm), resultCollectorLock, rc,
         userAttr, false, serverLocation, allBuckets);
     threadPool->perform(worker);
     feWorkers.push_back(worker);
   }
 
-  for (std::vector<OnRegionFunctionExecution*>::iterator iter =
-           feWorkers.begin();
-       iter != feWorkers.end(); ++iter) {
-    OnRegionFunctionExecution* worker = *iter;
-    GfErrType err = worker->getResult();
-    TcrMessage* currentReply = worker->getReply();
-
-
+  for (const auto& worker : feWorkers) {
+    auto err = worker->getResult();
+    auto currentReply = worker->getReply();
 
     if (err == GF_NOERR &&
         (currentReply->getMessageType() == TcrMessage::EXCEPTION ||
@@ -3323,14 +3248,13 @@ bool ThinClientRegion::executeFunctionSH(
     }
 
     if (err != GF_NOERR) {
-
       if (err == GF_FUNCTION_EXCEPTION) {
-
         reExecute = true;
-        ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm);
-        if ((poolDM != NULL) && (poolDM->getClientMetaDataService() != NULL)) {
-          poolDM->getClientMetaDataService()->enqueueForMetadataRefresh(
-              this->getFullPath(), 0);
+        if (auto poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm)) {
+          if (poolDM->getClientMetaDataService()) {
+            poolDM->getClientMetaDataService()->enqueueForMetadataRefresh(
+                this->getFullPath(), 0);
+          }
         }
         worker->getResultCollector()->reset();
         {
@@ -3338,24 +3262,24 @@ bool ThinClientRegion::executeFunctionSH(
           rc->clearResults();
         }
         CacheableHashSetPtr failedNodeIds(currentReply->getFailedNode());
-        if (failedNodeIds != nullptr && failedNodeIds->size() > 0) {
+        if (failedNodeIds) {
           LOGDEBUG(
               "ThinClientRegion::executeFunctionSH with GF_FUNCTION_EXCEPTION "
               "failedNodeIds size = %d ",
               failedNodeIds->size());
-          for (CacheableHashSet::Iterator itr = failedNodeIds->begin();
-               itr != failedNodeIds->end(); ++itr) {
-            failedNodes->insert(*itr);
-          }
+          failedNodes->insert(failedNodeIds->begin(), failedNodeIds->end());
         }
-      } else if ((err == GF_NOTCON) || (err == GF_CLIENT_WAIT_TIMEOUT) || (err == GF_CLIENT_WAIT_TIMEOUT_REFRESH_PRMETADATA)) {
-
+      } else if ((err == GF_NOTCON) || (err == GF_CLIENT_WAIT_TIMEOUT) ||
+                 (err == GF_CLIENT_WAIT_TIMEOUT_REFRESH_PRMETADATA)) {
         reExecute = true;
-        LOGINFO("ThinClientRegion::executeFunctionSH with GF_NOTCON or GF_CLIENT_WAIT_TIMEOUT ");
-        ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm);
-        if ((poolDM != NULL) && (poolDM->getClientMetaDataService() != NULL)) {
-          poolDM->getClientMetaDataService()->enqueueForMetadataRefresh(
-              this->getFullPath(), 0);
+        LOGINFO(
+            "ThinClientRegion::executeFunctionSH with GF_NOTCON or "
+            "GF_CLIENT_WAIT_TIMEOUT ");
+        if (auto poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm)) {
+          if (poolDM->getClientMetaDataService()) {
+            poolDM->getClientMetaDataService()->enqueueForMetadataRefresh(
+                this->getFullPath(), 0);
+          }
         }
         worker->getResultCollector()->reset();
         {
@@ -3363,24 +3287,20 @@ bool ThinClientRegion::executeFunctionSH(
           rc->clearResults();
         }
       } else {
-
         if (ThinClientBaseDM::isFatalClientError(err)) {
           LOGERROR("ThinClientRegion::executeFunctionSH: Fatal Exception");
-            }
-        else
-        {
+        } else {
           LOGWARN("ThinClientRegion::executeFunctionSH: Unexpected Exception");
         }
 
         for (std::vector<OnRegionFunctionExecution*>::iterator iter2 =
-                  feWorkers.begin();
-              iter2 != feWorkers.end(); ++iter2)
-        {
+                 feWorkers.begin();
+             iter2 != feWorkers.end(); ++iter2) {
           OnRegionFunctionExecution* worker = *iter2;
           delete worker;
         }
-        LOGDEBUG("ThinClientRegion::executeFunctionSH: Cleaned out the workers ");
-
+        LOGDEBUG(
+            "ThinClientRegion::executeFunctionSH: Cleaned out the workers ");
 
         GfErrTypeToException("ExecuteOnRegion:", err);
       }
@@ -3426,7 +3346,7 @@ GfErrType ThinClientRegion::getNoThrow_FullObject(EventIdPtr eventId,
                                                   CacheablePtr& fullObject,
                                                   VersionTagPtr& versionTag) {
   TcrMessageRequestEventValue fullObjectMsg(eventId);
-  TcrMessageReply reply(true, NULL);
+  TcrMessageReply reply(true, nullptr);
 
   GfErrType err = GF_NOTCON;
   err = m_tcrdm->sendSyncRequest(fullObjectMsg, reply, false, true);
@@ -3620,7 +3540,7 @@ void ChunkedQueryResponse::handleChunk(const uint8_t* chunk, int32_t chunkLen,
   }
 
   uint8_t classByte;
-  char* isStructTypeImpl = NULL;
+  char* isStructTypeImpl = nullptr;
   uint16_t stiLen = 0;
   // soubhik: ignoring parent classes for now
   // we will require to look at it once CQ is to be implemented.
@@ -3770,7 +3690,7 @@ void ChunkedFunctionExecutionResponse::handleChunk(
 
   if (static_cast<TcrMessageHelper::ChunkObjectType>(arrayType) ==
       TcrMessageHelper::NULL_OBJECT) {
-    LOGDEBUG("ChunkedFunctionExecutionResponse::handleChunk NULL object");
+    LOGDEBUG("ChunkedFunctionExecutionResponse::handleChunk nullptr object");
     //	m_functionExecutionResults->push_back(nullptr);
     m_msg.readSecureObjectPart(input, false, true, isLastChunkWithSecurity);
     return;
@@ -3913,30 +3833,24 @@ void ChunkedGetAllResponse::handleChunk(const uint8_t* chunk, int32_t chunkLen,
 }
 
 void ChunkedGetAllResponse::add(const ChunkedGetAllResponse* other) {
-  if (m_values != nullptr) {
-    for (HashMapOfCacheable::Iterator iter = other->m_values->begin();
-         iter != other->m_values->end(); iter++) {
-      m_values->insert(iter.first(), iter.second());
+  if (m_values) {
+    for (const auto& iter : *m_values) {
+      m_values->emplace(iter.first, iter.second);
     }
   }
 
-  if (m_exceptions != nullptr) {
-    for (HashMapOfException::Iterator iter = other->m_exceptions->begin();
-         iter != other->m_exceptions->end(); iter++) {
-      m_exceptions->insert(iter.first(), iter.second());
-    }
+  if (m_exceptions) {
+    m_exceptions->insert(other->m_exceptions->begin(),
+                         other->m_exceptions->end());
   }
 
-  for (MapOfUpdateCounters::iterator iter = other->m_trackerMap.begin();
-       iter != other->m_trackerMap.end(); iter++) {
-    m_trackerMap[iter->first] = iter->second;
+  for (const auto& iter : other->m_trackerMap) {
+    m_trackerMap[iter.first] = iter.second;
   }
 
-  if (m_resultKeys != nullptr) {
-    for (VectorOfCacheableKey::Iterator iter = other->m_resultKeys->begin();
-         iter != other->m_resultKeys->end(); iter++) {
-      m_resultKeys->push_back(*iter);
-    }
+  if (m_resultKeys) {
+    m_resultKeys->insert(m_resultKeys->end(), other->m_resultKeys->begin(),
+                         other->m_resultKeys->end());
   }
 }
 
@@ -3959,7 +3873,7 @@ void ChunkedPutAllResponse::handleChunk(const uint8_t* chunk, int32_t chunkLen,
                GeodeTypeIdsImpl::VersionedObjectPartList,
                "ChunkedPutAllResponse", partLen, isLastChunkWithSecurity)) ==
       TcrMessageHelper::NULL_OBJECT) {
-    LOGDEBUG("ChunkedPutAllResponse::handleChunk NULL object");
+    LOGDEBUG("ChunkedPutAllResponse::handleChunk nullptr object");
     // No issues it will be empty in case of disabled caching.
     m_msg.readSecureObjectPart(input, false, true, isLastChunkWithSecurity);
     return;
@@ -3988,8 +3902,8 @@ void ChunkedPutAllResponse::handleChunk(const uint8_t* chunk, int32_t chunkLen,
     if (pool != nullptr && !pool->isDestroyed() &&
         pool->getPRSingleHopEnabled()) {
       ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(pool.get());
-      if ((poolDM != NULL) && (poolDM->getClientMetaDataService() != NULL) &&
-          (byte0 != 0)) {
+      if ((poolDM != nullptr) &&
+          (poolDM->getClientMetaDataService() != nullptr) && (byte0 != 0)) {
         LOGFINE(
             "enqueued region %s for metadata refresh for singlehop for PUTALL "
             "operation.",
@@ -4021,7 +3935,7 @@ void ChunkedRemoveAllResponse::handleChunk(const uint8_t* chunk,
                GeodeTypeIdsImpl::VersionedObjectPartList,
                "ChunkedRemoveAllResponse", partLen, isLastChunkWithSecurity)) ==
       TcrMessageHelper::NULL_OBJECT) {
-    LOGDEBUG("ChunkedRemoveAllResponse::handleChunk NULL object");
+    LOGDEBUG("ChunkedRemoveAllResponse::handleChunk nullptr object");
     // No issues it will be empty in case of disabled caching.
     m_msg.readSecureObjectPart(input, false, true, isLastChunkWithSecurity);
     return;
@@ -4051,8 +3965,8 @@ void ChunkedRemoveAllResponse::handleChunk(const uint8_t* chunk,
     if (pool != nullptr && !pool->isDestroyed() &&
         pool->getPRSingleHopEnabled()) {
       ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(pool.get());
-      if ((poolDM != NULL) && (poolDM->getClientMetaDataService() != NULL) &&
-          (byte0 != 0)) {
+      if ((poolDM != nullptr) &&
+          (poolDM->getClientMetaDataService() != nullptr) && (byte0 != 0)) {
         LOGFINE(
             "enqueued region %s for metadata refresh for singlehop for "
             "REMOVEALL operation.",
@@ -4065,7 +3979,7 @@ void ChunkedRemoveAllResponse::handleChunk(const uint8_t* chunk,
 }
 
 void ChunkedDurableCQListResponse::reset() {
-  if (m_resultList != nullptr && m_resultList->length() > 0) {
+  if (m_resultList) {
     m_resultList->clear();
   }
 }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/ThinClientRegion.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/ThinClientRegion.hpp b/src/cppcache/src/ThinClientRegion.hpp
index e124ceb..d9ca46c 100644
--- a/src/cppcache/src/ThinClientRegion.hpp
+++ b/src/cppcache/src/ThinClientRegion.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_THINCLIENTREGION_H_
-#define GEODE_THINCLIENTREGION_H_
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -20,6 +15,18 @@
  * limitations under the License.
  */
 
+#pragma once
+
+#ifndef GEODE_THINCLIENTREGION_H_
+#define GEODE_THINCLIENTREGION_H_
+
+#include <unordered_map>
+
+#include <ace/Task.h>
+
+#include <geode/utils.hpp>
+#include <geode/ResultCollector.hpp>
+
 #include "LocalRegion.hpp"
 #include "TcrMessage.hpp"
 #include "TcrEndpoint.hpp"
@@ -27,13 +34,11 @@
 #include "Queue.hpp"
 #include "TcrChunkedContext.hpp"
 #include "CacheableObjectPartList.hpp"
-#include <geode/ResultCollector.hpp>
-
-#include <ace/Task.h>
+#include "ClientMetadataService.hpp"
 
 /**
-* @file
-*/
+ * @file
+ */
 
 namespace apache {
 namespace geode {
@@ -42,12 +47,12 @@ namespace client {
 class ThinClientBaseDM;
 
 /**
-* @class ThinClientRegion ThinClientRegion.hpp
-*
-* This class manages all the functionalities related with thin client
-* region. It will inherit from DistributedRegion and overload some methods
-*
-*/
+ * @class ThinClientRegion ThinClientRegion.hpp
+ *
+ * This class manages all the functionalities related with thin client
+ * region. It will inherit from DistributedRegion and overload some methods
+ *
+ */
 
 class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
  public:
@@ -102,9 +107,9 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
       const VectorOfCacheableKey& keys,
       VersionedCacheableObjectPartListPtr& versionedObjPartList,
       const UserDataPtr& aCallbackArgument = nullptr);
-  GfErrType registerKeys(TcrEndpoint* endpoint = NULL,
-                         const TcrMessage* request = NULL,
-                         TcrMessageReply* reply = NULL);
+  GfErrType registerKeys(TcrEndpoint* endpoint = nullptr,
+                         const TcrMessage* request = nullptr,
+                         TcrMessageReply* reply = nullptr);
   GfErrType unregisterKeys();
   void addKeys(const VectorOfCacheableKey& keys, bool isDurable,
                bool receiveValues, InterestResultPolicy interestpolicy);
@@ -142,7 +147,7 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
   bool executeFunctionSH(
       const char* func, const CacheablePtr& args, uint8_t getResult,
       ResultCollectorPtr rc,
-      HashMapT<BucketServerLocationPtr, CacheableHashSetPtr>* locationMap,
+      const ClientMetadataService::ServerToKeysMapPtr& locationMap,
       CacheableHashSetPtr& failedNodes,
       uint32_t timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT,
       bool allBuckets = false);
@@ -208,19 +213,19 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
   GfErrType destroyRegionNoThrow_remote(const UserDataPtr& aCallbackArgument);
   GfErrType registerKeysNoThrow(
       const VectorOfCacheableKey& keys, bool attemptFailover = true,
-      TcrEndpoint* endpoint = NULL, bool isDurable = false,
+      TcrEndpoint* endpoint = nullptr, bool isDurable = false,
       InterestResultPolicy interestPolicy = InterestResultPolicy::NONE,
-      bool receiveValues = true, TcrMessageReply* reply = NULL);
+      bool receiveValues = true, TcrMessageReply* reply = nullptr);
   GfErrType unregisterKeysNoThrow(const VectorOfCacheableKey& keys,
                                   bool attemptFailover = true);
   GfErrType unregisterKeysNoThrowLocalDestroy(const VectorOfCacheableKey& keys,
                                               bool attemptFailover = true);
   GfErrType registerRegexNoThrow(
       const std::string& regex, bool attemptFailover = true,
-      TcrEndpoint* endpoint = NULL, bool isDurable = false,
+      TcrEndpoint* endpoint = nullptr, bool isDurable = false,
       VectorOfCacheableKeyPtr resultKeys = nullptr,
       InterestResultPolicy interestPolicy = InterestResultPolicy::NONE,
-      bool receiveValues = true, TcrMessageReply* reply = NULL);
+      bool receiveValues = true, TcrMessageReply* reply = nullptr);
   GfErrType unregisterRegexNoThrow(const std::string& regex,
                                    bool attemptFailover = true);
   GfErrType unregisterRegexNoThrowLocalDestroy(const std::string& regex,
@@ -319,6 +324,15 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
 
   ACE_RW_Thread_Mutex m_RegionMutex;
   bool m_isMetaDataRefreshed;
+
+  typedef std::unordered_map<BucketServerLocationPtr, SerializablePtr,
+                             dereference_hash<BucketServerLocationPtr>,
+                             dereference_equal_to<BucketServerLocationPtr>>
+      ResultMap;
+  typedef std::unordered_map<BucketServerLocationPtr, CacheableInt32Ptr,
+                             dereference_hash<BucketServerLocationPtr>,
+                             dereference_equal_to<BucketServerLocationPtr>>
+      FailedServersMap;
 };
 
 // Chunk processing classes
@@ -507,8 +521,8 @@ class ChunkedGetAllResponse : public TcrChunkedResult {
 typedef SharedPtr<ChunkedGetAllResponse> ChunkedGetAllResponsePtr;
 
 /**
-* Handle each chunk of the chunked putAll response.
-*/
+ * Handle each chunk of the chunked putAll response.
+ */
 class ChunkedPutAllResponse : public TcrChunkedResult {
  private:
   TcrMessage& m_msg;
@@ -539,8 +553,8 @@ class ChunkedPutAllResponse : public TcrChunkedResult {
 typedef SharedPtr<ChunkedPutAllResponse> ChunkedPutAllResponsePtr;
 
 /**
-* Handle each chunk of the chunked removeAll response.
-*/
+ * Handle each chunk of the chunked removeAll response.
+ */
 class ChunkedRemoveAllResponse : public TcrChunkedResult {
  private:
   TcrMessage& m_msg;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/ThinClientStickyManager.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/ThinClientStickyManager.cpp b/src/cppcache/src/ThinClientStickyManager.cpp
index af6ce46..b8a5c0f 100644
--- a/src/cppcache/src/ThinClientStickyManager.cpp
+++ b/src/cppcache/src/ThinClientStickyManager.cpp
@@ -50,8 +50,8 @@ bool ThinClientStickyManager::getStickyConnection(
 
 void ThinClientStickyManager::getSingleHopStickyConnection(
     TcrEndpoint* theEP, TcrConnection*& conn) {
-  conn = (*TssConnectionWrapper::s_geodeTSSConn)->getSHConnection(theEP,
-                                                               m_dm->getName());
+  conn = (*TssConnectionWrapper::s_geodeTSSConn)
+             ->getSHConnection(theEP, m_dm->getName());
 }
 
 void ThinClientStickyManager::addStickyConnection(TcrConnection* conn) {
@@ -65,14 +65,14 @@ void ThinClientStickyManager::addStickyConnection(TcrConnection* conn) {
       oldConn->setAndGetBeingUsed(false, false);
       m_stickyConnList.erase(it);
       PoolPtr p = nullptr;
-      (*TssConnectionWrapper::s_geodeTSSConn)->setConnection(NULL, p);
+      (*TssConnectionWrapper::s_geodeTSSConn)->setConnection(nullptr, p);
       m_dm->put(oldConn, false);
     }
   }
 
   if (conn) {
-    (*TssConnectionWrapper::s_geodeTSSConn)->setConnection(
-        conn, m_dm->shared_from_this());
+    (*TssConnectionWrapper::s_geodeTSSConn)
+        ->setConnection(conn, m_dm->shared_from_this());
     conn->setAndGetBeingUsed(true, true);  // this is done for transaction
                                            // thread when some one resume
                                            // transaction
@@ -86,16 +86,16 @@ void ThinClientStickyManager::setStickyConnection(TcrConnection* conn,
   // ACE_Guard<ACE_Recursive_Thread_Mutex> guard( m_stickyLock );
   if (!conn) {
     ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_stickyLock);
-    (*TssConnectionWrapper::s_geodeTSSConn)->setConnection(
-        NULL, m_dm->shared_from_this());
+    (*TssConnectionWrapper::s_geodeTSSConn)
+        ->setConnection(nullptr, m_dm->shared_from_this());
   } else {
     TcrConnection* currentConn =
         (*TssConnectionWrapper::s_geodeTSSConn)->getConnection();
     if (currentConn != conn)  // otherwsie no need to set it again
     {
       ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_stickyLock);
-      (*TssConnectionWrapper::s_geodeTSSConn)->setConnection(
-          conn, m_dm->shared_from_this());
+      (*TssConnectionWrapper::s_geodeTSSConn)
+          ->setConnection(conn, m_dm->shared_from_this());
       conn->setAndGetBeingUsed(
           false,
           forTransaction);  // if transaction then it will keep this as used
@@ -140,7 +140,7 @@ void ThinClientStickyManager::cleanStaleStickyConnection() {
         TcrConnection* temp1 = *conn;
         //*conn = temp; instead of setting in thread local put in queue, thread
         // will come and pick it from there
-        *conn = NULL;
+        *conn = nullptr;
         m_dm->put(temp, false);
         temp1->close();
         GF_SAFE_DELETE(temp1);
@@ -149,7 +149,7 @@ void ThinClientStickyManager::cleanStaleStickyConnection() {
       } else {
         (*conn)->setAndGetBeingUsed(false, false);
       }
-      temp = NULL;
+      temp = nullptr;
     }
   }
 }
@@ -188,7 +188,8 @@ bool ThinClientStickyManager::canThisConnBeDeleted(TcrConnection* conn) {
   return canBeDeleted;
 }
 void ThinClientStickyManager::releaseThreadLocalConnection() {
-  TcrConnection* conn = (*TssConnectionWrapper::s_geodeTSSConn)->getConnection();
+  TcrConnection* conn =
+      (*TssConnectionWrapper::s_geodeTSSConn)->getConnection();
   if (conn) {
     ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_stickyLock);
     std::set<TcrConnection**>::iterator it = m_stickyConnList.find(
@@ -200,18 +201,18 @@ void ThinClientStickyManager::releaseThreadLocalConnection() {
                                false);  // now this can be used by next one
       m_dm->put(conn, false);
     }
-    (*TssConnectionWrapper::s_geodeTSSConn)->setConnection(
-        NULL, m_dm->shared_from_this());
+    (*TssConnectionWrapper::s_geodeTSSConn)
+        ->setConnection(nullptr, m_dm->shared_from_this());
   }
-  (*TssConnectionWrapper::s_geodeTSSConn)->releaseSHConnections(
-      m_dm->shared_from_this());
+  (*TssConnectionWrapper::s_geodeTSSConn)
+      ->releaseSHConnections(m_dm->shared_from_this());
 }
 bool ThinClientStickyManager::isNULL(TcrConnection** conn) {
-  if (*conn == NULL) return true;
+  if (*conn == nullptr) return true;
   return false;
 }
 
 void ThinClientStickyManager::getAnyConnection(TcrConnection*& conn) {
-  conn =
-      (*TssConnectionWrapper::s_geodeTSSConn)->getAnyConnection(m_dm->getName());
+  conn = (*TssConnectionWrapper::s_geodeTSSConn)
+             ->getAnyConnection(m_dm->getName());
 }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/TombstoneList.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/TombstoneList.cpp b/src/cppcache/src/TombstoneList.cpp
index c884f76..31ab22a 100644
--- a/src/cppcache/src/TombstoneList.cpp
+++ b/src/cppcache/src/TombstoneList.cpp
@@ -75,9 +75,7 @@ void TombstoneList::add(RegionInternal* rptr, const MapEntryImplPtr& entry,
         Utils::getCacheableKeyString(key)->asChar(), id, duration);
   }*/
   tombstoneEntryPtr->setExpiryTaskId(taskid);
-  if (!m_tombstoneMap.insert(key, tombstoneEntryPtr)) {
-    m_tombstoneMap[key] = tombstoneEntryPtr;
-  }
+  m_tombstoneMap[key] = tombstoneEntryPtr;
   rptr->getCacheImpl()->m_cacheStats->incTombstoneCount();
   int32_t tombstonesize = key->objectSize() + SIZEOF_TOMBSTONEOVERHEAD;
   rptr->getCacheImpl()->m_cacheStats->incTombstoneSize(tombstonesize);
@@ -90,23 +88,25 @@ void TombstoneList::add(RegionInternal* rptr, const MapEntryImplPtr& entry,
 void TombstoneList::reapTombstones(std::map<uint16_t, int64_t>& gcVersions) {
   // This function is not guarded as all functions of this class are called from
   // MapSegment
-  std::unordered_set<CacheableKeyPtr> tobeDeleted;
-  for (auto queIter = m_tombstoneMap.begin(); queIter != m_tombstoneMap.end();
-       ++queIter) {
-    std::map<uint16_t, int64_t>::iterator mapIter = gcVersions.find(
-        queIter.second()->getEntry()->getVersionStamp().getMemberId());
+  std::unordered_set<CacheableKeyPtr, dereference_hash<CacheableKeyPtr>,
+                     dereference_equal_to<CacheableKeyPtr>>
+      tobeDeleted;
+  for (const auto& queIter : m_tombstoneMap) {
+    auto const& mapIter = gcVersions.find(
+        queIter.second->getEntry()->getVersionStamp().getMemberId());
 
     if (mapIter == gcVersions.end()) {
       continue;
     }
-    int64_t version = (*mapIter).second;
+
+    auto const& version = (*mapIter).second;
     if (version >=
-        queIter.second()->getEntry()->getVersionStamp().getRegionVersion()) {
-      tobeDeleted.insert(queIter.first());
+        queIter.second->getEntry()->getVersionStamp().getRegionVersion()) {
+      tobeDeleted.insert(queIter.first);
     }
   }
-  for (auto itr = tobeDeleted.begin(); itr != tobeDeleted.end(); itr++) {
-    unguardedRemoveEntryFromMapSegment(*itr);
+  for (const auto& itr : tobeDeleted) {
+    unguardedRemoveEntryFromMapSegment(itr);
   }
 }
 
@@ -129,18 +129,25 @@ void TombstoneList::unguardedRemoveEntryFromMapSegment(CacheableKeyPtr key) {
   m_mapSegment->unguardedRemoveActualEntry(key);
 }
 
+bool TombstoneList::exists(const CacheableKeyPtr& key) const {
+  if (key) {
+    return m_tombstoneMap.find(key) != m_tombstoneMap.end();
+  }
+  return false;
+}
+
 void TombstoneList::eraseEntryFromTombstoneList(const CacheableKeyPtr& key,
                                                 RegionInternal* region,
                                                 bool cancelTask) {
   // This function is not guarded as all functions of this class are called from
   // MapSegment
-  bool exists = (key != nullptr) ? m_tombstoneMap.contains(key) : false;
-  if (cancelTask && exists) {
-    CacheImpl::expiryTaskManager->cancelTask(
-        static_cast<long>(m_tombstoneMap[key]->getExpiryTaskId()));
-    delete m_tombstoneMap[key]->getHandler();
-  }
-  if (exists) {
+  if (exists(key)) {
+    if (cancelTask) {
+      CacheImpl::expiryTaskManager->cancelTask(
+          static_cast<long>(m_tombstoneMap[key]->getExpiryTaskId()));
+      delete m_tombstoneMap[key]->getHandler();
+    }
+
     region->getCacheImpl()->m_cacheStats->decTombstoneCount();
     int32_t tombstonesize = key->objectSize() + SIZEOF_TOMBSTONEOVERHEAD;
     region->getCacheImpl()->m_cacheStats->decTombstoneSize(tombstonesize);
@@ -153,9 +160,8 @@ long TombstoneList::eraseEntryFromTombstoneListWithoutCancelTask(
     TombstoneExpiryHandler*& handler) {
   // This function is not guarded as all functions of this class are called from
   // MapSegment
-  bool exists = (key != nullptr) ? m_tombstoneMap.contains(key) : false;
   long taskid = -1;
-  if (exists) {
+  if (exists(key)) {
     taskid = static_cast<long>(m_tombstoneMap[key]->getExpiryTaskId());
     handler = m_tombstoneMap[key]->getHandler();
     region->getCacheImpl()->m_cacheStats->decTombstoneCount();
@@ -166,21 +172,11 @@ long TombstoneList::eraseEntryFromTombstoneListWithoutCancelTask(
   return taskid;
 }
 
-bool TombstoneList::getEntryFromTombstoneList(
-    const CacheableKeyPtr& key) const {
-  // This function is not guarded as all functions of this class are called from
-  // MapSegment
-  return m_tombstoneMap.contains(key);
-}
-
 void TombstoneList::cleanUp() {
   // This function is not guarded as all functions of this class are called from
   // MapSegment
-  for (HashMapT<CacheableKeyPtr, TombstoneEntryPtr>::Iterator queIter =
-           m_tombstoneMap.begin();
-       queIter != m_tombstoneMap.end(); ++queIter) {
-    CacheImpl::expiryTaskManager->cancelTask(
-        static_cast<long>(queIter.second()->getExpiryTaskId()));
-    delete queIter.second()->getHandler();
+  for (const auto& queIter : m_tombstoneMap) {
+    CacheImpl::expiryTaskManager->cancelTask(queIter.second->getExpiryTaskId());
+    delete queIter.second->getHandler();
   }
 }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/TombstoneList.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/TombstoneList.hpp b/src/cppcache/src/TombstoneList.hpp
index 5f45a17..98ed643 100644
--- a/src/cppcache/src/TombstoneList.hpp
+++ b/src/cppcache/src/TombstoneList.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_TOMBSTONELIST_H_
-#define GEODE_TOMBSTONELIST_H_
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -20,13 +15,21 @@
  * limitations under the License.
  */
 
+#pragma once
+
+#ifndef GEODE_TOMBSTONELIST_H_
+#define GEODE_TOMBSTONELIST_H_
+
 #include <list>
+#include <unordered_map>
+
 #include <ace/Recursive_Thread_Mutex.h>
-#include "ace/Guard_T.h"
+#include <ace/Guard_T.h>
+
 #include <geode/SharedPtr.hpp>
 #include <geode/CacheableBuiltins.hpp>
-#include <geode/HashMapT.hpp>
-#include <geode/HashSetT.hpp>
+#include <geode/utils.hpp>
+
 #include "MapEntry.hpp"
 
 namespace apache {
@@ -48,19 +51,21 @@ class TombstoneEntry : public SharedBase {
          * also change the member initialization to initializer list
          */
         m_expiryTaskId(0),
-        m_handler(NULL) {}
+        m_handler(nullptr) {}
   virtual ~TombstoneEntry() {}
   MapEntryImplPtr getEntry() { return m_entry; }
   int64_t getTombstoneCreationTime() { return m_tombstoneCreationTime; }
-  int64_t getExpiryTaskId() { return m_expiryTaskId; }
-  void setExpiryTaskId(int64_t expiryTaskId) { m_expiryTaskId = expiryTaskId; }
+  ExpiryTaskManager::id_type getExpiryTaskId() { return m_expiryTaskId; }
+  void setExpiryTaskId(ExpiryTaskManager::id_type expiryTaskId) {
+    m_expiryTaskId = expiryTaskId;
+  }
   TombstoneExpiryHandler* getHandler() { return m_handler; };
   void setHandler(TombstoneExpiryHandler* handler) { m_handler = handler; };
 
  private:
   MapEntryImplPtr m_entry;
   int64_t m_tombstoneCreationTime;
-  int64_t m_expiryTaskId;
+  ExpiryTaskManager::id_type m_expiryTaskId;
   TombstoneExpiryHandler* m_handler;
 };
 typedef SharedPtr<TombstoneEntry> TombstoneEntryPtr;
@@ -84,14 +89,18 @@ class TombstoneList : public SharedBase {
   long eraseEntryFromTombstoneListWithoutCancelTask(
       const CacheableKeyPtr& key, RegionInternal* region,
       TombstoneExpiryHandler*& handler);
-  bool getEntryFromTombstoneList(const CacheableKeyPtr& key) const;
   void cleanUp();
   long getExpiryTask(TombstoneExpiryHandler** handler);
+  bool exists(const CacheableKeyPtr& key) const;
 
  private:
   void removeEntryFromMapSegment(CacheableKeyPtr key);
   void unguardedRemoveEntryFromMapSegment(CacheableKeyPtr key);
-  HashMapT<CacheableKeyPtr, TombstoneEntryPtr> m_tombstoneMap;
+  typedef std::unordered_map<CacheableKeyPtr, TombstoneEntryPtr,
+                             dereference_hash<CacheableKeyPtr>,
+                             dereference_equal_to<CacheableKeyPtr>>
+      TombstoneMap;
+  TombstoneMap m_tombstoneMap;
   ACE_Recursive_Thread_Mutex m_queueLock;
   MapSegment* m_mapSegment;
   friend class TombstoneExpiryHandler;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/TransactionSuspender.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/TransactionSuspender.cpp b/src/cppcache/src/TransactionSuspender.cpp
index 60d200a..9edd438 100644
--- a/src/cppcache/src/TransactionSuspender.cpp
+++ b/src/cppcache/src/TransactionSuspender.cpp
@@ -31,7 +31,7 @@ namespace client {
 TransactionSuspender::TransactionSuspender() {
   TSSTXStateWrapper* txStateWrapper = TSSTXStateWrapper::s_geodeTSSTXState;
   m_TXState = txStateWrapper->getTXState();
-  txStateWrapper->setTXState(NULL);
+  txStateWrapper->setTXState(nullptr);
 }
 
 TransactionSuspender::~TransactionSuspender() {

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/TransactionalOperation.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/TransactionalOperation.cpp b/src/cppcache/src/TransactionalOperation.cpp
index 3627077..ffebeaf 100644
--- a/src/cppcache/src/TransactionalOperation.cpp
+++ b/src/cppcache/src/TransactionalOperation.cpp
@@ -63,7 +63,7 @@ CacheablePtr TransactionalOperation::replay(Cache* cache) {
       break;
     case GF_EXECUTE_FUNCTION: {
       ExecutionPtr execution;
-      if (m_regionName == NULL) {
+      if (m_regionName == nullptr) {
         execution = FunctionService::onServer(CachePtr(cache));
       } else {
         execution = FunctionService::onRegion(cache->getRegion(m_regionName));
@@ -94,7 +94,7 @@ CacheablePtr TransactionalOperation::replay(Cache* cache) {
               // TODO shared_ptr - no path between types?
               *std::dynamic_pointer_cast<VectorOfCacheableKey>(
                   m_arguments->at(0)),
-                  // TODO shared_ptr - no path between types?
+              // TODO shared_ptr - no path between types?
               std::dynamic_pointer_cast<HashMapOfCacheable>(m_arguments->at(1)),
               // TODO shared_ptr - no path between types?
               std::dynamic_pointer_cast<HashMapOfException>(m_arguments->at(2)),
@@ -109,8 +109,9 @@ CacheablePtr TransactionalOperation::replay(Cache* cache) {
           ->remove(m_key, m_arguments->at(0), m_arguments->at(1));
       break;
     case GF_KEY_SET:
-      cache->getRegion(m_regionName)
-      // TODO shared_ptr - no path between types?
+      cache
+          ->getRegion(m_regionName)
+          // TODO shared_ptr - no path between types?
           ->serverKeys(*std::dynamic_pointer_cast<VectorOfCacheableKey>(
               m_arguments->at(0)));
       break;
@@ -123,8 +124,9 @@ CacheablePtr TransactionalOperation::replay(Cache* cache) {
           ->put(m_key, m_arguments->at(0), m_arguments->at(1));
       break;
     case GF_PUT_ALL:
-      cache->getRegion(m_regionName)
-      // TODO shared_ptr - no path between types?
+      cache
+          ->getRegion(m_regionName)
+          // TODO shared_ptr - no path between types?
           ->putAll(*std::dynamic_pointer_cast<HashMapOfCacheable>(
                        m_arguments->at(0)),
                    std::static_pointer_cast<CacheableInt32>(m_arguments->at(1))

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/TssConnectionWrapper.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/TssConnectionWrapper.cpp b/src/cppcache/src/TssConnectionWrapper.cpp
index edf510e..3ec10bc 100644
--- a/src/cppcache/src/TssConnectionWrapper.cpp
+++ b/src/cppcache/src/TssConnectionWrapper.cpp
@@ -18,11 +18,12 @@
 #include "TcrConnection.hpp"
 #include "ThinClientPoolDM.hpp"
 using namespace apache::geode::client;
-ACE_TSS<TssConnectionWrapper>* TssConnectionWrapper::s_geodeTSSConn = new ACE_TSS<TssConnectionWrapper>();
+ACE_TSS<TssConnectionWrapper>* TssConnectionWrapper::s_geodeTSSConn =
+    new ACE_TSS<TssConnectionWrapper>();
 TssConnectionWrapper::TssConnectionWrapper() {
   PoolPtr p = nullptr;
   m_pool = p;
-  m_tcrConn = NULL;
+  m_tcrConn = nullptr;
 }
 TssConnectionWrapper::~TssConnectionWrapper() {
   // if cache close happening during this then we should NOT call this..
@@ -31,8 +32,8 @@ TssConnectionWrapper::~TssConnectionWrapper() {
     // but still race-condition is there if now cache-close starts happens
     // m_tcrConn->close();
     m_pool->releaseThreadLocalConnection();
-    // delete m_tcrConn; m_tcrConn = NULL;
-    m_tcrConn = NULL;
+    // delete m_tcrConn; m_tcrConn = nullptr;
+    m_tcrConn = nullptr;
   }
 }
 
@@ -40,7 +41,7 @@ void TssConnectionWrapper::setSHConnection(TcrEndpoint* ep,
                                            TcrConnection* conn) {
   std::string pn(ep->getPoolHADM()->getName());
   poolVsEndpointConnMap::iterator iter = m_poolVsEndpointConnMap.find(pn);
-  PoolWrapper* pw = NULL;
+  PoolWrapper* pw = nullptr;
   if (iter == m_poolVsEndpointConnMap.end()) {
     pw = new PoolWrapper();
     m_poolVsEndpointConnMap[pn] = pw;
@@ -55,9 +56,9 @@ TcrConnection* TssConnectionWrapper::getSHConnection(TcrEndpoint* ep,
                                                      const char* poolname) {
   std::string pn(poolname);
   poolVsEndpointConnMap::iterator iter = m_poolVsEndpointConnMap.find(pn);
-  PoolWrapper* pw = NULL;
+  PoolWrapper* pw = nullptr;
   if (iter == m_poolVsEndpointConnMap.end()) {
-    return NULL;
+    return nullptr;
   } else {
     pw = iter->second;
   }
@@ -68,7 +69,7 @@ TcrConnection* TssConnectionWrapper::getSHConnection(TcrEndpoint* ep,
 void TssConnectionWrapper::releaseSHConnections(PoolPtr pool) {
   std::string pn(pool->getName());
   poolVsEndpointConnMap::iterator iter = m_poolVsEndpointConnMap.find(pn);
-  PoolWrapper* pw = NULL;
+  PoolWrapper* pw = nullptr;
   if (iter == m_poolVsEndpointConnMap.end()) {
     return;
   } else {
@@ -83,9 +84,9 @@ void TssConnectionWrapper::releaseSHConnections(PoolPtr pool) {
 TcrConnection* TssConnectionWrapper::getAnyConnection(const char* poolname) {
   std::string pn(poolname);
   poolVsEndpointConnMap::iterator iter = m_poolVsEndpointConnMap.find(pn);
-  PoolWrapper* pw = NULL;
+  PoolWrapper* pw = nullptr;
   if (iter == m_poolVsEndpointConnMap.end()) {
-    return NULL;
+    return nullptr;
   } else {
     pw = iter->second;
   }
@@ -100,7 +101,7 @@ TcrConnection* PoolWrapper::getSHConnection(TcrEndpoint* ep) {
     m_EpnameVsConnection.erase(iter);
     return tmp;
   }
-  return NULL;
+  return nullptr;
 }
 
 void PoolWrapper::setSHConnection(TcrEndpoint* ep, TcrConnection* conn) {
@@ -118,7 +119,7 @@ void PoolWrapper::releaseSHConnections(PoolPtr pool) {
     TcrConnection* tmp = iter->second;
     tmp->setAndGetBeingUsed(false, false);  // now this can be used by next one
     ThinClientPoolDM* dm = dynamic_cast<ThinClientPoolDM*>(pool.get());
-    if (dm != NULL) {
+    if (dm != nullptr) {
       dm->put(tmp, false);
     }
   }
@@ -132,5 +133,5 @@ TcrConnection* PoolWrapper::getAnyConnection() {
     m_EpnameVsConnection.erase(iter);
     return tmp;
   }
-  return NULL;
+  return nullptr;
 }

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/UserAttributes.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/UserAttributes.cpp b/src/cppcache/src/UserAttributes.cpp
index 43bb3fc..c94c561 100644
--- a/src/cppcache/src/UserAttributes.cpp
+++ b/src/cppcache/src/UserAttributes.cpp
@@ -36,7 +36,7 @@ UserAttributes::~UserAttributes() {
   ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_listLock);
   for (it = m_connectionAttr.begin(); it != m_connectionAttr.end(); it++) {
     UserConnectionAttributes* uca = (*it).second;
-    if (uca != NULL) {
+    if (uca != nullptr) {
       GF_SAFE_DELETE(uca);
     }
   }
@@ -44,7 +44,7 @@ UserAttributes::~UserAttributes() {
 
 UserConnectionAttributes* UserAttributes::getConnectionAttribute() {
   LOGDEBUG("UserConnectionAttributes* getConnectionAttribute().");
-  if (m_connectionAttr.size() == 0) return NULL;
+  if (m_connectionAttr.size() == 0) return nullptr;
 
   //  std::map<std::string, UserConnectionAttributes*>::iterator it;
 
@@ -57,7 +57,7 @@ UserConnectionAttributes* UserAttributes::getConnectionAttribute() {
     else
       uca->setUnAuthenticated();
   }*/
-  return NULL;
+  return nullptr;
 }
 
 void UserAttributes::unAuthenticateEP(TcrEndpoint* endpoint) {
@@ -70,7 +70,7 @@ void UserAttributes::unAuthenticateEP(TcrEndpoint* endpoint) {
 
   ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_listLock);
   UserConnectionAttributes* uca = m_connectionAttr[endpoint->name()];
-  if (uca != NULL) {
+  if (uca != nullptr) {
     m_connectionAttr.erase(endpoint->name());
     GF_SAFE_DELETE(uca);
   }
@@ -87,7 +87,7 @@ PoolPtr UserAttributes::getPool() { return m_pool; }
 UserConnectionAttributes* UserAttributes::getConnectionAttribute(
     TcrEndpoint* ep) {
   LOGDEBUG("UserConnectionAttributes* getConnectionAttribute with EP.");
-  if (m_connectionAttr.size() == 0) return NULL;
+  if (m_connectionAttr.size() == 0) return nullptr;
 
   // std::map<std::string, UserConnectionAttributes>::iterator it;
   ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_listLock);
@@ -108,7 +108,7 @@ bool UserAttributes::isEndpointAuthenticated(TcrEndpoint* ep) {
 
   ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_listLock);
   UserConnectionAttributes* uca = m_connectionAttr[ep->name()];
-  if (uca != NULL && uca->isAuthenticated() && (uca->getEndpoint() == ep)) {
+  if (uca != nullptr && uca->isAuthenticated() && (uca->getEndpoint() == ep)) {
     return true;
   }
   return false;

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/UserFunctionExecutionException.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/UserFunctionExecutionException.cpp b/src/cppcache/src/UserFunctionExecutionException.cpp
index dd101fd..f4097ed 100644
--- a/src/cppcache/src/UserFunctionExecutionException.cpp
+++ b/src/cppcache/src/UserFunctionExecutionException.cpp
@@ -28,7 +28,7 @@ void UserFunctionExecutionException::toData(DataOutput& output) const {
 Serializable* UserFunctionExecutionException::fromData(DataInput& input) {
   throw IllegalStateException(
       "UserFunctionExecutionException::fromData is not intended for use.");
-  return NULL;
+  return nullptr;
 }
 
 int32_t UserFunctionExecutionException::classId() const {

http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/Utils.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/Utils.cpp b/src/cppcache/src/Utils.cpp
index 0bb40ab..b7bb14f 100644
--- a/src/cppcache/src/Utils.cpp
+++ b/src/cppcache/src/Utils.cpp
@@ -26,8 +26,8 @@ using namespace apache::geode::client;
 
 #ifdef _WIN32
 
-pNew Utils::s_pNew = NULL;
-pDelete Utils::s_pDelete = NULL;
+pNew Utils::s_pNew = nullptr;
+pDelete Utils::s_pDelete = nullptr;
 bool Utils::s_setNewAndDelete = false;
 
 void* operator new(size_t size) {
@@ -35,7 +35,7 @@ void* operator new(size_t size) {
     apache::geode::client::setDefaultNewAndDelete();
   }
   void* ret = Utils::s_pNew(size);
-  if (ret == NULL) {
+  if (ret == nullptr) {
     throw apache::geode::client::OutOfMemoryException(
         "Out of memory while executing operator new");
   }
@@ -67,7 +67,7 @@ std::string Utils::getEnv(const char* varName) {
   return varValue;
 #else
   char* varValue = ACE_OS::getenv(varName);
-  if (varValue == NULL) {
+  if (varValue == nullptr) {
     return "";
   }
   return varValue;
@@ -111,7 +111,7 @@ Utils::convertHostToCanonicalForm(const char* endpoint)
   ACE_INET_Addr aia;
   char canonical[MAXHOSTNAMELEN + 11] = {0};
 
-  if ( endpoint == NULL ||
+  if ( endpoint == nullptr ||
        strlen(endpoint) == 0 ) {
     LOGERROR("Cannot convert empty endpoint to canonical form");
     return "";
@@ -130,7 +130,7 @@ Utils::convertHostToCanonicalForm(const char* endpoint)
     int port = atoi(strchr(endpoint, ':') + 1);
     if (ACE_OS::hostname(canonical, MAXHOSTNAMELEN) == 0) {
       struct hostent * host;
-      if ( (host = ACE_OS::gethostbyname(canonical)) != NULL ) {
+      if ( (host = ACE_OS::gethostbyname(canonical)) != nullptr ) {
         if (h_errno != 0) {
           return endpoint;
         }
@@ -158,7 +158,7 @@ endpoint);
 */
 
 std::string Utils::convertHostToCanonicalForm(const char* endpoints) {
-  if (endpoints == NULL) return NULL;
+  if (endpoints == nullptr) return nullptr;
   std::string hostString("");
   uint16_t port = 0;
   std::string endpointsStr(endpoints);
@@ -230,8 +230,8 @@ void Utils::parseEndpointNamesString(
 }
 
 char* Utils::copyString(const char* str) {
-  char* resStr = NULL;
-  if (str != NULL) {
+  char* resStr = nullptr;
+  if (str != nullptr) {
     size_t strSize = strlen(str) + 1;
     resStr = new char[strSize];
     memcpy(resStr, str, strSize);
@@ -242,7 +242,7 @@ char* Utils::copyString(const char* str) {
 CacheableStringPtr Utils::convertBytesToString(const uint8_t* bytes,
                                                int32_t length,
                                                size_t maxLength) {
-  if (bytes != NULL) {
+  if (bytes != nullptr) {
     std::string str;
     size_t totalBytes = 0;
     char byteStr[20];
@@ -263,7 +263,7 @@ CacheableStringPtr Utils::convertBytesToString(const uint8_t* bytes,
 }
 
 int32_t Utils::logWideString(char* buf, size_t maxLen, const wchar_t* wStr) {
-  if (wStr != NULL) {
+  if (wStr != nullptr) {
     mbstate_t state;
     ACE_OS::memset(&state, 0, sizeof(mbstate_t));
     const char* bufStart = buf;


Mime
View raw message