Author: timfox
Date: 2009-12-11 12:20:56 -0500 (Fri, 11 Dec 2009)
New Revision: 8680
Modified:
trunk/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
trunk/src/main/org/hornetq/integration/transports/netty/HornetQFrameDecoder2.java
Log:
some adjustments on buffer sizes
Modified:
trunk/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
===================================================================
---
trunk/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java 2009-12-11
16:50:36 UTC (rev 8679)
+++
trunk/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java 2009-12-11
17:20:56 UTC (rev 8680)
@@ -96,9 +96,8 @@
private static final Logger log = Logger.getLogger(ManagementServiceImpl.class);
private final MBeanServer mbeanServer;
+ private final boolean jmxManagementEnabled;
- private final boolean jmxManagementEnabled;
-
private final Map<String, Object> registry;
private final NotificationBroadcasterSupport broadcaster;
@@ -427,7 +426,7 @@
public ServerMessage handleMessage(final ServerMessage message) throws Exception
{
// a reply message is sent with the result stored in the message body.
- ServerMessage reply = new ServerMessageImpl(storageManager.generateUniqueID(),
512);
+ ServerMessage reply = new ServerMessageImpl(storageManager.generateUniqueID(),
50);
String resourceName =
message.getStringProperty(ManagementHelper.HDR_RESOURCE_NAME);
if (ManagementServiceImpl.log.isDebugEnabled())
@@ -719,7 +718,7 @@
long messageID = storageManager.generateUniqueID();
- ServerMessage notificationMessage = new ServerMessageImpl(messageID,
512);
+ ServerMessage notificationMessage = new ServerMessageImpl(messageID, 50);
// Notification messages are always durable so the user can choose whether
to add a durable queue to
// consume
Modified:
trunk/src/main/org/hornetq/integration/transports/netty/HornetQFrameDecoder2.java
===================================================================
---
trunk/src/main/org/hornetq/integration/transports/netty/HornetQFrameDecoder2.java 2009-12-11
16:50:36 UTC (rev 8679)
+++
trunk/src/main/org/hornetq/integration/transports/netty/HornetQFrameDecoder2.java 2009-12-11
17:20:56 UTC (rev 8680)
@@ -13,6 +13,7 @@
package org.hornetq.integration.transports.netty;
+import org.hornetq.core.logging.Logger;
import org.hornetq.utils.DataConstants;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
@@ -33,6 +34,8 @@
@ChannelPipelineCoverage("one")
public class HornetQFrameDecoder2 extends SimpleChannelUpstreamHandler
{
+ private static final Logger log = Logger.getLogger(HornetQFrameDecoder2.class);
+
private ChannelBuffer previousData = ChannelBuffers.EMPTY_BUFFER;
// SimpleChannelUpstreamHandler overrides
@@ -46,8 +49,9 @@
{
if (previousData.readableBytes() + in.readableBytes() <
DataConstants.SIZE_INT)
{
- // XXX Length is unknown. Bet at 512. Tune this value.
- append(in, 512);
+ // XXX Length is unknown. Bet at 100. Tune this value.
+ //In most cases this won't occur
+ append(in, 100);
return;
}
@@ -111,8 +115,8 @@
{
// XXX Tune this value: Increasing the initial capacity of the
// dynamic buffer might reduce the chance of additional memory
- // copy.
- frame = ChannelBuffers.dynamicBuffer(length + 4);
+ // copy.
+ frame = ChannelBuffers.dynamicBuffer(length + 4);
frame.writeBytes(previousData, previousData.readerIndex(),
previousData.readableBytes());
frame.writeBytes(in, length + 4 - frame.writerIndex());
}
@@ -164,8 +168,8 @@
// Convert to dynamic buffer (this requires copy)
// XXX Tune this value: Increasing the initial capacity of the dynamic
- // buffer might reduce the chance of additional memory copy.
- ChannelBuffer frame = ChannelBuffers.dynamicBuffer(length +
DataConstants.SIZE_INT);
+ // buffer might reduce the chance of additional memory copy.
+ ChannelBuffer frame = ChannelBuffers.dynamicBuffer(length +
DataConstants.SIZE_INT);
frame.writeBytes(in, length + DataConstants.SIZE_INT);
frame.skipBytes(DataConstants.SIZE_INT);
Channels.fireMessageReceived(ctx, frame);
@@ -182,7 +186,7 @@
previousData.writeBytes(in);
}
else
- {
+ {
ChannelBuffer newPreviousData =
ChannelBuffers.dynamicBuffer(Math.max(previousData.readableBytes() + in.readableBytes(),
length +
4));
newPreviousData.writeBytes(previousData);