activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r582801 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: kaha/ kaha/impl/ store/amq/ store/kahadaptor/
Date Mon, 08 Oct 2007 12:39:49 GMT
Author: rajdavies
Date: Mon Oct  8 05:39:48 2007
New Revision: 582801

URL: http://svn.apache.org/viewvc?rev=582801&view=rev
Log:
Add properties to the AMQPersistenceAdaptorFactory
to set syncOnWrite(default=false) and persistentIndex(default=true) properties

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/Store.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.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/Store.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/Store.java?rev=582801&r1=582800&r2=582801&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/Store.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/Store.java Mon Oct
 8 05:39:48 2007
@@ -266,4 +266,8 @@
      * @return the amount of disk space the store is occupying
      */
     long size();
+    
+    public boolean isPersistentIndex();
+    
+	public void setPersistentIndex(boolean persistentIndex);
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java?rev=582801&r1=582800&r2=582801&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
Mon Oct  8 05:39:48 2007
@@ -438,6 +438,14 @@
             persistentIndex = true;
         }
     }
+    
+    public boolean isPersistentIndex() {
+		return persistentIndex;
+	}
+
+	public void setPersistentIndex(boolean persistentIndex) {
+		this.persistentIndex = persistentIndex;
+	}
 
     public synchronized void initialize() throws IOException {
         if (closed) {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java?rev=582801&r1=582800&r2=582801&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
Mon Oct  8 05:39:48 2007
@@ -99,6 +99,7 @@
     private File directory;
     private BrokerService brokerService;
     private AtomicLong storeSize = new AtomicLong();
+    private boolean persistentIndex=true;
 
     public String getBrokerName() {
         return this.brokerName;
@@ -418,6 +419,14 @@
     public void rollbackTransaction(ConnectionContext context) throws IOException {
         referenceStoreAdapter.rollbackTransaction(context);
     }
+    
+    public boolean isPersistentIndex() {
+		return persistentIndex;
+	}
+
+	public void setPersistentIndex(boolean persistentIndex) {
+		this.persistentIndex = persistentIndex;
+	}
 
     /**
      * @param location
@@ -605,6 +614,7 @@
 
     protected KahaReferenceStoreAdapter createReferenceStoreAdapter() throws IOException
{
         KahaReferenceStoreAdapter adaptor = new KahaReferenceStoreAdapter(storeSize);
+        adaptor.setPersistentIndex(isPersistentIndex());
         return adaptor;
     }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java?rev=582801&r1=582800&r2=582801&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java
Mon Oct  8 05:39:48 2007
@@ -37,6 +37,8 @@
     private int journalThreadPriority = Thread.MAX_PRIORITY;
     private String brokerName = "localhost";
     private ReferenceStoreAdapter referenceStoreAdapter;
+    private boolean syncOnWrite;
+    private boolean persistentIndex;
 
     /**
      * @return a AMQPersistenceAdapter
@@ -47,6 +49,8 @@
         result.setDirectory(getDataDirectory());
         result.setTaskRunnerFactory(getTaskRunnerFactory());
         result.setBrokerName(getBrokerName());
+        result.setSyncOnWrite(isSyncOnWrite());
+        result.setPersistentIndex(isPersistentIndex());
         result.setReferenceStoreAdapter(getReferenceStoreAdapter());
         return result;
     }
@@ -127,4 +131,20 @@
     public void setReferenceStoreAdapter(ReferenceStoreAdapter referenceStoreAdapter) {
         this.referenceStoreAdapter = referenceStoreAdapter;
     }
+    
+    public boolean isPersistentIndex() {
+		return persistentIndex;
+	}
+
+	public void setPersistentIndex(boolean persistentIndex) {
+		this.persistentIndex = persistentIndex;
+	}
+
+	public boolean isSyncOnWrite() {
+		return syncOnWrite;
+	}
+
+	public void setSyncOnWrite(boolean syncOnWrite) {
+		this.syncOnWrite = syncOnWrite;
+	}
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java?rev=582801&r1=582800&r2=582801&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadaptor/KahaPersistenceAdapter.java
Mon Oct  8 05:39:48 2007
@@ -49,6 +49,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import sun.misc.Perf.GetPerfAction;
+
 /**
  * @org.apache.xbean.XBean
  * @version $Revision: 1.4 $
@@ -71,6 +73,7 @@
     private Store theStore;
     private boolean initialized;
     private final AtomicLong storeSize;
+    private boolean persistentIndex = true;
 
     
     public KahaPersistenceAdapter(AtomicLong size) {
@@ -80,6 +83,7 @@
     public KahaPersistenceAdapter() {
         this(new AtomicLong());
     }
+    
     public Set<ActiveMQDestination> getDestinations() {
         Set<ActiveMQDestination> rc = new HashSet<ActiveMQDestination>();
         try {
@@ -244,6 +248,14 @@
     public long getMaxDataFileLength() {
         return maxDataFileLength;
     }
+    
+    public boolean isPersistentIndex() {
+		return persistentIndex;
+	}
+
+	public void setPersistentIndex(boolean persistentIndex) {
+		this.persistentIndex = persistentIndex;
+	}
 
     /**
      * @param maxDataFileLength the maxDataFileLength to set
@@ -257,6 +269,7 @@
         if (theStore == null) {
             theStore = StoreFactory.open(getStoreDirectory(), "rw",storeSize);
             theStore.setMaxDataFileLength(maxDataFileLength);
+            theStore.setPersistentIndex(isPersistentIndex());
         }
         return theStore;
     }

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=582801&r1=582800&r2=582801&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
Mon Oct  8 05:39:48 2007
@@ -61,6 +61,7 @@
     private ListContainer<SubscriptionInfo> durableSubscribers;
     private boolean storeValid;
     private Store stateStore;
+    private boolean persistentIndex = true;
 
     public KahaReferenceStoreAdapter(AtomicLong size){
         super(size);
@@ -273,6 +274,14 @@
             StoreFactory.delete(stateDirectory);
         }
     }
+    
+    public boolean isPersistentIndex() {
+		return persistentIndex;
+	}
+
+	public void setPersistentIndex(boolean persistentIndex) {
+		this.persistentIndex = persistentIndex;
+	}
 
     private Store createStateStore(File directory) {
         File stateDirectory = new File(directory, "state");
@@ -292,4 +301,6 @@
     protected void removeSubscriberState(SubscriptionInfo info) {
         durableSubscribers.remove(info);
     }
+
+	
 }



Mime
View raw message