JBoss hornetq SVN: r10276 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-01 16:44:15 -0500 (Tue, 01 Mar 2011)
New Revision: 10276
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
Log:
improving data
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-03-01 16:54:34 UTC (rev 10275)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-03-01 21:44:15 UTC (rev 10276)
@@ -2785,7 +2785,7 @@
private static String describeRecord(RecordInfo info)
{
- return "userRecordType=" + info.userRecordType + ";isUpdate=" + info.isUpdate + ";" + newObjectEncoding(info);
+ return "recordID=" + info.id + ";userRecordType=" + info.userRecordType + ";isUpdate=" + info.isUpdate + ";" + newObjectEncoding(info);
}
// Encoding functions for binding Journal
@@ -2964,7 +2964,16 @@
for (SimpleString prop : properties)
{
- buffer.append(prop + "=" + msg.getObjectProperty(prop) + ",");
+ Object value = msg.getObjectProperty(prop);
+ if (value instanceof byte[])
+ {
+ buffer.append(prop + "=" + Arrays.toString((byte[])value) + ",");
+
+ }
+ else
+ {
+ buffer.append(prop + "=" + value + ",");
+ }
}
buffer.append("#properties = " + properties.size());
13 years, 9 months
JBoss hornetq SVN: r10275 - in branches/Branch_2_2_EAP: hornetq-rest and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-01 11:54:34 -0500 (Tue, 01 Mar 2011)
New Revision: 10275
Modified:
branches/Branch_2_2_EAP/build-maven.xml
branches/Branch_2_2_EAP/hornetq-rest/pom.xml
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
Log:
tweak on report used on investigation
Modified: branches/Branch_2_2_EAP/build-maven.xml
===================================================================
--- branches/Branch_2_2_EAP/build-maven.xml 2011-03-01 14:08:34 UTC (rev 10274)
+++ branches/Branch_2_2_EAP/build-maven.xml 2011-03-01 16:54:34 UTC (rev 10275)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.2.0.GA"/>
+ <property name="hornetq.version" value="2.2.1.GA"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
Modified: branches/Branch_2_2_EAP/hornetq-rest/pom.xml
===================================================================
--- branches/Branch_2_2_EAP/hornetq-rest/pom.xml 2011-03-01 14:08:34 UTC (rev 10274)
+++ branches/Branch_2_2_EAP/hornetq-rest/pom.xml 2011-03-01 16:54:34 UTC (rev 10275)
@@ -10,7 +10,7 @@
<properties>
<resteasy.version>2.0.1.GA</resteasy.version>
- <hornetq.version>2.2.0.GA</hornetq.version>
+ <hornetq.version>2.2.1.GA</hornetq.version>
</properties>
<licenses>
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-03-01 14:08:34 UTC (rev 10274)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-03-01 16:54:34 UTC (rev 10275)
@@ -3118,21 +3118,23 @@
List<PreparedTransactionInfo> preparedTransactions = new LinkedList<PreparedTransactionInfo>();
journal.start();
+
+ final StringBuffer bufferFailingTransactions = new StringBuffer();
journal.load(records, preparedTransactions, new TransactionFailureCallback()
{
public void failedTransaction(long transactionID, List<RecordInfo> records, List<RecordInfo> recordsToDelete)
{
- out.println("Transaction " + transactionID + " failed with these records:");
+ bufferFailingTransactions.append("Transaction " + transactionID + " failed with these records:\n");
for (RecordInfo info : records)
{
- out.println("- " + describeRecord(info));
+ bufferFailingTransactions.append("- " + describeRecord(info) + "\n");
}
for (RecordInfo info : recordsToDelete)
{
- out.println("- " + describeRecord(info) + " <marked to delete>");
+ bufferFailingTransactions.append("- " + describeRecord(info) + " <marked to delete>\n");
}
}
@@ -3140,9 +3142,10 @@
for (RecordInfo info : records)
{
- System.out.println(describeRecord(info));
+ out.println(describeRecord(info));
}
+ out.println();
out.println("### Prepared TX ###");
for (PreparedTransactionInfo tx : preparedTransactions)
@@ -3158,6 +3161,18 @@
out.println("- " + describeRecord(info) + " <marked to delete>");
}
}
+
+ String missingTX = bufferFailingTransactions.toString();
+
+ if (missingTX.length() > 0)
+ {
+ out.println();
+ out.println("### Failed Transactions (Missing commit/prepare/rollback record) ###");
+ }
+
+
+ out.println(bufferFailingTransactions.toString());
+
journal.stop();
}
13 years, 9 months
JBoss hornetq SVN: r10274 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-01 09:08:34 -0500 (Tue, 01 Mar 2011)
New Revision: 10274
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
Log:
tweak on Discovery
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2011-03-01 08:26:18 UTC (rev 10273)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2011-03-01 14:08:34 UTC (rev 10274)
@@ -177,23 +177,19 @@
waitLock.notify();
}
- globalThreadPool.execute(new Runnable()
+ try
{
- public void run()
+ thread.interrupt();
+ thread.join(10000);
+ if(thread.isAlive())
{
- try
- {
- thread.interrupt();
- thread.join();
- }
- catch (InterruptedException e)
- {
- }
+ log.warn("Timed out waiting to stop discovery thread");
}
- });
+ }
+ catch (InterruptedException e)
+ {
+ }
- waitForRunnablesToComplete();
-
socket.close();
socket = null;
@@ -446,18 +442,4 @@
return changed;
}
- private void waitForRunnablesToComplete()
- {
- // Wait for any create objects runnable to complete
- Future future = new Future();
-
- globalThreadPool.execute(future);
-
- boolean ok = future.await(10000);
-
- if (!ok)
- {
- log.warn("Timed out waiting to stop discovery thread");
- }
- }
}
13 years, 9 months
JBoss hornetq SVN: r10273 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-03-01 03:26:18 -0500 (Tue, 01 Mar 2011)
New Revision: 10273
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
Log:
fixing unit tests
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2011-03-01 08:16:31 UTC (rev 10272)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2011-03-01 08:26:18 UTC (rev 10273)
@@ -1048,12 +1048,38 @@
return o2.getConnector().toString().compareTo(o1.getConnector().toString());
}
});
-
+ if(sortedExpected.size() != sortedActual.size())
+ {
+ dump(sortedExpected, sortedActual);
+ }
assertEquals(sortedExpected.size(), sortedActual.size());
for (int i = 0; i < sortedExpected.size(); i++)
{
+ if(!sortedExpected.get(i).equals(sortedActual.get(i).getConnector()))
+ {
+ dump(sortedExpected, sortedActual);
+ }
assertEquals(sortedExpected.get(i), sortedActual.get(i).getConnector());
}
}
+ private static void dump(List<TransportConfiguration> sortedExpected, List<DiscoveryEntry> sortedActual)
+ {
+ System.out.println("wrong broadcasts received");
+ System.out.println("expected");
+ System.out.println("----------------------------");
+ for (TransportConfiguration transportConfiguration : sortedExpected)
+ {
+ System.out.println("transportConfiguration = " + transportConfiguration);
+ }
+ System.out.println("----------------------------");
+ System.out.println("actual");
+ System.out.println("----------------------------");
+ for (DiscoveryEntry discoveryEntry : sortedActual)
+ {
+ System.out.println("transportConfiguration = " + discoveryEntry.getConnector());
+ }
+ System.out.println("----------------------------");
+ }
+
}
13 years, 10 months
JBoss hornetq SVN: r10272 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/cluster/impl and 1 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-03-01 03:16:31 -0500 (Tue, 01 Mar 2011)
New Revision: 10272
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
Log:
fixing unit tests
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-03-01 03:38:33 UTC (rev 10271)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-03-01 08:16:31 UTC (rev 10272)
@@ -332,7 +332,8 @@
lbAddress,
groupAddress,
discoveryGroupConfiguration.getGroupPort(),
- discoveryGroupConfiguration.getRefreshTimeout());
+ discoveryGroupConfiguration.getRefreshTimeout(),
+ globalThreadPool);
discoveryGroup.registerListener(this);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2011-03-01 03:38:33 UTC (rev 10271)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2011-03-01 08:16:31 UTC (rev 10272)
@@ -23,6 +23,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ExecutorService;
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.HornetQBuffers;
@@ -35,6 +36,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
+import org.hornetq.utils.Future;
import org.hornetq.utils.TypedProperties;
/**
@@ -81,12 +83,15 @@
private NotificationService notificationService;
+ private final ExecutorService globalThreadPool;
+
public DiscoveryGroupImpl(final String nodeID,
final String name,
final InetAddress localBindAddress,
final InetAddress groupAddress,
final int groupPort,
- final long timeout) throws Exception
+ final long timeout,
+ ExecutorService globalThreadPool) throws Exception
{
this.nodeID = nodeID;
@@ -99,6 +104,8 @@
this.groupAddress = groupAddress;
this.groupPort = groupPort;
+
+ this.globalThreadPool = globalThreadPool;
}
public void setNotificationService(final NotificationService notificationService)
@@ -170,15 +177,22 @@
waitLock.notify();
}
- try
+ globalThreadPool.execute(new Runnable()
{
- thread.interrupt();
- thread.join();
- }
- catch (InterruptedException e)
- {
- }
+ public void run()
+ {
+ try
+ {
+ thread.interrupt();
+ thread.join();
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ });
+ waitForRunnablesToComplete();
socket.close();
@@ -431,4 +445,19 @@
return changed;
}
+
+ private void waitForRunnablesToComplete()
+ {
+ // Wait for any create objects runnable to complete
+ Future future = new Future();
+
+ globalThreadPool.execute(future);
+
+ boolean ok = future.await(10000);
+
+ if (!ok)
+ {
+ log.warn("Timed out waiting to stop discovery thread");
+ }
+ }
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2011-03-01 03:38:33 UTC (rev 10271)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2011-03-01 08:16:31 UTC (rev 10272)
@@ -23,6 +23,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.Executors;
import junit.framework.Assert;
@@ -90,7 +91,8 @@
null,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg.start();
@@ -176,7 +178,8 @@
localAddress,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg.start();
@@ -223,7 +226,8 @@
null,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg.start();
@@ -281,7 +285,8 @@
bg.addConnector(live1);
- DiscoveryGroup dg = new DiscoveryGroupImpl(nodeID, RandomUtil.randomString(), null, groupAddress, groupPort, timeout);
+ DiscoveryGroup dg = new DiscoveryGroupImpl(nodeID, RandomUtil.randomString(), null, groupAddress, groupPort, timeout,
+ Executors.newFixedThreadPool(1));
dg.start();
@@ -372,7 +377,8 @@
null,
groupAddress,
port2,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg.start();
@@ -415,7 +421,8 @@
null,
groupAddress2,
port2,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg.start();
@@ -491,7 +498,8 @@
null,
groupAddress1,
groupPort1,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg1.start();
DiscoveryGroup dg2 = new DiscoveryGroupImpl(RandomUtil.randomString(),
@@ -499,7 +507,8 @@
null,
groupAddress2,
groupPort2,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg2.start();
DiscoveryGroup dg3 = new DiscoveryGroupImpl(RandomUtil.randomString(),
@@ -507,7 +516,8 @@
null,
groupAddress3,
groupPort3,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg3.start();
bg1.broadcastConnectors();
@@ -571,7 +581,8 @@
// null,
// groupAddress,
// groupPort,
-// timeout);
+// timeout,
+// Executors.newFixedThreadPool(1));
//
// dg.start();
//
@@ -610,7 +621,8 @@
null,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
MyListener listener1 = new MyListener();
MyListener listener2 = new MyListener();
@@ -699,7 +711,8 @@
null,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
MyListener listener1 = new MyListener();
dg.registerListener(listener1);
@@ -865,21 +878,24 @@
null,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
DiscoveryGroup dg2 = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
null,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
DiscoveryGroup dg3 = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
null,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg1.start();
dg2.start();
@@ -924,7 +940,8 @@
null,
groupAddress,
groupPort,
- timeout);
+ timeout,
+ Executors.newFixedThreadPool(1));
dg.setNotificationService(notifService);
Assert.assertEquals(0, notifListener.getNotifications().size());
13 years, 10 months
JBoss hornetq SVN: r10271 - in branches/Branch_2_2_EAP: tests/src/org/hornetq/tests/integration/discovery and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-02-28 22:38:33 -0500 (Mon, 28 Feb 2011)
New Revision: 10271
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
Log:
tweaks on test
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2011-02-28 22:59:42 UTC (rev 10270)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2011-03-01 03:38:33 UTC (rev 10271)
@@ -172,6 +172,7 @@
try
{
+ thread.interrupt();
thread.join();
}
catch (InterruptedException e)
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2011-02-28 22:59:42 UTC (rev 10270)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2011-03-01 03:38:33 UTC (rev 10271)
@@ -252,6 +252,10 @@
entries = dg.getDiscoveryEntries();
assertEqualsDiscoveryEntries(Arrays.asList(live1), entries);
+
+ dg.stop();
+
+ bg.stop();
}
public void testIgnoreTrafficFromOwnNode() throws Exception
13 years, 10 months