GEODE-6007: Fix LGTM issues (#517)
* Fix most of the LGTM issues. There are a few stragglers, but it's difficult to find them in the LGTM web UI among the 80+ others, so we'll fix these and reassess.
diff --git a/clicache/integration-test/PutGetTestsN.cs b/clicache/integration-test/PutGetTestsN.cs
index bb6add6..74a7f40 100644
--- a/clicache/integration-test/PutGetTestsN.cs
+++ b/clicache/integration-test/PutGetTestsN.cs
@@ -240,8 +240,8 @@
catch (Exception ex)
{
Util.Log("Exception: Put caused networkhop ");
- Util.Log("Got Exception (0} {1} {2} ", ex.Message, ex.StackTrace, ex.Source);
- Assert.Fail("Got Exception (0} {1} {2} ", ex.Message, ex.StackTrace, ex.Source);
+ Util.Log("Got Exception {0} {1} {2} ", ex.Message, ex.StackTrace, ex.Source);
+ Assert.Fail("Got Exception {0} {1} {2} ", ex.Message, ex.StackTrace, ex.Source);
}
}
diff --git a/clicache/integration-test/ThinClientPdxTests1.cs b/clicache/integration-test/ThinClientPdxTests1.cs
index 5982b55..d00cb24 100755
--- a/clicache/integration-test/ThinClientPdxTests1.cs
+++ b/clicache/integration-test/ThinClientPdxTests1.cs
@@ -1258,10 +1258,6 @@
private Hashtable _hashTable;
- //private int arrayCountS3= 10;
- private List<object> _addressListObj;
- //private Address[] _arrayOfAddress;
-
public SerializePdx3()
: base()
{
@@ -1281,23 +1277,14 @@
_addressList = new ArrayList();
_hashTable = new Hashtable();
- _addressListObj = new List<object>();
for (var i = 0; i < 10; i++)
{
_addressList.Add(new Address(i));
_hashTable.Add(i, new SerializePdx2(true));
- _addressListObj.Add(new Address(i));
}
_address = new Address(nAddress);
-
- //_arrayOfAddress = new Address[3];
-
- //for (int i = 0; i < 3; i++)
- //{
- // _arrayOfAddress[i] = new Address(i);
- //}
}
}
@@ -1885,7 +1872,7 @@
{
Key = key.ToString();
SecKey = key;
- ShareQuantity = key * 9278;
+ ShareQuantity = (double)((long)key * 9278L);
Cost = ShareQuantity * 100;
Price = Cost * 10;
SettleSecKey = SecKey + 100000;
diff --git a/clicache/integration-test/ThinClientPdxTests3.cs b/clicache/integration-test/ThinClientPdxTests3.cs
index adccf66..4fea999 100644
--- a/clicache/integration-test/ThinClientPdxTests3.cs
+++ b/clicache/integration-test/ThinClientPdxTests3.cs
@@ -1386,8 +1386,6 @@
{
var region0 = CacheHelper.GetVerifyRegion<object, object>(m_regionNames[0]);
- var filter = new List<object>();
- filter.Add(1);
var execution = FunctionService<object>.OnRegion<object, object>(region0);
var resultCollector = execution.Execute("IterateRegion");
diff --git a/clicache/integration-test/UnitTestsN.cs b/clicache/integration-test/UnitTestsN.cs
index 2650e2a..85b147c 100644
--- a/clicache/integration-test/UnitTestsN.cs
+++ b/clicache/integration-test/UnitTestsN.cs
@@ -174,7 +174,7 @@
TimeSpan elapsed = m_endTime - m_startTime;
Util.Log("{0}Time taken for task [{1}]: {2}ms {3}ops/sec{4}",
Util.MarkerString, taskName, elapsed.TotalMilliseconds,
- (numOps * 1000) / elapsed.TotalMilliseconds, Util.MarkerString);
+ ((long)numOps * 1000) / elapsed.TotalMilliseconds, Util.MarkerString);
}
}
}
diff --git a/clicache/integration-test2/Cluster.cs b/clicache/integration-test2/Cluster.cs
index 8ceb219..8ccfe00 100644
--- a/clicache/integration-test2/Cluster.cs
+++ b/clicache/integration-test2/Cluster.cs
@@ -32,7 +32,6 @@
private int serverCount_;
private bool started_;
private List<Locator> locators_;
- private List<Server> servers_;
private string name_;
internal int jmxManagerPort = Framework.FreeTcpPort();
internal string keyStore_ = Environment.CurrentDirectory + "/ServerSslKeys/server_keystore.jks";
diff --git a/cppcache/include/geode/RegionAttributesFactory.hpp b/cppcache/include/geode/RegionAttributesFactory.hpp
index 9eb3bfb..8bfcdc6 100644
--- a/cppcache/include/geode/RegionAttributesFactory.hpp
+++ b/cppcache/include/geode/RegionAttributesFactory.hpp
@@ -439,6 +439,8 @@
RegionAttributes create();
private:
+ RegionAttributesFactory& operator=(const RegionAttributesFactory& other) =
+ default;
RegionAttributes m_regionAttributes;
static void validateAttributes(RegionAttributes& attrs);
}; // namespace client
diff --git a/cppcache/src/CacheImpl.cpp b/cppcache/src/CacheImpl.cpp
index a2cce13..168a23c 100644
--- a/cppcache/src/CacheImpl.cpp
+++ b/cppcache/src/CacheImpl.cpp
@@ -327,7 +327,7 @@
bool CacheImpl::isCacheDestroyPending() const { return m_destroyPending; }
void CacheImpl::validateRegionAttributes(
- const std::string& name, const RegionAttributes regionAttributes) const {
+ const std::string& name, const RegionAttributes& regionAttributes) const {
auto&& kind = getRegionKind(regionAttributes);
if (regionAttributes.m_clientNotificationEnabled && kind == CPP_REGION) {
throw UnsupportedOperationException(
@@ -340,7 +340,7 @@
// do a load using a real C++ loader, instead of passing a member function
// pointer here
void CacheImpl::createRegion(std::string name,
- RegionAttributes regionAttributes,
+ const RegionAttributes& regionAttributes,
std::shared_ptr<Region>& regionPtr) {
{
std::lock_guard<decltype(m_initDoneLock)> _guard(m_initDoneLock);
diff --git a/cppcache/src/CacheImpl.hpp b/cppcache/src/CacheImpl.hpp
index 25b01ae..bd718b6 100644
--- a/cppcache/src/CacheImpl.hpp
+++ b/cppcache/src/CacheImpl.hpp
@@ -169,7 +169,7 @@
* @throws NotConnectedException if the cache is not connected
* @throws UnknownException otherwise
*/
- void createRegion(std::string name, RegionAttributes aRegionAttributes,
+ void createRegion(std::string name, const RegionAttributes& aRegionAttributes,
std::shared_ptr<Region>& regionPtr);
/**
@@ -349,7 +349,7 @@
void sendNotificationCloseMsgs();
void validateRegionAttributes(const std::string& name,
- const RegionAttributes attrs) const;
+ const RegionAttributes& attrs) const;
inline void getSubRegions(
std::unordered_map<std::string, std::shared_ptr<Region>>& srm) {
diff --git a/cppcache/src/CacheXmlParser.cpp b/cppcache/src/CacheXmlParser.cpp
index ac9892d..47c2382 100644
--- a/cppcache/src/CacheXmlParser.cpp
+++ b/cppcache/src/CacheXmlParser.cpp
@@ -18,6 +18,7 @@
#include "CacheXmlParser.hpp"
#include <chrono>
+#include <cinttypes>
#include <geode/PoolFactory.hpp>
#include <geode/PoolManager.hpp>
@@ -362,7 +363,7 @@
void CacheXmlParser::fatalError(const xercesc::SAXParseException &exception) {
char *message = xercesc::XMLString::transcode(exception.getMessage());
- LOGDEBUG("Fatal Error: \"%s\" at line: %ulld", message,
+ LOGDEBUG("Fatal Error: \"%s\" at line: %" PRIu64, message,
exception.getLineNumber());
auto ex = CacheXmlException(message);
xercesc::XMLString::release(&message);
diff --git a/cppcache/src/ClientMetadata.cpp b/cppcache/src/ClientMetadata.cpp
index 2754190..6b93d9e 100644
--- a/cppcache/src/ClientMetadata.cpp
+++ b/cppcache/src/ClientMetadata.cpp
@@ -46,7 +46,8 @@
}
if (fpaSet != nullptr) {
LOGDEBUG(
- "ClientMetadata Creating metadata with %d buckets & fpaset size is %d ",
+ "ClientMetadata Creating metadata with %d buckets & fpaset size is "
+ "%zu ",
totalNumBuckets, fpaSet->size());
if (!fpaSet->empty()) {
int totalFPABuckets = 0;
@@ -123,7 +124,7 @@
if (m_bucketServerLocationsList[bucketId].empty()) {
return;
} else if (tryPrimary) {
- LOGFINER("returning primary & m_bucketServerLocationsList size is %d",
+ LOGFINER("returning primary & m_bucketServerLocationsList size is %zu",
m_bucketServerLocationsList.size());
serverLocation = m_bucketServerLocationsList[bucketId].at(0);
if (serverLocation->isValid()) {
@@ -293,7 +294,7 @@
int ClientMetadata::assignFixedBucketId(
const char* partitionName, std::shared_ptr<CacheableKey> resolvekey) {
LOGDEBUG(
- "FPR assignFixedBucketId partititonname = %s , m_fpaMap.size() = %d ",
+ "FPR assignFixedBucketId partititonname = %s , m_fpaMap.size() = %zu ",
partitionName, m_fpaMap.size());
FixedMapType::iterator iter = m_fpaMap.find(partitionName);
if (iter != m_fpaMap.end()) {
diff --git a/cppcache/src/ClientMetadataService.cpp b/cppcache/src/ClientMetadataService.cpp
index ba3ea21..bf78afa 100644
--- a/cppcache/src/ClientMetadataService.cpp
+++ b/cppcache/src/ClientMetadataService.cpp
@@ -211,7 +211,8 @@
m_regionMetadataLock);
LOGDEBUG(
"ClientMetadataService::getBucketServerLocation m_regionMetaDataMap "
- "size is %d",
+ "size is %zu",
+
m_regionMetaDataMap.size());
std::string path(region->getFullPath());
std::shared_ptr<ClientMetadata> cptr = nullptr;
@@ -362,7 +363,7 @@
keyList = itrRes->second;
}
- LOGDEBUG("new keylist buckets =%d res = %d", buckets.size(),
+ LOGDEBUG("new keylist buckets =%zu res = %zu", buckets.size(),
serverToFilterMap->size());
} else {
keyList = (*serverToFilterMap)[bucketsIter->second];
@@ -499,7 +500,8 @@
bucketSet.insert(iter.first);
}
LOGDEBUG(
- "ClientMetadataService::getServerToFilterMapFESHOP: bucketSet size = %d ",
+ "ClientMetadataService::getServerToFilterMapFESHOP: bucketSet size = "
+ "%zu ",
bucketSet.size());
const auto serverToBuckets =
@@ -544,13 +546,13 @@
BucketSet buckets(*(serverToBucketEntry.second));
LOGDEBUG(
- "ClientMetadataService::findNextServer currentBucketSet->size() = %d "
- "bucketSet->size() = %d ",
+ "ClientMetadataService::findNextServer currentBucketSet->size() = %zu "
+ "bucketSet->size() = %zu ",
currentBucketSet.size(), buckets.size());
for (const auto& currentBucketSetIter : currentBucketSet) {
buckets.erase(currentBucketSetIter);
- LOGDEBUG("ClientMetadataService::findNextServer bucketSet->size() = %d ",
+ LOGDEBUG("ClientMetadataService::findNextServer bucketSet->size() = %zu ",
buckets.size());
}
@@ -619,7 +621,7 @@
size_t size = serverToBucketsMap.size();
LOGDEBUG(
"ClientMetadataService::pruneNodes Total size of serverToBucketsMap = "
- "%d ",
+ "%zu ",
size);
for (size_t idx = 0; idx < RandGen{}(size); idx++) {
itrRes++;
@@ -645,13 +647,13 @@
const auto& bucketSet2 = serverToBucketsMap.find(server)->second;
LOGDEBUG(
- "ClientMetadataService::pruneNodes currentBucketSet->size() = %d "
- "bucketSet2->size() = %d ",
+ "ClientMetadataService::pruneNodes currentBucketSet->size() = %zu "
+ "bucketSet2->size() = %zu ",
currentBucketSet.size(), bucketSet2->size());
for (const auto& currentBucketSetIter : currentBucketSet) {
bucketSet2->erase(currentBucketSetIter);
- LOGDEBUG("ClientMetadataService::pruneNodes bucketSet2->size() = %d ",
+ LOGDEBUG("ClientMetadataService::pruneNodes bucketSet2->size() = %zu ",
bucketSet2->size());
}
@@ -781,9 +783,9 @@
auto totalBuckets = cptr->getTotalNumBuckets();
for (decltype(totalBuckets) i = 0; i < totalBuckets; i++) {
- int8_t version;
+ int8_t serverVersion;
std::shared_ptr<BucketServerLocation> bsl;
- cptr->getServerLocation(i, false, bsl, version);
+ cptr->getServerLocation(i, false, bsl, serverVersion);
if (bsl == serverLocation) {
prBuckets->setBucketTimeout(i);
diff --git a/cppcache/src/CqQueryImpl.cpp b/cppcache/src/CqQueryImpl.cpp
index 53aa8cd..c11cfb3 100644
--- a/cppcache/src/CqQueryImpl.cpp
+++ b/cppcache/src/CqQueryImpl.cpp
@@ -151,7 +151,7 @@
if (!cqListeners.empty()) {
LOGFINE(
"Invoking CqListeners close() api for the CQ, CqName : %s Number of "
- "CqListeners : %d",
+ "CqListeners : %" PRIu64,
m_cqName.c_str(), cqListeners.size());
for (auto& l : cqListeners) {
diff --git a/cppcache/src/DataOutput.cpp b/cppcache/src/DataOutput.cpp
index 29b5470..12afb19 100644
--- a/cppcache/src/DataOutput.cpp
+++ b/cppcache/src/DataOutput.cpp
@@ -95,7 +95,7 @@
TSSDataOutput::TSSDataOutput() : m_buffers() {
m_buffers.reserve(10);
- LOGDEBUG("DATAOUTPUT poolsize is %d", m_buffers.size());
+ LOGDEBUG("DATAOUTPUT poolsize is %zu", m_buffers.size());
}
TSSDataOutput::~TSSDataOutput() {
diff --git a/cppcache/src/EntryExpiryHandler.cpp b/cppcache/src/EntryExpiryHandler.cpp
index cc02155..7a8c4c7 100644
--- a/cppcache/src/EntryExpiryHandler.cpp
+++ b/cppcache/src/EntryExpiryHandler.cpp
@@ -58,7 +58,7 @@
auto elapsed = curr_time - lastTimeForExp;
LOGDEBUG(
"Entered entry expiry task handler for key [%s] of region [%s]: "
- "%d,%d,%d,%d",
+ "%z,%z,%z,%z",
Utils::nullSafeToString(key).c_str(),
m_regionPtr->getFullPath().c_str(),
curr_time.time_since_epoch().count(),
@@ -71,7 +71,7 @@
// (lastAccessTime + entryExpiryDuration - curr_time) in seconds
auto remaining = m_duration - elapsed;
LOGDEBUG(
- "Resetting expiry task %d secs later for key [%s] of region [%s]",
+ "Resetting expiry task %z secs later for key [%s] of region [%s]",
remaining.count(), Utils::nullSafeToString(key).c_str(),
m_regionPtr->getFullPath().c_str());
m_regionPtr->getCacheImpl()->getExpiryTaskManager().resetTask(
diff --git a/cppcache/src/FairQueue.hpp b/cppcache/src/FairQueue.hpp
index 7e038c6..fae436e 100644
--- a/cppcache/src/FairQueue.hpp
+++ b/cppcache/src/FairQueue.hpp
@@ -92,7 +92,7 @@
ACE_Guard<MUTEX> _guard(m_queueLock);
m_closed = true;
- LOGDEBUG("Internal fair queue size while closing is %d", m_queue.size());
+ LOGDEBUG("Internal fair queue size while closing is %zu", m_queue.size());
while (m_queue.size() > 0) {
T* mp = m_queue.back();
m_queue.pop_back();
diff --git a/cppcache/src/LocalRegion.cpp b/cppcache/src/LocalRegion.cpp
index 07d45db..a30f49b 100644
--- a/cppcache/src/LocalRegion.cpp
+++ b/cppcache/src/LocalRegion.cpp
@@ -110,11 +110,11 @@
// locking not required since setters use atomic operations
if (regionExpiryEnabled()) {
auto now = std::chrono::system_clock::now();
- LOGDEBUG("Setting last accessed time for region %s to %d",
+ LOGDEBUG("Setting last accessed time for region %s to %z",
getFullPath().c_str(), now.time_since_epoch().count());
m_cacheStatistics->setLastAccessedTime(now);
if (modified) {
- LOGDEBUG("Setting last modified time for region %s to %d",
+ LOGDEBUG("Setting last modified time for region %s to %z",
getFullPath().c_str(), now.time_since_epoch().count());
m_cacheStatistics->setLastModifiedTime(now);
}
@@ -695,7 +695,7 @@
handler, duration, std::chrono::seconds::zero());
handler->setExpiryTaskId(expiryTaskId);
LOGFINE(
- "expiry for region [%s], expiry task id = %d, duration = %d, "
+ "expiry for region [%s], expiry task id = %z, duration = %z, "
"action = %d",
m_fullPath.c_str(), expiryTaskId, duration.count(),
getRegionExpiryAction());
@@ -718,8 +718,8 @@
std::shared_ptr<CacheableKey> key;
entry->getKeyI(key);
LOGFINEST(
- "entry expiry in region [%s], key [%s], task id = %d, "
- "duration = %d, action = %d",
+ "entry expiry in region [%s], key [%s], task id = %z, "
+ "duration = %z, action = %d",
m_fullPath.c_str(), Utils::nullSafeToString(key).c_str(), id,
duration.count(), getEntryExpirationAction());
}
@@ -2006,7 +2006,7 @@
}
if (versionedObjPartListPtr) {
- LOGDEBUG("versionedObjPartListPtr->getVersionedTagptr().size() = %d ",
+ LOGDEBUG("versionedObjPartListPtr->getVersionedTagptr().size() = %zu",
versionedObjPartListPtr->getVersionedTagptr().size());
if (versionedObjPartListPtr->getVersionedTagptr().size() > 0) {
versionTag =
@@ -2044,8 +2044,9 @@
auto& p = oldValueMap[key];
if (versionedObjPartListPtr) {
- LOGDEBUG("versionedObjPartListPtr->getVersionedTagptr().size() = %d ",
- versionedObjPartListPtr->getVersionedTagptr().size());
+ LOGDEBUG(
+ "versionedObjPartListPtr->getVersionedTagptr().size() = %zu ",
+ versionedObjPartListPtr->getVersionedTagptr().size());
if (versionedObjPartListPtr->getVersionedTagptr().size() > 0) {
versionTag = versionedObjPartListPtr->getVersionedTagptr()[index++];
}
@@ -2117,7 +2118,7 @@
for (size_t keyIndex = 0; keyIndex < keysPtr->size(); keyIndex++) {
auto key = keysPtr->at(keyIndex);
if (versionedObjPartListPtr) {
- LOGDEBUG("versionedObjPartListPtr->getVersionedTagptr().size() = %d ",
+ LOGDEBUG("versionedObjPartListPtr->getVersionedTagptr().size() = %zu ",
versionedObjPartListPtr->getVersionedTagptr().size());
if (versionedObjPartListPtr->getVersionedTagptr().size() > 0) {
versionTag = versionedObjPartListPtr->getVersionedTagptr()[keyIndex];
@@ -2795,12 +2796,12 @@
ptr->getKeyI(key);
keyStr = Utils::nullSafeToString(key);
}
- LOGDEBUG("Setting last accessed time for key [%s] in region %s to %d",
+ LOGDEBUG("Setting last accessed time for key [%s] in region %s to %z",
keyStr.c_str(), getFullPath().c_str(),
currTime.time_since_epoch().count());
expProps.updateLastAccessTime(currTime);
if (modified) {
- LOGDEBUG("Setting last modified time for key [%s] in region %s to %d",
+ LOGDEBUG("Setting last modified time for key [%s] in region %s to %z",
keyStr.c_str(), getFullPath().c_str(),
currTime.time_since_epoch().count());
expProps.updateLastModifiedTime(currTime);
diff --git a/cppcache/src/MapEntry.hpp b/cppcache/src/MapEntry.hpp
index bd826f9..f10a5e0 100644
--- a/cppcache/src/MapEntry.hpp
+++ b/cppcache/src/MapEntry.hpp
@@ -96,7 +96,7 @@
inline void cancelExpiryTaskId(
const std::shared_ptr<CacheableKey>& key) const {
- LOGDEBUG("Cancelling expiration task for key [%s] with id [%d]",
+ LOGDEBUG("Cancelling expiration task for key [%s] with id [%z]",
Utils::nullSafeToString(key).c_str(), m_expiryTaskId);
m_expiryTaskManager->cancelTask(m_expiryTaskId);
}
diff --git a/cppcache/src/PdxLocalReader.cpp b/cppcache/src/PdxLocalReader.cpp
index b8e5fc0..1178f47 100644
--- a/cppcache/src/PdxLocalReader.cpp
+++ b/cppcache/src/PdxLocalReader.cpp
@@ -180,7 +180,7 @@
const std::string&) {
auto coa = CacheableObjectArray::create();
coa->fromData(*m_dataInput);
- LOGDEBUG("PdxLocalReader::readObjectArray coa->size() = %d", coa->size());
+ LOGDEBUG("PdxLocalReader::readObjectArray coa->size() = %zu", coa->size());
if (coa->size() <= 0) {
coa = nullptr;
}
diff --git a/cppcache/src/PdxType.cpp b/cppcache/src/PdxType.cpp
index 53bb207..c470c2c 100644
--- a/cppcache/src/PdxType.cpp
+++ b/cppcache/src/PdxType.cpp
@@ -182,8 +182,8 @@
m_remoteToLocalFieldMap = new int32_t[m_pdxFieldTypes->size()];
LOGDEBUG(
- "PdxType::initRemoteToLocal m_pdxFieldTypes->size() =%d AND "
- "localPdxFields->size()=%d",
+ "PdxType::initRemoteToLocal m_pdxFieldTypes->size() =%zu AND "
+ "localPdxFields->size()=%zu",
m_pdxFieldTypes->size(), localPdxFields->size());
for (std::vector<std::shared_ptr<PdxFieldType>>::iterator remotePdxField =
m_pdxFieldTypes->begin();
diff --git a/cppcache/src/PreservedDataExpiryHandler.cpp b/cppcache/src/PreservedDataExpiryHandler.cpp
index e30dd53..a81a224 100644
--- a/cppcache/src/PreservedDataExpiryHandler.cpp
+++ b/cppcache/src/PreservedDataExpiryHandler.cpp
@@ -46,7 +46,7 @@
auto map = m_pdxTypeRegistry->getPreserveDataMap();
LOGDEBUG(
"Entered PreservedDataExpiryHandler "
- "PdxTypeRegistry::getPreserveDataMap().size() = %d",
+ "PdxTypeRegistry::getPreserveDataMap().size() = %zu",
map.size());
try {
diff --git a/cppcache/src/RegionExpiryHandler.cpp b/cppcache/src/RegionExpiryHandler.cpp
index 71ffc46..58e2348 100644
--- a/cppcache/src/RegionExpiryHandler.cpp
+++ b/cppcache/src/RegionExpiryHandler.cpp
@@ -55,7 +55,7 @@
}
auto elapsed = curr_time - lastTimeForExp;
- LOGDEBUG("Entered region expiry task handler for region [%s]: %d,%d,%d,%d",
+ LOGDEBUG("Entered region expiry task handler for region [%s]: %z,%z,%z,%z",
m_regionPtr->getFullPath().c_str(),
curr_time.time_since_epoch().count(),
lastTimeForExp.time_since_epoch().count(), m_duration.count(),
diff --git a/cppcache/src/TcpConn.cpp b/cppcache/src/TcpConn.cpp
index 95d101f..9dd6c97 100644
--- a/cppcache/src/TcpConn.cpp
+++ b/cppcache/src/TcpConn.cpp
@@ -209,7 +209,7 @@
ACE_OS::signal(SIGPIPE, SIG_IGN); // Ignore broken pipe
- LOGFINER("Connecting plain socket stream to %s:%d waiting %d micro sec",
+ LOGFINER("Connecting plain socket stream to %s:%d waiting %z micro sec",
ipaddr.get_host_name(), ipaddr.get_port_number(),
waitMicroSeconds.count());
diff --git a/cppcache/src/TcpSslConn.cpp b/cppcache/src/TcpSslConn.cpp
index 22b59aa..539b80c 100644
--- a/cppcache/src/TcpSslConn.cpp
+++ b/cppcache/src/TcpSslConn.cpp
@@ -91,7 +91,7 @@
std::chrono::microseconds waitMicroSeconds = m_waitMilliSeconds;
- LOGDEBUG("Connecting SSL socket stream to %s:%d waiting %d micro sec",
+ LOGDEBUG("Connecting SSL socket stream to %s:%d waiting %z micro sec",
m_addr.get_host_name(), m_addr.get_port_number(),
waitMicroSeconds.count());
diff --git a/cppcache/src/TcrConnection.cpp b/cppcache/src/TcrConnection.cpp
index f847e91..8743473 100644
--- a/cppcache/src/TcrConnection.cpp
+++ b/cppcache/src/TcrConnection.cpp
@@ -616,10 +616,10 @@
readHandshakeRawData, readHandShakeBytes, readHandShakeInt,
readHandshakeString, all call TcrConnection::receiveData.
*/
- LOGDEBUG("TcrConnection::receiveData length = %d defaultWaitSecs = %d",
+ LOGDEBUG("TcrConnection::receiveData length = %d defaultWaitSecs = %z",
length, defaultWaitSecs.count());
if (m_poolDM != nullptr) {
- LOGDEBUG("TcrConnection::receiveData readBytes = %d", readBytes);
+ LOGDEBUG("TcrConnection::receiveData readBytes = %zu", readBytes);
m_poolDM->getStats().incReceivedBytes(static_cast<int64_t>(readBytes));
}
receiveTimeoutSec -= defaultWaitSecs;
@@ -645,7 +645,7 @@
std::chrono::microseconds defaultWaitSecs = std::chrono::seconds(2);
if (defaultWaitSecs > sendTimeout) defaultWaitSecs = sendTimeout;
LOGDEBUG(
- "before send len %d sendTimeoutSec = %d checkConnected = %d m_connected "
+ "before send len %zu sendTimeoutSec = %z checkConnected = %d m_connected "
"%d",
length, sendTimeout.count(), checkConnected, m_connected);
while (length > 0 && sendTimeout > std::chrono::microseconds::zero()) {
diff --git a/cppcache/src/TcrConnection.hpp b/cppcache/src/TcrConnection.hpp
index fe18794..713c364 100644
--- a/cppcache/src/TcrConnection.hpp
+++ b/cppcache/src/TcrConnection.hpp
@@ -295,12 +295,12 @@
void updateCreationTime();
int64_t getConnectionId() {
- LOGDEBUG("TcrConnection::getConnectionId() = %d ", connectionId);
+ LOGDEBUG("TcrConnection::getConnectionId() = %" PRId64, connectionId);
return connectionId;
}
void setConnectionId(int64_t id) {
- LOGDEBUG("Tcrconnection:setConnectionId() = %d ", id);
+ LOGDEBUG("Tcrconnection:setConnectionId() = %" PRId64, id);
connectionId = id;
}
diff --git a/cppcache/src/TcrConnectionManager.cpp b/cppcache/src/TcrConnectionManager.cpp
index 609c761..0643f47 100644
--- a/cppcache/src/TcrConnectionManager.cpp
+++ b/cppcache/src/TcrConnectionManager.cpp
@@ -160,7 +160,7 @@
}
for (const auto &iter : m_endpoints) {
auto ep = iter.second;
- LOGFINE("TCCM: forcing endpoint delete for %d in destructor",
+ LOGFINE("TCCM: forcing endpoint delete for %s in destructor",
ep->name().c_str());
_GEODE_SAFE_DELETE(ep);
}
@@ -181,7 +181,7 @@
LOGFINE(
"TcrConnectionManager::connect(): Empty endpointstr vector "
"passed to TCCM, will initialize endpoints list with all available "
- "endpoints (%d).",
+ "endpoints (%zu).",
m_endpoints.size());
for (const auto &currItr : m_endpoints) {
auto ep = currItr.second;
diff --git a/cppcache/src/TcrEndpoint.cpp b/cppcache/src/TcrEndpoint.cpp
index 5ef3e0e..2925d64 100644
--- a/cppcache/src/TcrEndpoint.cpp
+++ b/cppcache/src/TcrEndpoint.cpp
@@ -185,7 +185,7 @@
std::chrono::microseconds connectTimeout, int32_t timeoutRetries,
bool appThreadRequest) {
LOGFINE(
- "TcrEndpoint::createNewConnection: connectTimeout =%d "
+ "TcrEndpoint::createNewConnection: connectTimeout =%z "
"m_needToConnectInLock=%d appThreadRequest =%d",
connectTimeout.count(), m_needToConnectInLock, appThreadRequest);
GfErrType err = GF_NOERR;
diff --git a/cppcache/src/TcrEndpoint.hpp b/cppcache/src/TcrEndpoint.hpp
index e80ca33..cf527d3 100644
--- a/cppcache/src/TcrEndpoint.hpp
+++ b/cppcache/src/TcrEndpoint.hpp
@@ -110,13 +110,13 @@
// TODO: for single user mode only
void setUniqueId(int64_t uniqueId) {
- LOGDEBUG("tcrEndpoint:setUniqueId:: %d ", uniqueId);
+ LOGDEBUG("tcrEndpoint:setUniqueId:: %" PRId64, uniqueId);
m_isAuthenticated = true;
m_uniqueId = uniqueId;
}
int64_t getUniqueId() {
- LOGDEBUG("tcrEndpoint:getUniqueId:: %d ", m_uniqueId);
+ LOGDEBUG("tcrEndpoint:getUniqueId:: %" PRId64, m_uniqueId);
return m_uniqueId;
}
diff --git a/cppcache/src/TcrMessage.cpp b/cppcache/src/TcrMessage.cpp
index f1a51fe..e05e12f 100644
--- a/cppcache/src/TcrMessage.cpp
+++ b/cppcache/src/TcrMessage.cpp
@@ -639,7 +639,7 @@
input.read(); // ignore typeId
// input.readDirectObject(m_failedNode, typeId);
m_failedNode->fromData(input);
- LOGDEBUG("readFailedNodePart m_failedNode size = %d ", m_failedNode->size());
+ LOGDEBUG("readFailedNodePart m_failedNode size = %zu", m_failedNode->size());
}
void TcrMessage::readKeyPart(DataInput& input) {
@@ -1500,7 +1500,7 @@
}
m_metadata->push_back(bucketServerLocations);
}
- LOGFINER("Metadata size is %d", m_metadata->size());
+ LOGFINER("Metadata size is %", m_metadata->size());
}
break;
}
@@ -2690,13 +2690,13 @@
if (routingObj) {
writeIntPart(static_cast<int32_t>(routingObj->size()));
if (allBuckets) {
- LOGDEBUG("All Buckets so putting IntPart for buckets = %d ",
+ LOGDEBUG("All Buckets so putting IntPart for buckets = %zu",
routingObj->size());
for (const auto& itr : *routingObj) {
writeIntPart(std::dynamic_pointer_cast<CacheableInt32>(itr)->value());
}
} else {
- LOGDEBUG("putting keys as withFilter called, routing Keys size = %d ",
+ LOGDEBUG("putting keys as withFilter called, routing Keys size = %zu",
routingObj->size());
for (const auto& itr : *routingObj) {
writeObjectPart(itr);
diff --git a/cppcache/src/ThinClientPoolDM.cpp b/cppcache/src/ThinClientPoolDM.cpp
index abe59ce..617343d 100644
--- a/cppcache/src/ThinClientPoolDM.cpp
+++ b/cppcache/src/ThinClientPoolDM.cpp
@@ -502,7 +502,7 @@
LOGERROR("Failed to reschedule connection manager");
} else {
LOGFINEST(
- "Rescheduled next connection manager run after %d seconds",
+ "Rescheduled next connection manager run after %z seconds",
std::chrono::duration_cast<std::chrono::seconds>(_nextIdle).count());
}
@@ -835,7 +835,7 @@
for (const auto& iter : m_endpoints) {
auto ep = iter.second;
- LOGFINE("ThinClientPoolDM: forcing endpoint delete for %d in destructor",
+ LOGFINE("ThinClientPoolDM: forcing endpoint delete for %s in destructor",
ep->name().c_str());
_GEODE_SAFE_DELETE(ep);
}
diff --git a/cppcache/src/ThinClientRedundancyManager.cpp b/cppcache/src/ThinClientRedundancyManager.cpp
index fbea7c5..9e4e485 100644
--- a/cppcache/src/ThinClientRedundancyManager.cpp
+++ b/cppcache/src/ThinClientRedundancyManager.cpp
@@ -170,7 +170,7 @@
LOGDEBUG(
"ThinClientRedundancyManager::maintainRedundancyLevel(): checking "
- "redundant list, size = %d",
+ "redundant list, size = %zu",
m_redundantEndpoints.size());
while (!isRedundancySatisfied && itRedundant != m_redundantEndpoints.end()) {
if (!isPrimaryConnected) {
@@ -243,7 +243,7 @@
LOGDEBUG(
"ThinClientRedundancyManager::maintainRedundancyLevel(): finding "
- "nonredundant endpoints, size = %d",
+ "nonredundant endpoints, size = %zu",
m_nonredundantEndpoints.size());
std::vector<TcrEndpoint*>::iterator itNonredundant =
m_nonredundantEndpoints.begin();
@@ -446,15 +446,14 @@
}
m_IsAllEpDisCon = false;
if (m_redundancyLevel == -1) {
- LOGINFO("Current subscription redundancy level is %d",
+ LOGINFO("Current subscription redundancy level is %zu",
m_redundantEndpoints.size() - 1);
return GF_NOERR;
}
if (!m_loggedRedundancyWarning) {
LOGWARN(
"Requested subscription redundancy level %d is not satisfiable with "
- "%d "
- "servers available",
+ "%zu servers available",
m_redundancyLevel, m_redundantEndpoints.size());
m_loggedRedundancyWarning = true;
}
@@ -805,7 +804,8 @@
if (m_redundantEndpoints.size() >= 1) {
LOGDEBUG(
- "ThinClientRedundancyManager::sendSyncRequestCq: to secondary size[%d]",
+ "ThinClientRedundancyManager::sendSyncRequestCq: to secondary "
+ "size[%zu]",
m_redundantEndpoints.size());
std::vector<TcrEndpoint*>::iterator iter = m_redundantEndpoints.begin();
LOGDEBUG("endpoint[%s]", (*iter)->name().c_str());
@@ -1173,12 +1173,13 @@
};
if (result == GF_NOERR && reply.getMessageType() == TcrMessage::REPLY) {
- LOGFINE("Sent subscription ack message for %d sources to endpoint %s",
- count, (*endpoint)->name().c_str());
+ LOGFINE(
+ "Sent subscription ack message for %zu sources to endpoint %s",
+ count, (*endpoint)->name().c_str());
acked = true;
} else {
LOGWARN(
- "Failure sending subscription ack message for %d sources to "
+ "Failure sending subscription ack message for %zu sources to "
"endpoint %s",
count, (*endpoint)->name().c_str());
LOGFINER("Ack result is %d and reply message type is %d", result,
@@ -1186,7 +1187,8 @@
}
} else {
LOGWARN(
- "No subscription servers available for periodic ack for %d sources",
+ "No subscription servers available for periodic ack for %zu "
+ "sources",
count);
}
diff --git a/cppcache/src/ThinClientRegion.cpp b/cppcache/src/ThinClientRegion.cpp
index 11e2654..8e0cc35 100644
--- a/cppcache/src/ThinClientRegion.cpp
+++ b/cppcache/src/ThinClientRegion.cpp
@@ -1265,7 +1265,7 @@
std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
std::chrono::milliseconds timeout,
const std::shared_ptr<Serializable>& aCallbackArgument) {
- LOGDEBUG(" ThinClientRegion::singleHopPutAllNoThrow_remote map size = %d",
+ LOGDEBUG(" ThinClientRegion::singleHopPutAllNoThrow_remote map size = %zu",
map.size());
auto region = shared_from_this();
@@ -1384,7 +1384,7 @@
CacheableInt32::create(error));
}
- LOGDEBUG("worker->getPutAllMap()->size() = %d ",
+ LOGDEBUG("worker->getPutAllMap()->size() = %zu ",
worker->getPutAllMap()->size());
LOGDEBUG(
"worker->getResultCollector()->getList()->getVersionedTagsize() = %d ",
@@ -1461,7 +1461,7 @@
* failedServers->contains(locationIter.first()is false.
*/
- LOGDEBUG("ThinClientRegion:: %s:%d failedServers->size() = %d", __FILE__,
+ LOGDEBUG("ThinClientRegion:: %s:%d failedServers->size() = %zu", __FILE__,
__LINE__, failedServers.size());
// if the partial result set doesn't already have keys (for tracking version
@@ -1655,8 +1655,9 @@
const std::vector<std::shared_ptr<CacheableKey>>& keys,
std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
const std::shared_ptr<Serializable>& aCallbackArgument) {
- LOGDEBUG(" ThinClientRegion::singleHopRemoveAllNoThrow_remote keys size = %d",
- keys.size());
+ LOGDEBUG(
+ " ThinClientRegion::singleHopRemoveAllNoThrow_remote keys size = %zu",
+ keys.size());
auto region = shared_from_this();
GfErrType error = GF_NOERR;
@@ -1811,7 +1812,7 @@
* failedServers->contains(locationIter.first()is false.
*/
- LOGDEBUG("ThinClientRegion:: %s:%d failedServers->size() = %d", __FILE__,
+ LOGDEBUG("ThinClientRegion:: %s:%d failedServers->size() = %zu", __FILE__,
__LINE__, failedServers.size());
// if the partial result set doesn't already have keys (for tracking version
@@ -2998,7 +2999,7 @@
if (failedNodesIds) {
LOGDEBUG(
"ThinClientRegion::executeFunction with GF_FUNCTION_EXCEPTION "
- "failedNodesIds size = %d ",
+ "failedNodesIds size = %zu ",
failedNodesIds->size());
failedNodes->insert(failedNodesIds->begin(), failedNodesIds->end());
}
@@ -3015,16 +3016,17 @@
rc->clearResults();
failedNodes->clear();
} else if (err == GF_TIMEOUT) {
- LOGINFO(
- "function timeout. Name: %s, timeout: %d, params: %d, "
- "retryAttempts: %d ",
- func.c_str(), timeout.count(), getResult, retryAttempts);
+ LOGINFO("function timeout. Name: %s, timeout: %z, params: %" PRIu8
+ ", "
+ "retryAttempts: %d ",
+ func.c_str(), timeout.count(), getResult, retryAttempts);
throwExceptionIfError("ExecuteOnRegion", GF_TIMEOUT);
} else if (err == GF_CLIENT_WAIT_TIMEOUT ||
err == GF_CLIENT_WAIT_TIMEOUT_REFRESH_PRMETADATA) {
LOGINFO(
"function timeout, possibly bucket is not available or bucket "
- "blacklisted. Name: %s, timeout: %d, params: %d, retryAttempts: "
+ "blacklisted. Name: %s, timeout: %z, params: %" PRIu8
+ ", retryAttempts: "
"%d ",
func.c_str(), timeout.count(), getResult, retryAttempts);
throwExceptionIfError("ExecuteOnRegion", GF_CLIENT_WAIT_TIMEOUT);
@@ -3091,7 +3093,7 @@
if (failedNodesIds) {
LOGDEBUG(
"ThinClientRegion::reExecuteFunction with GF_FUNCTION_EXCEPTION "
- "failedNodesIds size = %d ",
+ "failedNodesIds size = %zu ",
failedNodesIds->size());
failedNodes->insert(failedNodesIds->begin(), failedNodesIds->end());
}
@@ -3180,7 +3182,7 @@
if (failedNodeIds) {
LOGDEBUG(
"ThinClientRegion::executeFunctionSH with GF_FUNCTION_EXCEPTION "
- "failedNodeIds size = %d ",
+ "failedNodeIds size = %zu ",
failedNodeIds->size());
failedNodes->insert(failedNodeIds->begin(), failedNodeIds->end());
}
diff --git a/examples/dotnet/functionexecution/Program.cs b/examples/dotnet/functionexecution/Program.cs
index 3ad385d..2a1f074 100644
--- a/examples/dotnet/functionexecution/Program.cs
+++ b/examples/dotnet/functionexecution/Program.cs
@@ -32,7 +32,7 @@
var poolFactory = cache.GetPoolFactory()
.AddLocator("localhost", 10334);
- var pool = poolFactory.Create("pool");
+ poolFactory.Create("pool");
var regionFactory = cache.CreateRegionFactory(RegionShortcut.PROXY)
.SetPoolName("pool");