[jboss-cvs] JBoss Messaging SVN: r5669 - in trunk: src/main/org/jboss/messaging/core/persistence/impl/journal and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 20 07:56:21 EST 2009
Author: timfox
Date: 2009-01-20 07:56:21 -0500 (Tue, 20 Jan 2009)
New Revision: 5669
Modified:
trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalLargeServerMessage.java
trunk/src/main/org/jboss/messaging/core/server/impl/ServerMessageImpl.java
trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java
Log:
Fixed test
Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java 2009-01-20 12:01:56 UTC (rev 5668)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java 2009-01-20 12:56:21 UTC (rev 5669)
@@ -223,7 +223,6 @@
public boolean addSize(final long size) throws Exception
{
- //log.info("Adding size " + size);
final long maxSize = getMaxSizeBytes();
final long pageSize = getPageSizeBytes();
Modified: trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalLargeServerMessage.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalLargeServerMessage.java 2009-01-20 12:01:56 UTC (rev 5668)
+++ trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalLargeServerMessage.java 2009-01-20 12:56:21 UTC (rev 5669)
@@ -22,6 +22,8 @@
package org.jboss.messaging.core.persistence.impl.journal;
+import static org.jboss.messaging.util.DataConstants.SIZE_INT;
+
import java.nio.ByteBuffer;
import org.jboss.messaging.core.exception.MessagingException;
@@ -189,12 +191,20 @@
storageManager.deleteFile(file);
}
}
+
+ //We cache this
+ private volatile int memoryEstimate = -1;
@Override
public synchronized int getMemoryEstimate()
{
- // The body won't be on memory (aways on-file), so we don't consider this for paging
- return super.getPropertiesEncodeSize();
+ if (memoryEstimate == -1)
+ {
+ // The body won't be on memory (aways on-file), so we don't consider this for paging
+ memoryEstimate = getPropertiesEncodeSize() + SIZE_INT + getEncodeSize() + (16 + 4) * 2 + 1;
+ }
+
+ return memoryEstimate;
}
public synchronized void complete() throws Exception
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ServerMessageImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ServerMessageImpl.java 2009-01-20 12:01:56 UTC (rev 5668)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ServerMessageImpl.java 2009-01-20 12:56:21 UTC (rev 5669)
@@ -158,8 +158,6 @@
{
ServerMessage m = new ServerMessageImpl(this);
- log.info("created copy, new ref count is " + m.getRefCount());
-
return m;
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java 2009-01-20 12:01:56 UTC (rev 5668)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java 2009-01-20 12:56:21 UTC (rev 5669)
@@ -204,7 +204,7 @@
if (realFiles)
{
messagingService.stop();
-
+
messagingService = createService(realFiles);
messagingService.start();
@@ -348,8 +348,6 @@
{
File tmpFile = new File(directory + "/" + name);
- log.info("Creating file " + tmpFile);
-
RandomAccessFile random = new RandomAccessFile(tmpFile, "rw");
FileChannel channel = random.getChannel();
@@ -375,8 +373,6 @@
channel.close();
random.close();
- log.info("file " + tmpFile + " created");
-
return tmpFile;
}
More information about the jboss-cvs-commits
mailing list