activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r605940 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/region/AbstractSubscription.java kaha/impl/index/hash/HashBin.java kaha/impl/index/hash/HashIndex.java kaha/impl/index/hash/HashPageInfo.java
Date Thu, 20 Dec 2007 14:29:30 GMT
Author: rajdavies
Date: Thu Dec 20 06:29:30 2007
New Revision: 605940

URL: http://svn.apache.org/viewvc?rev=605940&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1528

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
    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

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java?rev=605940&r1=605939&r2=605940&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
Thu Dec 20 06:29:30 2007
@@ -115,7 +115,7 @@
     }
 
     public boolean isSlave() {
-        return getContext().isSlave();
+        return broker.getBrokerService().isSlave();
     }
 
     public ConnectionContext getContext() {

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=605940&r1=605939&r2=605940&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
Thu Dec 20 06:29:30 2007
@@ -143,9 +143,6 @@
                 }
             }
             if (!replace) {
-                if (low > size()) {
-                    LOG.info("SIZE() " + size() + " low = " + low);
-                }
                 addHashEntry(low, newEntry);
                 size++;
             }
@@ -189,7 +186,6 @@
             pageToUse.setPage(hp);
             offset = 0;
         } else {
-            
             int count = 0;
             int countSoFar=0;
             int pageNo = 0;
@@ -206,10 +202,14 @@
                 countSoFar += page.size();
                 pageNo++;
             }
+            while(pageNo >= hashPages.size()) {
+                HashPage hp = hashIndex.createPage(id);
+                addHashPageInfo(hp.getId(), 0);               
+            }
             pageToUse = hashPages.get(pageNo);
+           
         }
-        pageToUse.begin();
-        
+        pageToUse.begin();  
         pageToUse.addHashEntry(offset, entry);
         doOverFlow(index);
     }

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=605940&r1=605939&r2=605940&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
Thu Dec 20 06:29:30 2007
@@ -62,7 +62,7 @@
     private AtomicBoolean loaded = new AtomicBoolean();
     private LRUCache<Long, HashPage> pageCache;
     private boolean enablePageCaching=true;
-    private int pageCacheSize = 1;
+    private int pageCacheSize = 10;
 
     
     /**

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=605940&r1=605939&r2=605940&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
Thu Dec 20 06:29:30 2007
@@ -88,7 +88,7 @@
 
     void begin() throws IOException {
         if (page == null) {
-            page = hashIndex.getFullPage(id);
+            page = hashIndex.lookupPage(id);
         }
     }
 



Mime
View raw message