activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r898693 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb: KahaDBPersistenceAdapter.java MessageDatabase.java
Date Wed, 13 Jan 2010 09:58:32 GMT
Author: rajdavies
Date: Wed Jan 13 09:58:32 2010
New Revision: 898693

URL: http://svn.apache.org/viewvc?rev=898693&view=rev
Log:
expose the Journal property directoryArchive through KahaDB

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=898693&r1=898692&r2=898693&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
Wed Jan 13 09:58:32 2010
@@ -370,19 +370,20 @@
 	public void setBrokerService(BrokerService brokerService) {
 		letter.setBrokerService(brokerService);
 	}
-	
 
-    /**
-     * @return the archiveDataLogs
-     */
     public boolean isArchiveDataLogs() {
         return letter.isArchiveDataLogs();
     }
 
-    /**
-     * @param archiveDataLogs the archiveDataLogs to set
-     */
     public void setArchiveDataLogs(boolean archiveDataLogs) {
         letter.setArchiveDataLogs(archiveDataLogs);
     }
+    
+    public File getDirectoryArchive() {
+        return letter.getDirectoryArchive();
+    }
+
+    public void setDirectoryArchive(File directoryArchive) {
+        letter.setDirectoryArchive(directoryArchive);
+    }
 }

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=898693&r1=898692&r2=898693&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
Wed Jan 13 09:58:32 2010
@@ -56,6 +56,7 @@
 import org.apache.activemq.store.kahadb.data.KahaTransactionInfo;
 import org.apache.activemq.store.kahadb.data.KahaXATransactionId;
 import org.apache.activemq.util.Callback;
+import org.apache.activemq.util.IOHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.kahadb.index.BTreeIndex;
@@ -158,6 +159,7 @@
     protected Thread checkpointThread;
     protected boolean enableJournalDiskSyncs=true;
     protected boolean archiveDataLogs;
+    protected File directoryArchive;
     long checkpointInterval = 5*1000;
     long cleanupInterval = 30*1000;
     int journalMaxFileLength = Journal.DEFAULT_MAX_FILE_LENGTH;
@@ -1417,7 +1419,7 @@
         return index;
     }
 
-    private Journal createJournal() {
+    private Journal createJournal() throws IOException {
         Journal manager = new Journal();
         manager.setDirectory(directory);
         manager.setMaxFileLength(getJournalMaxFileLength());
@@ -1425,6 +1427,10 @@
         manager.setChecksum(checksumJournalFiles || checkForCorruptJournalFiles);
         manager.setWriteBatchSize(getJournalMaxWriteBatchSize());
         manager.setArchiveDataLogs(isArchiveDataLogs());
+        if (getDirectoryArchive() != null) {
+            IOHelper.mkdirs(getDirectoryArchive());
+            manager.setDirectoryArchive(getDirectoryArchive());
+        }
         return manager;
     }
 
@@ -1507,7 +1513,7 @@
 		return pageFile;
 	}
 
-	public Journal getJournal() {
+	public Journal getJournal() throws IOException {
         if (journal == null) {
             journal = createJournal();
         }
@@ -1571,4 +1577,18 @@
     public void setArchiveDataLogs(boolean archiveDataLogs) {
         this.archiveDataLogs = archiveDataLogs;
     }
+
+    /**
+     * @return the directoryArchive
+     */
+    public File getDirectoryArchive() {
+        return this.directoryArchive;
+    }
+
+    /**
+     * @param directoryArchive the directoryArchive to set
+     */
+    public void setDirectoryArchive(File directoryArchive) {
+        this.directoryArchive = directoryArchive;
+    }
 }



Mime
View raw message