From 6b3ef14a652f6be0d559365d2fd2c78a61524fec Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 17 Sep 2010 22:06:25 +0000
Subject: [PATCH] Minimize Historical Data (dsreplication/client side). The purge historical can be executed on the local server even when it is stopped. This is matches the functionality provided by utilities such import-ldif, backup, etc.

---
 opends/src/server/org/opends/server/tasks/PurgeConflictsHistoricalTask.java |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/opends/src/server/org/opends/server/tasks/PurgeConflictsHistoricalTask.java b/opends/src/server/org/opends/server/tasks/PurgeConflictsHistoricalTask.java
index f2cb1f0..b45a9e0 100644
--- a/opends/src/server/org/opends/server/tasks/PurgeConflictsHistoricalTask.java
+++ b/opends/src/server/org/opends/server/tasks/PurgeConflictsHistoricalTask.java
@@ -62,6 +62,11 @@
 public class PurgeConflictsHistoricalTask extends Task
 {
   /**
+   * The default value for the maximum duration of the purge expressed in
+   * seconds.
+   */
+  public static final int DEFAULT_MAX_DURATION = 60 * 60;
+  /**
    * The tracer object for the debug logger.
    */
   private static final DebugTracer TRACER = getTracer();
@@ -69,14 +74,6 @@
   private String  domainString = null;
   private LDAPReplicationDomain domain = null;
 
-  // The last changeNumber purged : help the user to know how well the purge
-  // processing has done its job.
-  // We want to help the user know:
-  // - the task has started at dateX time, will end at dateY max
-  //   and is currently purging dateZ
-  long currentCNPurgedDate = 0;
-  long taskMaxEndDate = 0;
-
   /**
    *                 current historical purge delay
    *                <--------------------------------->
@@ -95,7 +92,7 @@
    *
    */
 
-  long purgeTaskMaxDurationInSec = 3600; // Default:1h
+  private int purgeTaskMaxDurationInSec = DEFAULT_MAX_DURATION;
 
   TaskState initState;
 
@@ -112,6 +109,7 @@
   /**
    * {@inheritDoc}
    */
+  @Override
   public Message getDisplayName() {
     return TaskMessages.INFO_TASK_PURGE_CONFLICTS_HIST_NAME.get();
   }
@@ -162,7 +160,7 @@
     {
       try
       {
-        purgeTaskMaxDurationInSec = Long.decode(maxDurationStringInSec);
+        purgeTaskMaxDurationInSec = Integer.decode(maxDurationStringInSec);
       }
       catch(Exception e)
       {
@@ -177,6 +175,7 @@
   /**
    * {@inheritDoc}
    */
+  @Override
   protected TaskState runTask()
   {
     Boolean purgeCompletedInTime = false;

--
Gitblit v1.10.0