Author: clebert.suconic(a)jboss.com
Date: 2009-11-23 13:15:23 -0500 (Mon, 23 Nov 2009)
New Revision: 8379
Modified:
branches/ClebertCallback/src/main/org/hornetq/core/journal/impl/JournalImpl.java
Log:
tweaks
Modified:
branches/ClebertCallback/src/main/org/hornetq/core/journal/impl/JournalImpl.java
===================================================================
---
branches/ClebertCallback/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2009-11-23
17:46:20 UTC (rev 8378)
+++
branches/ClebertCallback/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2009-11-23
18:15:23 UTC (rev 8379)
@@ -876,11 +876,6 @@
throw new IllegalStateException("Journal must be loaded first");
}
- if (callback != null)
- {
- callback.lineUp();
- }
-
compactingLock.readLock().lock();
try
@@ -891,6 +886,11 @@
writeAddRecord(-1, id, recordType, record, size, bb); // fileID will be filled
later
+ if (callback != null)
+ {
+ callback.lineUp();
+ }
+
lockAppend.lock();
try
{
@@ -958,17 +958,17 @@
}
}
- if (callback != null)
- {
- callback.lineUp();
- }
-
int size = SIZE_UPDATE_RECORD + record.getEncodeSize();
ChannelBuffer bb = newBuffer(size);
writeUpdateRecord(-1, id, recordType, record, size, bb);
+ if (callback != null)
+ {
+ callback.lineUp();
+ }
+
lockAppend.lock();
try
{
@@ -1021,11 +1021,6 @@
throw new IllegalStateException("Journal must be loaded first");
}
- if (callback != null)
- {
- callback.lineUp();
- }
-
compactingLock.readLock().lock();
try
@@ -1040,13 +1035,18 @@
throw new IllegalStateException("Cannot find add info " + id);
}
}
-
+
int size = SIZE_DELETE_RECORD;
ChannelBuffer bb = newBuffer(size);
writeDeleteRecord(-1, id, size, bb);
+ if (callback != null)
+ {
+ callback.lineUp();
+ }
+
lockAppend.lock();
try
{
@@ -1282,11 +1282,6 @@
throw new IllegalStateException("Journal must be loaded first");
}
- if (callback != null)
- {
- callback.lineUp();
- }
-
compactingLock.readLock().lock();
JournalTransaction tx = getTransactionInfo(txID);
@@ -1299,6 +1294,11 @@
writeTransaction(-1, PREPARE_RECORD, txID, transactionData, size, -1, bb);
+ if (callback != null)
+ {
+ callback.lineUp();
+ }
+
lockAppend.lock();
try
{
@@ -1359,11 +1359,6 @@
throw new IllegalStateException("Journal must be loaded first");
}
- if (callback != null)
- {
- callback.lineUp();
- }
-
compactingLock.readLock().lock();
JournalTransaction tx = transactions.remove(txID);
@@ -1378,7 +1373,7 @@
callback.done();
return;
}
-
+
ChannelBuffer bb = newBuffer(SIZE_COMPLETE_TRANSACTION_RECORD);
writeTransaction(-1,
@@ -1389,6 +1384,11 @@
-1 /* number of records on this transaction will be filled
later inside append record */,
bb);
+ if (callback != null)
+ {
+ callback.lineUp();
+ }
+
lockAppend.lock();
try
{
@@ -1429,11 +1429,6 @@
throw new IllegalStateException("Journal must be loaded first");
}
- if (callback != null)
- {
- callback.lineUp();
- }
-
compactingLock.readLock().lock();
JournalTransaction tx = null;
@@ -1446,11 +1441,16 @@
{
throw new IllegalStateException("Cannot find tx with id " + txID);
}
-
+
ChannelBuffer bb = newBuffer(SIZE_ROLLBACK_RECORD);
writeRollback(-1, txID, bb);
+ if (callback != null)
+ {
+ callback.lineUp();
+ }
+
lockAppend.lock();
try
{