JBoss hornetq SVN: r8472 - trunk/tests/src/org/hornetq/tests/unit/core/paging/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2009-11-30 14:37:26 -0500 (Mon, 30 Nov 2009)
New Revision: 8472
Modified:
trunk/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
Log:
Fixing test
Modified: trunk/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java 2009-11-30 16:22:34 UTC (rev 8471)
+++ trunk/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java 2009-11-30 19:37:26 UTC (rev 8472)
@@ -50,7 +50,6 @@
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.PostOffice;
-import org.hornetq.core.remoting.impl.wireformat.PacketImpl;
import org.hornetq.core.replication.ReplicationManager;
import org.hornetq.core.server.LargeServerMessage;
import org.hornetq.core.server.MessageReference;
@@ -66,7 +65,6 @@
import org.hornetq.tests.unit.core.server.impl.fakes.FakePostOffice;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.UnitTestCase;
-import org.hornetq.utils.DataConstants;
import org.hornetq.utils.Pair;
import org.hornetq.utils.SimpleString;
import org.hornetq.utils.UUID;
@@ -264,7 +262,7 @@
storeImpl.startPaging();
List<HornetQBuffer> buffers = new ArrayList<HornetQBuffer>();
-
+
int numMessages = 10;
for (int i = 0; i < numMessages; i++)
@@ -304,7 +302,7 @@
HornetQBuffer horn2 = msg.get(i).getMessage(null).getBodyBuffer();
horn1.resetReaderIndex();
horn2.resetReaderIndex();
- for (int j = 0 ; j < horn1.writerIndex(); j++)
+ for (int j = 0; j < horn1.writerIndex(); j++)
{
assertEquals(horn1.readByte(), horn2.readByte());
}
@@ -362,6 +360,8 @@
assertEquals(2, storeImpl.getNumberOfPages());
storeImpl.sync();
+
+ int sequence = 0;
for (int pageNr = 0; pageNr < 2; pageNr++)
{
@@ -377,7 +377,7 @@
for (int i = 0; i < 5; i++)
{
- assertEquals(0, msg.get(i).getMessage(null).getMessageID());
+ assertEquals(sequence++, msg.get(i).getMessage(null).getMessageID());
assertEqualsBuffers(18, buffers.get(pageNr * 5 + i), msg.get(i).getMessage(null).getBodyBuffer());
}
}
@@ -420,7 +420,7 @@
assertEquals(1, msgs.size());
- assertEquals(0l, msgs.get(0).getMessage(null).getMessageID());
+ assertEquals(1l, msgs.get(0).getMessage(null).getMessageID());
assertEqualsBuffers(18, buffers.get(0), msgs.get(0).getMessage(null).getBodyBuffer());
@@ -678,7 +678,10 @@
ServerMessage msgWritten = buffers2.remove(id);
assertNotNull(msgWritten);
assertEquals(msg.getMessage(null).getDestination(), msgWritten.getDestination());
- assertEqualsByteArrays(msgWritten.getBodyBuffer().toByteBuffer().array(), msg.getMessage(null).getBodyBuffer().toByteBuffer().array());
+ assertEqualsByteArrays(msgWritten.getBodyBuffer().toByteBuffer().array(), msg.getMessage(null)
+ .getBodyBuffer()
+ .toByteBuffer()
+ .array());
}
}
@@ -713,7 +716,8 @@
return new FakePostOffice();
}
- private ServerMessage createMessage(final long id, final PagingStore store,
+ private ServerMessage createMessage(final long id,
+ final PagingStore store,
final SimpleString destination,
final HornetQBuffer buffer)
{
@@ -722,10 +726,10 @@
msg.setDestination(destination);
msg.setPagingStore(store);
-
+
msg.getBodyBuffer().resetReaderIndex();
msg.getBodyBuffer().resetWriterIndex();
-
+
msg.getBodyBuffer().writeBytes(buffer, buffer.capacity());
return msg;
@@ -734,14 +738,14 @@
private HornetQBuffer createRandomBuffer(final long id, final int size)
{
HornetQBuffer buffer = HornetQBuffers.fixedBuffer(size + 8);
-
+
buffer.writeLong(id);
for (int j = 8; j < buffer.capacity(); j++)
{
buffer.writeByte((byte)66);
}
-
+
return buffer;
}
@@ -885,7 +889,7 @@
class FakeStorageManager implements StorageManager
{
- public void setUniqueIDSequence(long id)
+ public void setUniqueIDSequence(final long id)
{
}
@@ -981,21 +985,21 @@
* @see org.hornetq.core.persistence.StorageManager#loadBindingJournal(java.util.List)
*/
public JournalLoadInformation loadBindingJournal(final List<QueueBindingInfo> queueBindingInfos,
- List<GroupingInfo> groupingInfos) throws Exception
+ final List<GroupingInfo> groupingInfos) throws Exception
{
return new JournalLoadInformation();
}
- public void addGrouping(GroupBinding groupBinding) throws Exception
+ public void addGrouping(final GroupBinding groupBinding) throws Exception
{
// To change body of implemented methods use File | Settings | File Templates.
}
- public void deleteGrouping(GroupBinding groupBinding) throws Exception
+ public void deleteGrouping(final GroupBinding groupBinding) throws Exception
{
// To change body of implemented methods use File | Settings | File Templates.
}
-
+
public void sync()
{
}
@@ -1003,11 +1007,11 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#loadMessageJournal(org.hornetq.core.paging.PagingManager, java.util.Map, org.hornetq.core.transaction.ResourceManager, java.util.Map)
*/
- public JournalLoadInformation loadMessageJournal(PostOffice postOffice,
- PagingManager pagingManager,
- ResourceManager resourceManager,
- Map<Long, Queue> queues,
- Map<SimpleString, List<Pair<byte[], Long>>> duplicateIDMap) throws Exception
+ public JournalLoadInformation loadMessageJournal(final PostOffice postOffice,
+ final PagingManager pagingManager,
+ final ResourceManager resourceManager,
+ final Map<Long, Queue> queues,
+ final Map<SimpleString, List<Pair<byte[], Long>>> duplicateIDMap) throws Exception
{
return new JournalLoadInformation();
}
@@ -1099,12 +1103,12 @@
{
}
- public long storeHeuristicCompletion(Xid xid, boolean isCommit) throws Exception
+ public long storeHeuristicCompletion(final Xid xid, final boolean isCommit) throws Exception
{
return -1;
}
- public void deleteHeuristicCompletion(long txID) throws Exception
+ public void deleteHeuristicCompletion(final long txID) throws Exception
{
}
@@ -1172,7 +1176,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#afterReplicated(java.lang.Runnable)
*/
- public void afterCompleteOperations(Runnable run)
+ public void afterCompleteOperations(final Runnable run)
{
}
@@ -1188,7 +1192,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#createLargeMessage(byte[])
*/
- public LargeServerMessage createLargeMessage(long messageId, byte[] header)
+ public LargeServerMessage createLargeMessage(final long messageId, final byte[] header)
{
return null;
@@ -1214,7 +1218,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#pageClosed(org.hornetq.utils.SimpleString, int)
*/
- public void pageClosed(SimpleString storeName, int pageNumber)
+ public void pageClosed(final SimpleString storeName, final int pageNumber)
{
}
@@ -1222,7 +1226,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#pageDeleted(org.hornetq.utils.SimpleString, int)
*/
- public void pageDeleted(SimpleString storeName, int pageNumber)
+ public void pageDeleted(final SimpleString storeName, final int pageNumber)
{
}
@@ -1230,7 +1234,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#pageWrite(org.hornetq.core.paging.PagedMessage, int)
*/
- public void pageWrite(PagedMessage message, int pageNumber)
+ public void pageWrite(final PagedMessage message, final int pageNumber)
{
}
@@ -1238,21 +1242,21 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#blockOnReplication(long)
*/
- public void waitOnOperations(long timeout) throws Exception
+ public void waitOnOperations(final long timeout) throws Exception
{
}
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#setReplicator(org.hornetq.core.replication.ReplicationManager)
*/
- public void setReplicator(ReplicationManager replicator)
+ public void setReplicator(final ReplicationManager replicator)
{
}
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#afterCompleteOperations(org.hornetq.core.journal.IOCompletion)
*/
- public void afterCompleteOperations(IOAsyncTask run)
+ public void afterCompleteOperations(final IOAsyncTask run)
{
}
@@ -1274,7 +1278,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#newContext(java.util.concurrent.Executor)
*/
- public OperationContext newContext(Executor executor)
+ public OperationContext newContext(final Executor executor)
{
return null;
}
@@ -1289,14 +1293,14 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#setContext(org.hornetq.core.persistence.OperationContext)
*/
- public void setContext(OperationContext context)
+ public void setContext(final OperationContext context)
{
}
- public void storeReference(long queueID, long messageID, boolean last) throws Exception
+ public void storeReference(final long queueID, final long messageID, final boolean last) throws Exception
{
// TODO Auto-generated method stub
-
+
}
}
14 years, 11 months
JBoss hornetq SVN: r8471 - trunk/src/main/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2009-11-30 11:22:34 -0500 (Mon, 30 Nov 2009)
New Revision: 8471
Modified:
trunk/src/main/org/hornetq/core/journal/impl/NIOSequentialFile.java
Log:
Small tweak: There's no need to use a direct buffer on NIO/init file
Modified: trunk/src/main/org/hornetq/core/journal/impl/NIOSequentialFile.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/NIOSequentialFile.java 2009-11-30 13:52:10 UTC (rev 8470)
+++ trunk/src/main/org/hornetq/core/journal/impl/NIOSequentialFile.java 2009-11-30 16:22:34 UTC (rev 8471)
@@ -102,7 +102,7 @@
public void fill(final int position, final int size, final byte fillCharacter) throws Exception
{
- ByteBuffer bb = ByteBuffer.allocateDirect(size);
+ ByteBuffer bb = ByteBuffer.allocate(size);
for (int i = 0; i < size; i++)
{
14 years, 11 months
JBoss hornetq SVN: r8470 - trunk/examples/javaee/xarecovery.
by do-not-reply@jboss.org
Author: ataylor
Date: 2009-11-30 08:52:10 -0500 (Mon, 30 Nov 2009)
New Revision: 8470
Modified:
trunk/examples/javaee/xarecovery/build.xml
Log:
fixed restart target on xarecovery example
Modified: trunk/examples/javaee/xarecovery/build.xml
===================================================================
--- trunk/examples/javaee/xarecovery/build.xml 2009-11-30 12:52:23 UTC (rev 8469)
+++ trunk/examples/javaee/xarecovery/build.xml 2009-11-30 13:52:10 UTC (rev 8470)
@@ -33,9 +33,11 @@
<echo>==============================</echo>
<echo>Restart the server and recover</echo>
<echo>==============================</echo>
- <exec dir="${jboss.home}/bin" executable="sh">
+ <exec dir="${jboss.home}/bin" executable="sh" osfamily="unix">
<arg line="run.sh -c ${example.name}-example-profile"/>
</exec>
-
+ <exec dir="${jboss.home}/bin" executable="cmd" osfamily="windows">
+ <arg line="/c run.bat -c ${example.name}-example-profile"/>
+ </exec>
</target>
</project>
\ No newline at end of file
14 years, 11 months
JBoss hornetq SVN: r8469 - in trunk/src/main/org/hornetq: integration/transports/netty and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-11-30 07:52:23 -0500 (Mon, 30 Nov 2009)
New Revision: 8469
Modified:
trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
trunk/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java
Log:
fixed race condition in netty acceptor
* added workaround to avoid race condition in NettyAcceptor.pause()
(until netty 3.2.x is integrated)
* removed sleep from RemotingService.stop()
Modified: trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2009-11-30 11:56:39 UTC (rev 8468)
+++ trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2009-11-30 12:52:23 UTC (rev 8469)
@@ -225,21 +225,6 @@
acceptor.pause();
}
- boolean containsNettyAcceptors = false;
- for (Acceptor acceptor : acceptors)
- {
- if (acceptor.getClass().toString().contains("NettyAcceptor"))
- {
- containsNettyAcceptors = true;
- break;
- }
- }
- if (containsNettyAcceptors)
- {
- // we sleep in case there are initializing connections which are in the thread pool
- Thread.sleep(1000);
- }
-
synchronized (server)
{
for (ConnectionEntry entry : connections.values())
Modified: trunk/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java
===================================================================
--- trunk/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java 2009-11-30 11:56:39 UTC (rev 8468)
+++ trunk/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java 2009-11-30 12:52:23 UTC (rev 8469)
@@ -129,6 +129,8 @@
private NotificationService notificationService;
+ private VirtualExecutorService bossExecutor;
+
public NettyAcceptor(final Map<String, Object> configuration,
final BufferHandler handler,
final ConnectionLifeCycleListener listener,
@@ -225,7 +227,8 @@
return;
}
- VirtualExecutorService virtualExecutor = new VirtualExecutorService(threadPool);
+ bossExecutor = new VirtualExecutorService(threadPool);
+ VirtualExecutorService workerExecutor = new VirtualExecutorService(threadPool);
if (useInvm)
{
@@ -233,11 +236,11 @@
}
else if (useNio)
{
- channelFactory = new NioServerSocketChannelFactory(virtualExecutor, virtualExecutor);
+ channelFactory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);
}
else
{
- channelFactory = new OioServerSocketChannelFactory(virtualExecutor, virtualExecutor);
+ channelFactory = new OioServerSocketChannelFactory(bossExecutor, workerExecutor);
}
bootstrap = new ServerBootstrap(channelFactory);
@@ -445,6 +448,18 @@
}
}
}
+ // TODO remove workaround when integrating Netty 3.2.x
+ // https://jira.jboss.org/jira/browse/NETTY-256
+ bossExecutor.shutdown();
+ try
+ {
+
+ bossExecutor.awaitTermination(30, TimeUnit.SECONDS);
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
paused = true;
}
14 years, 11 months
JBoss hornetq SVN: r8468 - trunk/src/main/org/hornetq/integration/transports/netty.
by do-not-reply@jboss.org
Author: timfox
Date: 2009-11-30 06:56:39 -0500 (Mon, 30 Nov 2009)
New Revision: 8468
Modified:
trunk/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java
Log:
Put new decoder back, now it seems to work
Modified: trunk/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java
===================================================================
--- trunk/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java 2009-11-30 11:14:33 UTC (rev 8467)
+++ trunk/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java 2009-11-30 11:56:39 UTC (rev 8468)
@@ -47,7 +47,7 @@
public static void addCodecFilter(final ChannelPipeline pipeline, final BufferHandler handler)
{
assert pipeline != null;
- pipeline.addLast("decoder", new HornetQFrameDecoder(handler));
+ pipeline.addLast("decoder", new HornetQFrameDecoder2());
}
public static void addSSLFilter(final ChannelPipeline pipeline, final SSLContext context, final boolean client) throws Exception
14 years, 11 months
JBoss hornetq SVN: r8467 - trunk/src/main/org/hornetq/integration/transports/netty.
by do-not-reply@jboss.org
Author: trustin
Date: 2009-11-30 06:14:33 -0500 (Mon, 30 Nov 2009)
New Revision: 8467
Modified:
trunk/src/main/org/hornetq/integration/transports/netty/HornetQFrameDecoder2.java
Log:
Fixed a bug in HornetQFrameDecoder where the decoder does not generate a frame on a certain fragmentation pattern
Modified: trunk/src/main/org/hornetq/integration/transports/netty/HornetQFrameDecoder2.java
===================================================================
--- trunk/src/main/org/hornetq/integration/transports/netty/HornetQFrameDecoder2.java 2009-11-30 11:09:47 UTC (rev 8466)
+++ trunk/src/main/org/hornetq/integration/transports/netty/HornetQFrameDecoder2.java 2009-11-30 11:14:33 UTC (rev 8467)
@@ -82,7 +82,7 @@
break;
case 4:
length = previousData.getInt(previousData.readerIndex());
- if (in.readableBytes() - 4 < length) {
+ if (in.readableBytes() < length) {
append(in, length);
return;
}
@@ -112,11 +112,12 @@
}
frame.skipBytes(4);
- Channels.fireMessageReceived(ctx, frame);
-
if (!in.readable()) {
previousData = ChannelBuffers.EMPTY_BUFFER;
+ Channels.fireMessageReceived(ctx, frame);
return;
+ } else {
+ Channels.fireMessageReceived(ctx, frame);
}
}
14 years, 11 months
JBoss hornetq SVN: r8466 - trunk/src/main/org/hornetq/core/message/impl.
by do-not-reply@jboss.org
Author: ataylor
Date: 2009-11-30 06:09:47 -0500 (Mon, 30 Nov 2009)
New Revision: 8466
Modified:
trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java
Log:
message id was not being set in MessageImpl constructor
Modified: trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java 2009-11-30 11:04:51 UTC (rev 8465)
+++ trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java 2009-11-30 11:09:47 UTC (rev 8466)
@@ -143,6 +143,7 @@
protected MessageImpl(final long messageID, final int initialMessageBufferSize)
{
this(initialMessageBufferSize);
+ this.messageID = messageID;
}
protected MessageImpl(final int initialMessageBufferSize)
14 years, 11 months
JBoss hornetq SVN: r8465 - trunk.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-11-30 06:04:51 -0500 (Mon, 30 Nov 2009)
New Revision: 8465
Modified:
trunk/build-hornetq.xml
Log:
exclude all failover tests for cluster with backup as they hang on hudson
Modified: trunk/build-hornetq.xml
===================================================================
--- trunk/build-hornetq.xml 2009-11-30 10:44:49 UTC (rev 8464)
+++ trunk/build-hornetq.xml 2009-11-30 11:04:51 UTC (rev 8465)
@@ -1226,6 +1226,7 @@
<fileset dir="${test.classes.dir}">
<!-- exlcuded because of https://jira.jboss.org/jira/browse/HORNETQ-65 -->
<exclude name="**/cluster/failover/*StaticClusterWithBackupFailoverTest.class" />
+ <exclude name="**/cluster/failover/*WithBackupFailoverTest.class" />
<include name="${tests.param}"/>
</fileset>
</batchtest>
14 years, 11 months
JBoss hornetq SVN: r8464 - trunk/examples/jms/embedded.
by do-not-reply@jboss.org
Author: ataylor
Date: 2009-11-30 05:44:49 -0500 (Mon, 30 Nov 2009)
New Revision: 8464
Modified:
trunk/examples/jms/embedded/build.xml
Log:
fixed classpath on embedded example
Modified: trunk/examples/jms/embedded/build.xml
===================================================================
--- trunk/examples/jms/embedded/build.xml 2009-11-30 10:11:25 UTC (rev 8463)
+++ trunk/examples/jms/embedded/build.xml 2009-11-30 10:44:49 UTC (rev 8464)
@@ -25,7 +25,9 @@
<include name="**/jnpserver.jar"/>
<include name="**/jboss-logging-spi.jar"/>
<include name="**/jboss-common-core.jar"/>
- <include name="**/netty.jar"/>
+ <include name="**/netty.jar"/>
+ <!--for the distro-->
+ <include name="**/jboss-mc.jar"/>
</fileset>
</path>
14 years, 11 months
JBoss hornetq SVN: r8463 - trunk/tests/src/org/hornetq/tests/integration/cluster/distribution.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-11-30 05:11:25 -0500 (Mon, 30 Nov 2009)
New Revision: 8463
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
Log:
reverted r8461
* messages may need some time to reach some nodes before they can be consumed
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2009-11-30 10:10:50 UTC (rev 8462)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2009-11-30 10:11:25 UTC (rev 8463)
@@ -804,7 +804,7 @@
ClientMessage message;
do
{
- message = holder.consumer.receiveImmediate();
+ message = holder.consumer.receive(500);
if (message != null)
{
14 years, 11 months