mirror of
https://github.com/apache/activemq.git
synced 2025-02-16 23:16:52 +00:00
https://issues.apache.org/jira/browse/AMQ-4212 - fix auto upgrade from ver 1 and 2 to 5 - regression in KahaDBVersionTest
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1511711 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ae84399b97
commit
90d6c2042d
@ -1838,13 +1838,16 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
|
||||
pageFile.tx().execute(new Transaction.Closure<IOException>() {
|
||||
@Override
|
||||
public void execute(Transaction tx) throws IOException {
|
||||
LinkedHashMap<String, SequenceSet> temp = new LinkedHashMap<String, SequenceSet>();
|
||||
|
||||
if (metadata.version >= 3) {
|
||||
// migrate
|
||||
BTreeIndex<Long, HashSet<String>> oldAckPositions =
|
||||
new BTreeIndex<Long, HashSet<String>>(pageFile, dataIn.readLong());
|
||||
oldAckPositions.setKeyMarshaller(LongMarshaller.INSTANCE);
|
||||
oldAckPositions.setValueMarshaller(HashSetStringMarshaller.INSTANCE);
|
||||
oldAckPositions.load(tx);
|
||||
|
||||
LinkedHashMap<String, SequenceSet> temp = new LinkedHashMap<String, SequenceSet>();
|
||||
|
||||
// Do the initial build of the data in memory before writing into the store
|
||||
// based Ack Positions List to avoid a lot of disk thrashing.
|
||||
@ -1862,7 +1865,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
|
||||
pendingAcks.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Now move the pending messages to ack data into the store backed
|
||||
// structure.
|
||||
value.ackPositions = new ListIndex<String, SequenceSet>(pageFile, tx.allocate());
|
||||
|
@ -168,7 +168,7 @@ public class KahaDBVersionTest extends TestCase {
|
||||
TextMessage msg = (TextMessage) topicConsumer.receive(10000);
|
||||
count++;
|
||||
// System.err.println(msg.getText());
|
||||
assertNotNull(msg);
|
||||
assertNotNull("" + count, msg);
|
||||
}
|
||||
LOG.info("Consumed " + count + " from topic");
|
||||
connection.close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user