Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8F2039957 for ; Mon, 19 Sep 2011 09:03:35 +0000 (UTC) Received: (qmail 59734 invoked by uid 500); 19 Sep 2011 09:03:35 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 59671 invoked by uid 500); 19 Sep 2011 09:03:34 -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 59658 invoked by uid 99); 19 Sep 2011 09:03:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Sep 2011 09:03:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Mon, 19 Sep 2011 09:03:33 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8CCB3238888F for ; Mon, 19 Sep 2011 09:03:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20110919090313.8CCB3238888F@eris.apache.org> 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]);