activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r1215433 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb: KahaDBPersistenceAdapter.java MessageDatabase.java
Date Sat, 17 Dec 2011 07:05:46 GMT
Author: rajdavies
Date: Sat Dec 17 07:05:46 2011
New Revision: 1215433

URL: http://svn.apache.org/viewvc?rev=1215433&view=rev
Log:
commit patch for https://issues.apache.org/jira/browse/AMQ-3618

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java?rev=1215433&r1=1215432&r2=1215433&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
Sat Dec 17 07:05:46 2011
@@ -16,11 +16,21 @@
  */
 package org.apache.activemq.store.kahadb;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.Set;
+
 import org.apache.activeio.journal.Journal;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.BrokerServiceAware;
 import org.apache.activemq.broker.ConnectionContext;
-import org.apache.activemq.command.*;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.command.LocalTransactionId;
+import org.apache.activemq.command.ProducerId;
+import org.apache.activemq.command.TransactionId;
+import org.apache.activemq.command.XATransactionId;
 import org.apache.activemq.protobuf.Buffer;
 import org.apache.activemq.store.MessageStore;
 import org.apache.activemq.store.PersistenceAdapter;
@@ -31,10 +41,6 @@ import org.apache.activemq.store.kahadb.
 import org.apache.activemq.store.kahadb.data.KahaXATransactionId;
 import org.apache.activemq.usage.SystemUsage;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Set;
-
 /**
  * An implementation of {@link PersistenceAdapter} designed for use with a
  * {@link Journal} and then check pointing asynchronously on a timeout with some
@@ -515,6 +521,22 @@ public class KahaDBPersistenceAdapter im
         return letter.isRewriteOnRedelivery();
     }
 
+    public float getIndexLFUEvictionFactor() {
+        return letter.getIndexLFUEvictionFactor();
+    }
+
+    public void setIndexLFUEvictionFactor(float indexLFUEvictionFactor) {
+        letter.setIndexLFUEvictionFactor(indexLFUEvictionFactor);
+    }
+
+    public boolean isUseIndexLFRUEviction() {
+        return letter.isUseIndexLFRUEviction();
+    }
+
+    public void setUseIndexLFRUEviction(boolean useIndexLFRUEviction) {
+        letter.setUseIndexLFRUEviction(useIndexLFRUEviction);
+    }
+
     public KahaDBStore getStore() {
         return letter;
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java?rev=1215433&r1=1215432&r2=1215433&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
Sat Dec 17 07:05:46 2011
@@ -16,6 +16,15 @@
  */
 package org.apache.activemq.store.kahadb;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.*;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
 import org.apache.activemq.ActiveMQMessageAuditNoSync;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.BrokerServiceAware;
@@ -41,15 +50,6 @@ import org.apache.kahadb.util.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.*;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
 public abstract class MessageDatabase extends ServiceSupport implements BrokerServiceAware
{
 
     protected BrokerService brokerService;
@@ -182,6 +182,8 @@ public abstract class MessageDatabase ex
     private final Object checkpointThreadLock = new Object();
     private boolean rewriteOnRedelivery = false;
     private boolean archiveCorruptedIndex = false;
+    private boolean useIndexLFRUEviction = false;
+    private float indexLFUEvictionFactor = 0.2f;
 
     public MessageDatabase() {
     }
@@ -2054,6 +2056,8 @@ public abstract class MessageDatabase ex
         index.setEnableWriteThread(isEnableIndexWriteAsync());
         index.setWriteBatchSize(getIndexWriteBatchSize());
         index.setPageCacheSize(indexCacheSize);
+        index.setUseLFRUEviction(isUseIndexLFRUEviction());
+        index.setLFUEvictionFactor(getIndexLFUEvictionFactor());
         return index;
     }
 
@@ -2277,6 +2281,22 @@ public abstract class MessageDatabase ex
         this.archiveCorruptedIndex = archiveCorruptedIndex;
     }
 
+    public float getIndexLFUEvictionFactor() {
+        return indexLFUEvictionFactor;
+    }
+
+    public void setIndexLFUEvictionFactor(float indexLFUEvictionFactor) {
+        this.indexLFUEvictionFactor = indexLFUEvictionFactor;
+    }
+
+    public boolean isUseIndexLFRUEviction() {
+        return useIndexLFRUEviction;
+    }
+
+    public void setUseIndexLFRUEviction(boolean useIndexLFRUEviction) {
+        this.useIndexLFRUEviction = useIndexLFRUEviction;
+    }
+
     // /////////////////////////////////////////////////////////////////
     // Internal conversion methods.
     // /////////////////////////////////////////////////////////////////



Mime
View raw message