Skip to content
Browse files

Disable repair job by default, add separate settings to enable/disabl…

…e slop pusher job.
  • Loading branch information...
1 parent d3184d2 commit 17964e69a598f21edc70602e5b47ce1138ecbc01 @afeinberg afeinberg committed Jan 24, 2011
Showing with 50 additions and 39 deletions.
  1. +11 −2 src/java/voldemort/server/VoldemortConfig.java
  2. +39 −37 src/java/voldemort/server/storage/StorageService.java
View
13 src/java/voldemort/server/VoldemortConfig.java
@@ -111,6 +111,7 @@
private RequestFormatType requestFormatType;
private boolean enableSlop;
+ private boolean enableSlopPusherJob;
private boolean enableRepair;
private boolean enableGui;
private boolean enableHttpServer;
@@ -258,6 +259,7 @@ public VoldemortConfig(Props props) {
this.enableJmx = props.getBoolean("jmx.enable", true);
this.enablePipelineRoutedStore = props.getBoolean("enable.pipeline.routed.store", true);
this.enableSlop = props.getBoolean("slop.enable", true);
+ this.enableSlopPusherJob = props.getBoolean("slop.pusher.enable", true);
this.slopMaxWriteBytesPerSec = props.getBytes("slop.write.byte.per.sec", 10 * 1000 * 1000);
this.enableVerboseLogging = props.getBoolean("enable.verbose.logging", true);
this.enableStatTracking = props.getBoolean("enable.stat.tracking", true);
@@ -267,11 +269,10 @@ public VoldemortConfig(Props props) {
this.enableGossip = props.getBoolean("enable.gossip", false);
this.enableRebalanceService = props.getBoolean("enable.rebalancing", true);
this.enableGrandfather = props.getBoolean("enable.grandfather", true);
- this.enableRepair = props.getBoolean("enable.repair", true);
+ this.enableRepair = props.getBoolean("enable.repair", false);
this.gossipInterval = props.getInt("gossip.interval.ms", 30 * 1000);
- this.enableSlop = props.getBoolean("slop.enable", true);
this.slopMaxWriteBytesPerSec = props.getBytes("slop.write.byte.per.sec", 10 * 1000 * 1000);
this.slopMaxReadBytesPerSec = props.getBytes("slop.read.byte.per.sec", 10 * 1000 * 1000);
this.slopStoreType = props.getString("slop.store.engine", BdbStorageConfiguration.TYPE_NAME);
@@ -949,6 +950,14 @@ public void setEnableSlop(boolean enableSlop) {
this.enableSlop = enableSlop;
}
+ public boolean isSlopPusherJobEnabled() {
+ return enableSlopPusherJob;
+ }
+
+ public void setEnableSlopPusherJob(boolean enableSlopPusherJob) {
+ this.enableSlopPusherJob = enableSlopPusherJob;
+ }
+
public boolean isRepairEnabled() {
return this.enableRepair;
}
View
76 src/java/voldemort/server/storage/StorageService.java
@@ -203,45 +203,47 @@ protected void startInner() {
registerEngine(slopEngine);
storeRepository.setSlopStore(slopEngine);
- // Now initialize the pusher job after some time
- GregorianCalendar cal = new GregorianCalendar();
- cal.add(Calendar.SECOND,
- (int) (voldemortConfig.getSlopFrequencyMs() / Time.MS_PER_SECOND));
- Date nextRun = cal.getTime();
- logger.info("Initializing slop pusher job type " + voldemortConfig.getPusherType()
- + " at " + nextRun);
-
- scheduler.schedule("slop",
- (voldemortConfig.getPusherType()
- .compareTo(BlockingSlopPusherJob.TYPE_NAME) == 0) ? new BlockingSlopPusherJob(storeRepository,
- metadata,
- failureDetector,
- voldemortConfig,
- scanPermits)
- : new StreamingSlopPusherJob(storeRepository,
- metadata,
- failureDetector,
- voldemortConfig,
- scanPermits),
- nextRun,
- voldemortConfig.getSlopFrequencyMs());
-
- /*
- * Register the repairer thread only if slop pusher job is also
- * enabled
- */
- if(voldemortConfig.isRepairEnabled()) {
+
+ if(voldemortConfig.isSlopPusherJobEnabled()) {
+ // Now initialize the pusher job after some time
+ GregorianCalendar cal = new GregorianCalendar();
cal.add(Calendar.SECOND,
- (int) (voldemortConfig.getRepairFrequencyMs() / Time.MS_PER_SECOND));
- nextRun = cal.getTime();
- logger.info("Initializing repair job " + voldemortConfig.getPusherType() + " at "
- + nextRun);
- RepairJob job = new RepairJob(storeRepository, metadata, scanPermits);
-
- JmxUtils.registerMbean(job, JmxUtils.createObjectName(job.getClass()));
- scheduler.schedule("repair", job, nextRun, voldemortConfig.getRepairFrequencyMs());
+ (int) (voldemortConfig.getSlopFrequencyMs() / Time.MS_PER_SECOND));
+ Date nextRun = cal.getTime();
+ logger.info("Initializing slop pusher job type " + voldemortConfig.getPusherType()
+ + " at " + nextRun);
+
+ scheduler.schedule("slop",
+ (voldemortConfig.getPusherType()
+ .compareTo(BlockingSlopPusherJob.TYPE_NAME) == 0) ? new BlockingSlopPusherJob(storeRepository,
+ metadata,
+ failureDetector,
+ voldemortConfig,
+ scanPermits)
+ : new StreamingSlopPusherJob(storeRepository,
+ metadata,
+ failureDetector,
+ voldemortConfig,
+ scanPermits),
+ nextRun,
+ voldemortConfig.getSlopFrequencyMs());
+
+ /*
+ * Register the repairer thread only if slop pusher job is also
+ * enabled
+ */
+ if(voldemortConfig.isRepairEnabled()) {
+ cal.add(Calendar.SECOND,
+ (int) (voldemortConfig.getRepairFrequencyMs() / Time.MS_PER_SECOND));
+ nextRun = cal.getTime();
+ logger.info("Initializing repair job " + voldemortConfig.getPusherType() + " at "
+ + nextRun);
+ RepairJob job = new RepairJob(storeRepository, metadata, scanPermits);
+
+ JmxUtils.registerMbean(job, JmxUtils.createObjectName(job.getClass()));
+ scheduler.schedule("repair", job, nextRun, voldemortConfig.getRepairFrequencyMs());
+ }
}
-
}
List<StoreDefinition> storeDefs = new ArrayList<StoreDefinition>(this.metadata.getStoreDefList());

0 comments on commit 17964e6

Please sign in to comment.
Something went wrong with that request. Please try again.