From 103af6c2868771130143c5baa3b430048dad4e33 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Fri, 25 Jun 2010 10:53:07 +0000
Subject: [PATCH] Fixes an issue with inconsistent Last Change Number in the External Changelog when there are deleted and newly created replication domains

---
 opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java b/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
index 33a097d..e6200f6 100644
--- a/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
+++ b/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
@@ -3467,6 +3467,33 @@
   }
 
   /**
+   * This methods count the changes, server by server :
+   * - from a start time
+   * - to (inclusive) an end point (the provided endCN).
+   * @param startTime The provided start time.
+   * @param endCN The provided end change number.
+   * @return The number of changes between startTime and endCN.
+   */
+  public long getEligibleCount(long startTime, ChangeNumber endCN)
+  {
+    long sidRes = 0;
+    long res = 0;
+
+    // Parses the dbState of the domain , server by server
+    ServerState dbState = this.getDbServerState();
+    Iterator<Integer> serverIDIterator = dbState.iterator();
+    while (serverIDIterator.hasNext())
+    {
+      // process one sid
+      int sid = serverIDIterator.next();
+      ChangeNumber startCN = new ChangeNumber(startTime, 0, sid);
+      sidRes += getCount(sid, startCN, endCN);
+      res+=sidRes;
+    }
+    return res;
+  }
+
+  /**
    * Get the latest (more recent) trim date of the changelog dbs associated
    * to this domain.
    * @return The latest trim date.

--
Gitblit v1.10.0