From 1c0dbd1a1e1b5276d33878839fdef3f3921e1cfd Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Thu, 5 Apr 2012 11:35:57 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-3801 - job scheduler index corruption git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1309780 13f79535-47bb-0310-9956-ffa450edef68 --- .../broker/scheduler/JobSchedulerStore.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java b/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java index 9b71835f1b..0ca708d6e4 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java @@ -16,23 +16,9 @@ */ package org.apache.activemq.broker.scheduler; -import java.io.DataInput; -import java.io.DataOutput; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; import org.apache.activemq.util.IOHelper; import org.apache.activemq.util.ServiceStopper; import org.apache.activemq.util.ServiceSupport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.apache.kahadb.index.BTreeIndex; import org.apache.kahadb.journal.Journal; import org.apache.kahadb.journal.Location; @@ -44,6 +30,21 @@ import org.apache.kahadb.util.IntegerMarshaller; import org.apache.kahadb.util.LockFile; import org.apache.kahadb.util.StringMarshaller; import org.apache.kahadb.util.VariableMarshaller; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; public class JobSchedulerStore extends ServiceSupport { static final Logger LOG = LoggerFactory.getLogger(JobSchedulerStore.class); @@ -235,6 +236,7 @@ public class JobSchedulerStore extends ServiceSupport { this.journal.setWriteBatchSize(getJournalMaxWriteBatchSize()); this.journal.start(); this.pageFile = new PageFile(directory, "scheduleDB"); + this.pageFile.setWriteBatchSize(1); this.pageFile.load(); this.pageFile.tx().execute(new Transaction.Closure() {