You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/07/29 19:35:37 UTC

[1/5] activemq-artemis git commit: This closes #687

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 5fe10d044 -> 0ec8e5790


This closes #687


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/0ec8e579
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/0ec8e579
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/0ec8e579

Branch: refs/heads/master
Commit: 0ec8e579000bd45312532f362726f2bf3b346270
Parents: 5fe10d0 9022a31
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Jul 29 15:35:25 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Jul 29 15:35:25 2016 -0400

----------------------------------------------------------------------
 .../journal/JDBCJournalLoaderCallback.java      |  2 +-
 .../journal/JDBCJournalLoaderCallbackTest.java  | 49 ++++++++++++++++++++
 .../protocol/openwire/OpenWireConnection.java   |  2 +-
 .../core/protocol/openwire/amq/AMQSession.java  |  2 +-
 .../DurableSubsOfflineSelectorIndexUseTest.java |  2 +-
 5 files changed, 53 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[4/5] activemq-artemis git commit: Fix removing ended transaction id in OpenWireConnection.CommandProcessor

Posted by cl...@apache.org.
Fix removing ended transaction id in OpenWireConnection.CommandProcessor


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9022a311
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9022a311
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9022a311

Branch: refs/heads/master
Commit: 9022a311f31d0b0ef5de9faa357667965146164a
Parents: 7ce2d7c
Author: Ville Skytt� <vi...@iki.fi>
Authored: Fri Jul 29 19:20:44 2016 +0300
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Jul 29 15:35:25 2016 -0400

----------------------------------------------------------------------
 .../artemis/core/protocol/openwire/OpenWireConnection.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9022a311/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index fe05c9e..a6f00df 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -1195,7 +1195,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
             }
          }
          else {
-            txMap.remove(info);
+            txMap.remove(txID);
             clearOpeartionContext();
          }
 


[2/5] activemq-artemis git commit: Fix adding duplicate detection id in Openwire AMQSession.send

Posted by cl...@apache.org.
Fix adding duplicate detection id in Openwire AMQSession.send


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/7ce2d7c1
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/7ce2d7c1
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/7ce2d7c1

Branch: refs/heads/master
Commit: 7ce2d7c199876941b6bc36b02831d77f4fe600db
Parents: af553cc
Author: Ville Skytt� <vi...@iki.fi>
Authored: Fri Jul 29 19:17:59 2016 +0300
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Jul 29 15:35:25 2016 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/protocol/openwire/amq/AMQSession.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7ce2d7c1/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
index 472917d..4e1e8c4 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
@@ -271,7 +271,7 @@ public class AMQSession implements SessionCallback {
       * not receive acks will be resent.  (ActiveMQ broker handles this by returning a last sequence id received to
       * the client).  To handle this in Artemis we use a duplicate ID cache.  To do this we check to see if the
       * message comes from failover connection.  If so we add a DUPLICATE_ID to handle duplicates after a resend. */
-      if (connection.getContext().isFaultTolerant() && !messageSend.getProperties().containsKey(org.apache.activemq.artemis.api.core.Message.HDR_DUPLICATE_DETECTION_ID)) {
+      if (connection.getContext().isFaultTolerant() && !messageSend.getProperties().containsKey(org.apache.activemq.artemis.api.core.Message.HDR_DUPLICATE_DETECTION_ID.toString())) {
          originalCoreMsg.putStringProperty(org.apache.activemq.artemis.api.core.Message.HDR_DUPLICATE_DETECTION_ID.toString(), messageSend.getMessageId().toString());
       }
 


[5/5] activemq-artemis git commit: Fix JDBCJournalLoaderCallback.deleteRecord

Posted by cl...@apache.org.
Fix JDBCJournalLoaderCallback.deleteRecord


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/af553cce
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/af553cce
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/af553cce

Branch: refs/heads/master
Commit: af553ccec8dd78948badf307d8d575d527d3ab9a
Parents: eb5eca9
Author: Ville Skytt� <vi...@iki.fi>
Authored: Fri Jul 29 19:13:48 2016 +0300
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Jul 29 15:35:25 2016 -0400

----------------------------------------------------------------------
 .../journal/JDBCJournalLoaderCallback.java      |  2 +-
 .../journal/JDBCJournalLoaderCallbackTest.java  | 49 ++++++++++++++++++++
 2 files changed, 50 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/af553cce/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java
index 13c11af..eaa5387 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java
@@ -81,7 +81,7 @@ public class JDBCJournalLoaderCallback implements LoaderCallback {
 
    @Override
    public synchronized void deleteRecord(final long id) {
-      for (Integer i : deleteReferences.get(id)) {
+      for (int i : deleteReferences.get(id)) {
          committedRecords.remove(i);
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/af553cce/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java
new file mode 100644
index 0000000..9369866
--- /dev/null
+++ b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.jdbc.store.journal;
+
+import java.util.ArrayList;
+
+import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
+import org.apache.activemq.artemis.core.journal.RecordInfo;
+import org.apache.activemq.artemis.core.journal.TransactionFailureCallback;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class JDBCJournalLoaderCallbackTest {
+
+   @Test
+   public void testAddDeleteRecord() throws Exception {
+
+      ArrayList<RecordInfo> committedRecords = new ArrayList<>();
+      ArrayList<PreparedTransactionInfo> preparedTransactions = new ArrayList<>();
+      TransactionFailureCallback failureCallback = null;
+      boolean fixBadTX = false;
+
+      JDBCJournalLoaderCallback cb = new JDBCJournalLoaderCallback(committedRecords, preparedTransactions, failureCallback, fixBadTX);
+
+      RecordInfo record = new RecordInfo(42, (byte) 0, null, false, (short) 0);
+      cb.addRecord(record);
+      assertEquals(1, committedRecords.size());
+      assertTrue(committedRecords.contains(record));
+
+      cb.deleteRecord(record.id);
+      assertTrue(committedRecords.isEmpty());
+   }
+}


[3/5] activemq-artemis git commit: Fix check for KahaDB adapter in DurableSubsOfflineSelectorIndexUseTest

Posted by cl...@apache.org.
Fix check for KahaDB adapter in DurableSubsOfflineSelectorIndexUseTest


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/eb5eca93
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/eb5eca93
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/eb5eca93

Branch: refs/heads/master
Commit: eb5eca93b0ce262f3f27dc6cb80d258be31afbfe
Parents: 5fe10d0
Author: Ville Skytt� <vi...@iki.fi>
Authored: Fri Jul 29 18:41:09 2016 +0300
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Jul 29 15:35:25 2016 -0400

----------------------------------------------------------------------
 .../activemq/usecases/DurableSubsOfflineSelectorIndexUseTest.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/eb5eca93/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubsOfflineSelectorIndexUseTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubsOfflineSelectorIndexUseTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubsOfflineSelectorIndexUseTest.java
index 540cdde..31dc6cd 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubsOfflineSelectorIndexUseTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubsOfflineSelectorIndexUseTest.java
@@ -185,7 +185,7 @@ public class DurableSubsOfflineSelectorIndexUseTest extends org.apache.activemq.
       con.close();
 
       PersistenceAdapter persistenceAdapter = broker.getPersistenceAdapter();
-      if (persistenceAdapter instanceof KahaDBStore) {
+      if (persistenceAdapter instanceof KahaDBPersistenceAdapter) {
          final KahaDBStore store = ((KahaDBPersistenceAdapter) persistenceAdapter).getStore();
          LOG.info("Store page count: " + store.getPageFile().getPageCount());
          LOG.info("Store free page count: " + store.getPageFile().getFreePageCount());