diff --git a/roxie/ccd/ccdmain.cpp b/roxie/ccd/ccdmain.cpp index fa36b53862e..25a3c4cfb02 100644 --- a/roxie/ccd/ccdmain.cpp +++ b/roxie/ccd/ccdmain.cpp @@ -1313,11 +1313,11 @@ int CCD_API roxie_main(int argc, const char *argv[], const char * defaultYaml) setKeyIndexCacheSize((unsigned)-1); // unbound nodeCacheMB = topology->getPropInt("@nodeCacheMem", 100); - setNodeCacheMem(nodeCacheMB * 0x100000); + setNodeCacheMem(nodeCacheMB * 0x100000ULL); leafCacheMB = topology->getPropInt("@leafCacheMem", 50); - setLeafCacheMem(leafCacheMB * 0x100000); + setLeafCacheMem(leafCacheMB * 0x100000ULL); blobCacheMB = topology->getPropInt("@blobCacheMem", 0); - setBlobCacheMem(blobCacheMB * 0x100000); + setBlobCacheMem(blobCacheMB * 0x100000ULL); if (topology->hasProp("@nodeFetchThresholdNs")) setNodeFetchThresholdNs(topology->getPropInt64("@nodeFetchThresholdNs")); setIndexWarningThresholds(topology); diff --git a/roxie/ccd/ccdstate.cpp b/roxie/ccd/ccdstate.cpp index 1b239971d9c..abaa721003d 100644 --- a/roxie/ccd/ccdstate.cpp +++ b/roxie/ccd/ccdstate.cpp @@ -2318,7 +2318,7 @@ class CRoxiePackageSetManager : implements IRoxieQueryPackageManagerSet, impleme { blobCacheMB = control->getPropInt("@val", 0); topology->setPropInt("@blobCacheMem", blobCacheMB); - setBlobCacheMem(blobCacheMB * 0x100000); + setBlobCacheMem(blobCacheMB * 0x100000ULL); } else unknown = true; @@ -2549,7 +2549,7 @@ class CRoxiePackageSetManager : implements IRoxieQueryPackageManagerSet, impleme { leafCacheMB = control->getPropInt("@val", 50); topology->setPropInt("@leafCacheMem", leafCacheMB); - setLeafCacheMem(leafCacheMB * 0x100000); + setLeafCacheMem(leafCacheMB * 0x100000ULL); } else if (stricmp(queryName, "control:listFileOpenErrors")==0) { @@ -2656,7 +2656,7 @@ class CRoxiePackageSetManager : implements IRoxieQueryPackageManagerSet, impleme { nodeCacheMB = control->getPropInt("@val", 100); topology->setPropInt("@nodeCacheMem", nodeCacheMB); - setNodeCacheMem(nodeCacheMB * 0x100000); + setNodeCacheMem(nodeCacheMB * 0x100000ULL); } else if (stricmp(queryName, "control:numFilesToProcess")==0) { diff --git a/system/jhtree/jhtree.cpp b/system/jhtree/jhtree.cpp index 197d9198be9..692a88936c2 100644 --- a/system/jhtree/jhtree.cpp +++ b/system/jhtree/jhtree.cpp @@ -695,8 +695,8 @@ class DelayedCacheEntryReleaser : public IRemovedMappingCallback typedef OwningSimpleHashTableOf CNodeTable; class CNodeMRUSubCache final : public CMRUCacheOf { - std::atomic sizeInMem{0}; - size32_t memLimit = 0; + std::atomic sizeInMem{0}; + size_t memLimit = 0; public: mutable CriticalSection lock; RelaxedAtomic<__uint64> numHits{0}; @@ -704,9 +704,9 @@ class CNodeMRUSubCache final : public CMRUCacheOf numDups{0}; RelaxedAtomic<__uint64> numEvicts{0}; - size32_t setMemLimit(size32_t _memLimit) + size_t setMemLimit(size_t _memLimit) { - size32_t oldMemLimit = memLimit; + size_t oldMemLimit = memLimit; memLimit = _memLimit; if (full()) makeSpace(nullptr); @@ -722,7 +722,7 @@ class CNodeMRUSubCache final : public CMRUCacheOf memLimit; } virtual void elementRemoved(CNodeMapping *mapping) @@ -782,7 +782,7 @@ class CNodeMRUSubCache final : public CMRUCacheOf> metrics; public: - CNodeCache(size32_t maxNodeMem, size32_t maxLeaveMem, size32_t maxBlobMem) + CNodeCache(size_t maxNodeMem, size_t maxLeaveMem, size_t maxBlobMem) { setNodeCacheMem(maxNodeMem); setLeafCacheMem(maxLeaveMem); @@ -925,15 +925,15 @@ class CNodeCache : public CInterface const CJHTreeNode *getCachedNode(const INodeLoader *key, unsigned keyID, offset_t pos, NodeType type, IContextLogger *ctx, bool isTLK); void getCacheInfo(ICacheInfoRecorder &cacheInfo); - inline size32_t setNodeCacheMem(size32_t newSize) + inline size_t setNodeCacheMem(size_t newSize) { return setCacheMem(newSize, CacheBranch); } - inline size32_t setLeafCacheMem(size32_t newSize) + inline size_t setLeafCacheMem(size_t newSize) { return setCacheMem(newSize, CacheLeaf); } - inline size32_t setBlobCacheMem(size32_t newSize) + inline size_t setBlobCacheMem(size_t newSize) { return setCacheMem(newSize, CacheBlob); } @@ -965,7 +965,7 @@ class CNodeCache : public CInterface } protected: - size32_t setCacheMem(size32_t newSize, CacheType type) + size_t setCacheMem(size_t newSize, CacheType type) { return cache[type].setCacheMem(newSize); } @@ -2713,17 +2713,17 @@ extern jhtree_decl void resetIndexMetrics() queryKeyStore()->resetMetrics(); } -extern jhtree_decl size32_t setNodeCacheMem(size32_t cacheSize) +extern jhtree_decl size_t setNodeCacheMem(size_t cacheSize) { return queryNodeCache()->setNodeCacheMem(cacheSize); } -extern jhtree_decl size32_t setLeafCacheMem(size32_t cacheSize) +extern jhtree_decl size_t setLeafCacheMem(size_t cacheSize) { return queryNodeCache()->setLeafCacheMem(cacheSize); } -extern jhtree_decl size32_t setBlobCacheMem(size32_t cacheSize) +extern jhtree_decl size_t setBlobCacheMem(size_t cacheSize) { return queryNodeCache()->setBlobCacheMem(cacheSize); } diff --git a/system/jhtree/jhtree.hpp b/system/jhtree/jhtree.hpp index 883ce8cb6b3..6eb2449afa9 100644 --- a/system/jhtree/jhtree.hpp +++ b/system/jhtree/jhtree.hpp @@ -136,9 +136,9 @@ extern jhtree_decl unsigned setKeyIndexCacheSize(unsigned limit); extern jhtree_decl void clearNodeCache(); extern jhtree_decl void logCacheState(); // these methods return previous values -extern jhtree_decl size32_t setNodeCacheMem(size32_t cacheSize); -extern jhtree_decl size32_t setLeafCacheMem(size32_t cacheSize); -extern jhtree_decl size32_t setBlobCacheMem(size32_t cacheSize); +extern jhtree_decl size_t setNodeCacheMem(size_t cacheSize); +extern jhtree_decl size_t setLeafCacheMem(size_t cacheSize); +extern jhtree_decl size_t setBlobCacheMem(size_t cacheSize); extern jhtree_decl void setNodeFetchThresholdNs(__uint64 thresholdNs); extern jhtree_decl void setIndexWarningThresholds(IPropertyTree * options);