activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1172528 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/store/kahadb/plist/PListStore.java test/java/org/apache/activemq/store/kahadb/plist/PListTest.java
Date Mon, 19 Sep 2011 09:03:13 GMT
Author: gtully
Date: Mon Sep 19 09:03:13 2011
New Revision: 1172528

URL: http://svn.apache.org/viewvc?rev=1172528&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3490 - allow optional lazyInit of temp (plist) store

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/plist/PListStore.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/plist/PListTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/plist/PListStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/plist/PListStore.java?rev=1172528&r1=1172527&r2=1172528&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/plist/PListStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/plist/PListStore.java
Mon Sep 19 09:03:13 2011
@@ -65,6 +65,7 @@ public class PListStore extends ServiceS
     private int journalMaxWriteBatchSize = Journal.DEFAULT_MAX_WRITE_BATCH_SIZE;
     private boolean enableIndexWriteAsync = false;
     private boolean initialized = false;
+    private boolean lazyInit = true;
     // private int indexWriteBatchSize = PageFile.DEFAULT_WRITE_BATCH_SIZE;
     MetaData metaData = new MetaData(this);
     final MetaDataMarshaller metaDataMarshaller = new MetaDataMarshaller(this);
@@ -319,6 +320,9 @@ public class PListStore extends ServiceS
 
     @Override
     protected synchronized void doStart() throws Exception {
+        if (!lazyInit) {
+            intialize();
+        }
         LOG.info(this + " started");
     }
 
@@ -464,6 +468,14 @@ public class PListStore extends ServiceS
         this.cleanupInterval = cleanupInterval;
     }
 
+    public boolean isLazyInit() {
+        return lazyInit;
+    }
+
+    public void setLazyInit(boolean lazyInit) {
+        this.lazyInit = lazyInit;
+    }
+
     @Override
     public String toString() {
         String path = getDirectory() != null ? getDirectory().getAbsolutePath() : "DIRECTORY_NOT_SET";

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/plist/PListTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/plist/PListTest.java?rev=1172528&r1=1172527&r2=1172528&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/plist/PListTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/plist/PListTest.java
Mon Sep 19 09:03:13 2011
@@ -180,6 +180,7 @@ public class PListTest {
         store.setCleanupInterval(400);
         store.setDirectory(directory);
         store.setJournalMaxFileLength(1024*5);
+        store.setLazyInit(false);
         store.start();
 
         final ByteSequence payload = new ByteSequence(new byte[1024*2]);



Mime
View raw message