activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r631537 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: kaha/impl/index/hash/HashBin.java kaha/impl/index/hash/HashIndex.java kaha/impl/index/hash/HashPageInfo.java store/kahadaptor/KahaReferenceStoreAdapter.java
Date Wed, 27 Feb 2008 10:21:28 GMT
Author: rajdavies
Date: Wed Feb 27 02:21:27 2008
New Revision: 631537

URL: http://svn.apache.org/viewvc?rev=631537&view=rev
Log:
recycle hash pages

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java?rev=631537&r1=631536&r2=631537&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
Wed Feb 27 02:21:27 2008
@@ -23,6 +23,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import sun.security.action.GetBooleanAction;
+
 /**
  * Bin in a HashIndex
  * 
@@ -219,6 +221,11 @@
         HashPageInfo page = getRetrievePage(index);
         int offset = getRetrieveOffset(index);
         HashEntry result = page.removeHashEntry(offset);
+       
+        if (page.isEmpty()) {
+            hashPages.remove(page);
+            hashIndex.releasePage(page.getPage());
+        }
         doUnderFlow(index);
         return result;
     }
@@ -295,9 +302,7 @@
         }
     }
 
-    private void doUnderFlow(@SuppressWarnings("unused")
-    int index) {
-        // does little
+    private void doUnderFlow(int index) {
     }
 
     private void end() throws IOException {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java?rev=631537&r1=631536&r2=631537&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
Wed Feb 27 02:21:27 2008
@@ -462,8 +462,8 @@
     }
 
     static {
-        DEFAULT_PAGE_SIZE = Integer.parseInt(System.getProperty("defaultPageSize", "16384"));
-        DEFAULT_KEY_SIZE = Integer.parseInt(System.getProperty("defaultKeySize", "96"));
-        DEFAULT_BIN_SIZE= Integer.parseInt(System.getProperty("defaultBinSize", "1024"));
+        DEFAULT_PAGE_SIZE = Integer.parseInt(System.getProperty("defaultPageSize", "8000"));
+        DEFAULT_KEY_SIZE = Integer.parseInt(System.getProperty("defaultKeySize", "80"));
+        DEFAULT_BIN_SIZE= Integer.parseInt(System.getProperty("defaultBinSize", "128"));
     }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java?rev=631537&r1=631536&r2=631537&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java
Wed Feb 27 02:21:27 2008
@@ -55,6 +55,10 @@
     int size() {
         return this.size;
     }
+    
+    boolean isEmpty() {
+        return size <= 0;
+    }
 
     /**
      * @param size the size to set

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java?rev=631537&r1=631536&r2=631537&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaReferenceStoreAdapter.java
Wed Feb 27 02:21:27 2008
@@ -59,7 +59,7 @@
     private static final Log LOG = LogFactory.getLog(KahaReferenceStoreAdapter.class);
     private static final String STORE_STATE = "store-state";
     private static final String INDEX_VERSION_NAME = "INDEX_VERSION";
-    private static final Integer INDEX_VERSION = new Integer(4);
+    private static final Integer INDEX_VERSION = new Integer(5);
     private static final String RECORD_REFERENCES = "record-references";
     private static final String TRANSACTIONS = "transactions-state";
     private MapContainer stateMap;



Mime
View raw message