activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r650386 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash: HashIndex.java HashPage.java HashPageInfo.java
Date Tue, 22 Apr 2008 06:03:19 GMT
Author: rajdavies
Date: Mon Apr 21 23:03:17 2008
New Revision: 650386

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

Modified:
    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/HashPage.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/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=650386&r1=650385&r2=650386&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
Mon Apr 21 23:03:17 2008
@@ -52,7 +52,7 @@
     private int pageSize = DEFAULT_PAGE_SIZE;
     private int keySize = DEFAULT_KEY_SIZE;
     private int numberOfBins = DEFAULT_BIN_SIZE;
-    private int keysPerPage = pageSize / keySize;
+    private int keysPerPage = this.pageSize /this.keySize;
     private DataByteArrayInputStream dataIn;
     private DataByteArrayOutputStream dataOut;
     private byte[] readBuffer;
@@ -62,7 +62,7 @@
     private LinkedList<HashPage> freeList = new LinkedList<HashPage>();
     private AtomicBoolean loaded = new AtomicBoolean();
     private LRUCache<Long, HashPage> pageCache;
-    private boolean enablePageCaching=true;
+    private boolean enablePageCaching=false;//this is off by default - see AMQ-1667
     private int pageCacheSize = 10;
     private int size;
     private int activeBins;

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java?rev=650386&r1=650385&r2=650386&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
Mon Apr 21 23:03:17 2008
@@ -46,20 +46,7 @@
     private long nextFreePageId = HashEntry.NOT_SET;
     private boolean active = true;
 
-    /**
-     * Constructor
-     * 
-     * @param hashIndex
-     * @param id
-     * @param parentId
-     * @param maximumEntries
-     */
-    HashPage(long id, int maximumEntries) {
-        this(maximumEntries);
-
-        this.id = id;
-    }
-
+    
     /**
      * Constructor
      * 

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=650386&r1=650385&r2=650386&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
Mon Apr 21 23:03:17 2008
@@ -69,7 +69,7 @@
 
     void addHashEntry(int index, HashEntry entry) throws IOException {
         page.addHashEntry(index, entry);
-        size++;
+        size=page.size();
         dirty = true;
     }
 
@@ -80,7 +80,7 @@
     HashEntry removeHashEntry(int index) throws IOException {
         HashEntry result = page.removeHashEntry(index);
         if (result != null) {
-            size--;
+            size=page.size();
             dirty = true;
         }
         return result;



Mime
View raw message