activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-4988
Date Wed, 22 Jan 2014 15:09:46 GMT
Updated Branches:
  refs/heads/trunk 90104943b -> dd0c9c414


https://issues.apache.org/jira/browse/AMQ-4988

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/dd0c9c41
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/dd0c9c41
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/dd0c9c41

Branch: refs/heads/trunk
Commit: dd0c9c414449406266c72712aea65472b5a2f63a
Parents: 9010494
Author: Timothy Bish <tabish121@gmai.com>
Authored: Wed Jan 22 10:09:38 2014 -0500
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Wed Jan 22 10:09:38 2014 -0500

----------------------------------------------------------------------
 .../kahadb/scheduler/JobSchedulerImpl.java      | 22 +++++++++-----------
 .../broker/scheduler/JobSchedulerTest.java      |  1 +
 2 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/dd0c9c41/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java
index 415a292..455801a 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java
@@ -435,17 +435,16 @@ class JobSchedulerImpl extends ServiceSupport implements Runnable, JobScheduler
         for (Iterator<Map.Entry<Long, List<JobLocation>>> i = this.index.iterator(tx);
i.hasNext();) {
             Map.Entry<Long, List<JobLocation>> entry = i.next();
             keys.add(entry.getKey());
-            List<JobLocation> values = entry.getValue();
+        }
+
+        for (Long l : keys) {
+            List<JobLocation> values = this.index.remove(tx, l);
             if (values != null) {
                 for (JobLocation jl : values) {
                     this.store.decrementJournalCount(tx, jl.getLocation());
                 }
             }
         }
-
-        for (Long l : keys) {
-            this.index.remove(tx, l);
-        }
     }
 
     synchronized void destroy(Transaction tx, long start, long finish) throws IOException
{
@@ -454,19 +453,18 @@ class JobSchedulerImpl extends ServiceSupport implements Runnable, JobScheduler
             Map.Entry<Long, List<JobLocation>> entry = i.next();
             if (entry.getKey().longValue() <= finish) {
                 keys.add(entry.getKey());
-                List<JobLocation> values = entry.getValue();
-                if (values != null) {
-                    for (JobLocation jl : values) {
-                        this.store.decrementJournalCount(tx, jl.getLocation());
-                    }
-                }
             } else {
                 break;
             }
         }
 
         for (Long l : keys) {
-            this.index.remove(tx, l);
+            List<JobLocation> values = this.index.remove(tx, l);
+            if (values != null) {
+                for (JobLocation jl : values) {
+                    this.store.decrementJournalCount(tx, jl.getLocation());
+                }
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/dd0c9c41/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
index 65edb08..5126970 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerTest.java
@@ -252,6 +252,7 @@ public class JobSchedulerTest {
 
     @After
     public void tearDown() throws Exception {
+        scheduler.stopDispatching();
         store.stop();
     }
 }


Mime
View raw message