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 4721D9437 for ; Fri, 21 Oct 2011 21:03:18 +0000 (UTC) Received: (qmail 6006 invoked by uid 500); 21 Oct 2011 21:03:18 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 5970 invoked by uid 500); 21 Oct 2011 21:03:18 -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 5963 invoked by uid 99); 21 Oct 2011 21:03:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2011 21:03:18 +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; Fri, 21 Oct 2011 21:03:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 984652388847 for ; Fri, 21 Oct 2011 21:02:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1187538 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java Date: Fri, 21 Oct 2011 21:02:56 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111021210256.984652388847@eris.apache.org> Author: tabish Date: Fri Oct 21 21:02:56 2011 New Revision: 1187538 URL: http://svn.apache.org/viewvc?rev=1187538&view=rev Log: fix for: https://issues.apache.org/jira/browse/AMQ-3559 Modified: 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/MessageDatabase.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java?rev=1187538&r1=1187537&r2=1187538&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 Fri Oct 21 21:02:56 2011 @@ -445,6 +445,7 @@ public abstract class MessageDatabase ex } // public for testing + @SuppressWarnings("rawtypes") public Location getFirstInProgressTxLocation() { Location l = null; synchronized (inflightTransactions) { @@ -854,7 +855,7 @@ public abstract class MessageDatabase ex } } - if (!checkpointThread.isAlive()) { + if (checkpointThread == null || !checkpointThread.isAlive()) { startCheckpoint(); } return location; @@ -967,6 +968,7 @@ public abstract class MessageDatabase ex }); } + @SuppressWarnings("rawtypes") protected void process(final KahaAddMessageCommand command, final Location location) throws IOException { if (command.hasTransactionInfo()) { List inflightTx = getInflightTx(command.getTransactionInfo(), location); @@ -985,6 +987,7 @@ public abstract class MessageDatabase ex } } + @SuppressWarnings("rawtypes") protected void process(final KahaRemoveMessageCommand command, final Location location) throws IOException { if (command.hasTransactionInfo()) { List inflightTx = getInflightTx(command.getTransactionInfo(), location); @@ -1047,6 +1050,7 @@ public abstract class MessageDatabase ex } } + @SuppressWarnings("rawtypes") protected void process(KahaCommitCommand command, Location location, final Runnable after) throws IOException { TransactionId key = TransactionIdConversion.convert(command.getTransactionInfo()); List inflightTx; @@ -1077,6 +1081,7 @@ public abstract class MessageDatabase ex } } + @SuppressWarnings("rawtypes") protected void process(KahaPrepareCommand command, Location location) { TransactionId key = TransactionIdConversion.convert(command.getTransactionInfo()); synchronized (inflightTransactions) { @@ -1087,6 +1092,7 @@ public abstract class MessageDatabase ex } } + @SuppressWarnings("rawtypes") protected void process(KahaRollbackCommand command, Location location) throws IOException { TransactionId key = TransactionIdConversion.convert(command.getTransactionInfo()); List updates = null; @@ -1101,6 +1107,7 @@ public abstract class MessageDatabase ex } } + @SuppressWarnings("rawtypes") private void persistRedeliveryCount(List updates) throws IOException { if (updates != null) { for (Operation operation : updates) { @@ -1557,7 +1564,7 @@ public abstract class MessageDatabase ex if (dataIn.readBoolean()) { value.subscriptions = new BTreeIndex(pageFile, dataIn.readLong()); value.subscriptionAcks = new BTreeIndex(pageFile, dataIn.readLong()); - if (metadata.version >= 3) { + if (metadata.version >= VERSION) { value.ackPositions = new ListIndex(pageFile, dataIn.readLong()); } else { // upgrade @@ -1963,7 +1970,9 @@ public abstract class MessageDatabase ex // ///////////////////////////////////////////////////////////////// // Transaction related implementation methods. // ///////////////////////////////////////////////////////////////// + @SuppressWarnings("rawtypes") private final LinkedHashMap> inflightTransactions = new LinkedHashMap>(); + @SuppressWarnings("rawtypes") protected final LinkedHashMap> preparedTransactions = new LinkedHashMap>(); protected final Set ackedAndPrepared = new HashSet(); @@ -1994,6 +2003,7 @@ public abstract class MessageDatabase ex } } + @SuppressWarnings("rawtypes") private List getInflightTx(KahaTransactionInfo info, Location location) { TransactionId key = TransactionIdConversion.convert(info); List tx;