From commits-return-12774-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Wed Jan 13 09:58:56 2010 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 93582 invoked from network); 13 Jan 2010 09:58:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2010 09:58:56 -0000 Received: (qmail 48866 invoked by uid 500); 13 Jan 2010 09:58:56 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 48813 invoked by uid 500); 13 Jan 2010 09:58:56 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 48804 invoked by uid 99); 13 Jan 2010 09:58:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 09:58:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 09:58:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 98B882388978; Wed, 13 Jan 2010 09:58:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: rajdavies@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100113095832.98B882388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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; + } }