[jboss-cvs] JBoss Messaging SVN: r7530 - in trunk: tests/src/org/jboss/messaging/tests/integration/client and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 7 01:08:59 EDT 2009
Author: clebert.suconic at jboss.com
Date: 2009-07-07 01:08:58 -0400 (Tue, 07 Jul 2009)
New Revision: 7530
Modified:
trunk/src/main/org/jboss/messaging/core/journal/impl/AIOSequentialFile.java
trunk/tests/src/org/jboss/messaging/tests/integration/client/CompactingTest.java
Log:
tweaks
Modified: trunk/src/main/org/jboss/messaging/core/journal/impl/AIOSequentialFile.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/journal/impl/AIOSequentialFile.java 2009-07-07 05:00:09 UTC (rev 7529)
+++ trunk/src/main/org/jboss/messaging/core/journal/impl/AIOSequentialFile.java 2009-07-07 05:08:58 UTC (rev 7530)
@@ -116,7 +116,7 @@
return aioFile.getBlockSize();
}
-
+
public boolean exists()
{
return file.exists();
@@ -151,14 +151,8 @@
checkOpened();
opened = false;
-// if (timedBuffer != null)
-// {
-// timedBuffer.flush();
-// timedBuffer.setObserver(null);
-// } -- remove this
-//
timedBuffer = null;
-
+
final CountDownLatch donelatch = new CountDownLatch(1);
executor.execute(new Runnable()
@@ -172,12 +166,13 @@
while (!donelatch.await(60, TimeUnit.SECONDS))
{
log.warn("Executor on file " + file.getName() + " couldn't complete its tasks in 60 seconds.",
- new Exception("Warning: Executor on file " + file.getName() + " couldn't complete its tasks in 60 seconds."));
+ new Exception("Warning: Executor on file " + file.getName() +
+ " couldn't complete its tasks in 60 seconds."));
}
aioFile.close();
aioFile = null;
-
+
this.notifyAll();
}
@@ -192,7 +187,6 @@
}
}
-
public void delete() throws Exception
{
if (aioFile != null)
@@ -258,8 +252,8 @@
}
public void open() throws Exception
- {
- open(maxIO);
+ {
+ open(maxIO);
}
/* (non-Javadoc)
@@ -354,8 +348,7 @@
write(bytes, false, DummyCallback.getInstance());
}
}
-
-
+
public void write(final ByteBuffer bytes, final boolean sync, final IOCallback callback) throws Exception
{
if (timedBuffer != null)
@@ -363,7 +356,7 @@
// sanity check.. it shouldn't happen
log.warn("Illegal buffered usage. Can't use ByteBuffer write while buffer SequentialFile");
}
-
+
doWrite(bytes, callback);
}
@@ -383,7 +376,6 @@
}
}
-
public void sync() throws Exception
{
throw new IllegalArgumentException("This method is not supported on AIO");
@@ -409,7 +401,7 @@
{
timedBuffer.setObserver(null);
}
-
+
this.timedBuffer = buffer;
if (buffer != null)
@@ -532,7 +524,7 @@
return (int)(fileSize - position.get());
}
}
-
+
public String toString()
{
return "TimedBufferObserver on file (" + AIOSequentialFile.this.file.getName() + ")";
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/client/CompactingTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/CompactingTest.java 2009-07-07 05:00:09 UTC (rev 7529)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/CompactingTest.java 2009-07-07 05:08:58 UTC (rev 7530)
@@ -230,22 +230,6 @@
server.stop();
- // NIOSequentialFileFactory factory = new NIOSequentialFileFactory(getJournalDir());
- //
- // List<String> files = factory.listFiles("jbm");
- //
- // for (String str: files)
- // {
- // System.out.println("Files " + str);
- // SequentialFile file = factory.createSequentialFile(str, 1);
- // for (int i = 0 ; i < 10 && file.size() == 0; i ++)
- // {
- // System.out.println("File size is ZERO = " + file.size());
- // Thread.sleep(1000);
- // }
- // assertTrue(file.getFileName() + " size = " + file.size(), file.size() > 0);
- // }
-
setupServer(journalType);
ClientSession sess = sf.createSession(true, true);
@@ -331,6 +315,8 @@
server.stop();
+ // We don't super.tearDown here because in case of failure, the data may be useful for debug
+ // so, we only clear data on setup.
// super.tearDown();
}
More information about the jboss-cvs-commits
mailing list