Author: tv
Date: Wed May 15 09:44:56 2019
New Revision: 1859285

URL: http://svn.apache.org/viewvc?rev=1859285&view=rev
Log:
Make all statistic numbers long

Modified:
    
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/CacheRegionInfo.java
    
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSAdminBean.java
    
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSJMXBean.java

Modified: 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/CacheRegionInfo.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/CacheRegionInfo.java?rev=1859285&r1=1859284&r2=1859285&view=diff
==============================================================================
--- 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/CacheRegionInfo.java
 (original)
+++ 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/CacheRegionInfo.java
 Wed May 15 09:44:56 2019
@@ -41,16 +41,16 @@ public class CacheRegionInfo
     private final String cacheStatistics;
 
     /** The number of memory hits in the cache region */
-    private final int hitCountRam;
+    private final long hitCountRam;
 
     /** The number of auxiliary hits in the cache region */
-    private final int hitCountAux;
+    private final long hitCountAux;
 
     /** The number of misses in the cache region because the items were not 
found */
-    private final int missCountNotFound;
+    private final long missCountNotFound;
 
     /** The number of misses in the cache region because the items were 
expired */
-    private final int missCountExpired;
+    private final long missCountExpired;
 
     /** The number of bytes counted so far, will be a total of all items */
     private final long byteCount;
@@ -71,8 +71,8 @@ public class CacheRegionInfo
     @ConstructorProperties({"cacheName", "cacheSize", "cacheStatus", 
"cacheStatistics",
        "hitCountRam", "hitCountAux", "missCountNotFound", "missCountExpired", 
"byteCount"})
        public CacheRegionInfo(String cacheName, int cacheSize, String 
cacheStatus,
-                       String cacheStatistics, int hitCountRam, int 
hitCountAux,
-                       int missCountNotFound, int missCountExpired, long 
byteCount)
+                       String cacheStatistics, long hitCountRam, long 
hitCountAux,
+                       long missCountNotFound, long missCountExpired, long 
byteCount)
        {
                super();
                this.cacheName = cacheName;
@@ -123,7 +123,7 @@ public class CacheRegionInfo
     /**
         * @return the hitCountRam
         */
-       public int getHitCountRam()
+       public long getHitCountRam()
        {
                return hitCountRam;
        }
@@ -131,7 +131,7 @@ public class CacheRegionInfo
        /**
         * @return the hitCountAux
         */
-       public int getHitCountAux()
+       public long getHitCountAux()
        {
                return hitCountAux;
        }
@@ -139,7 +139,7 @@ public class CacheRegionInfo
        /**
         * @return the missCountNotFound
         */
-       public int getMissCountNotFound()
+       public long getMissCountNotFound()
        {
                return missCountNotFound;
        }
@@ -147,7 +147,7 @@ public class CacheRegionInfo
        /**
         * @return the missCountExpired
         */
-       public int getMissCountExpired()
+       public long getMissCountExpired()
        {
                return missCountExpired;
        }

Modified: 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSAdminBean.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSAdminBean.java?rev=1859285&r1=1859284&r2=1859285&view=diff
==============================================================================
--- 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSAdminBean.java
 (original)
+++ 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSAdminBean.java
 Wed May 15 09:44:56 2019
@@ -182,7 +182,7 @@ public class JCSAdminBean implements JCS
      * @return int The size of the region in bytes.
      */
        @Override
-    public int getByteCount(String cacheName)
+    public long getByteCount(String cacheName)
        {
                return getByteCount(cacheHub.getCache(cacheName));
        }
@@ -194,7 +194,7 @@ public class JCSAdminBean implements JCS
      *
      * @return int The size of the region in bytes.
      */
-    public <K, V> int getByteCount(CompositeCache<K, V> cache)
+    public <K, V> long getByteCount(CompositeCache<K, V> cache)
     {
         if (cache == null)
         {
@@ -223,7 +223,7 @@ public class JCSAdminBean implements JCS
 
                        if (ice instanceof CacheElementSerialized)
             {
-                size = size + ((CacheElementSerialized<K, V>) 
ice).getSerializedValue().length;
+                size += ((CacheElementSerialized<K, V>) 
ice).getSerializedValue().length;
             }
             else
             {
@@ -256,12 +256,12 @@ public class JCSAdminBean implements JCS
             }
         }
 
-        if (size > Integer.MAX_VALUE)
+        if (size > Long.MAX_VALUE)
         {
-            throw new IllegalStateException("The size of cache " + 
cache.getCacheName() + " (" + size + " bytes) is too large to be represented as 
an integer.");
+            throw new IllegalStateException("The size of cache " + 
cache.getCacheName() + " (" + size + " bytes) is too large to be represented as 
an long integer.");
         }
 
-        return (int) size;
+        return size;
     }
 
     /**

Modified: 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSJMXBean.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSJMXBean.java?rev=1859285&r1=1859284&r2=1859285&view=diff
==============================================================================
--- 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSJMXBean.java
 (original)
+++ 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/admin/JCSJMXBean.java
 Wed May 15 09:44:56 2019
@@ -52,9 +52,9 @@ public interface JCSJMXBean
      * the region or an error occurs, suppresses exceptions and returns 0.
      * <p>
      *
-     * @return int The size of the region in bytes.
+     * @return long The size of the region in bytes.
      */
-    int getByteCount(String cacheName);
+    long getByteCount(String cacheName);
 
     /**
      * Clears all regions in the cache.


Reply via email to