From 9a72955d0b08a0a1b3116d9eaba993c77c84d8c1 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Mon, 22 Oct 2007 21:47:06 +0000
Subject: [PATCH] Added the ability to retrieve the number of entries in the entire subordinate subtree to the numSubordinates method in the backend API. Changed the replication code to use numSubordinates of the entires subtree to determine how many entries will be exported and imported during initialization.

---
 opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java b/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
index 7327666..608b7d8 100644
--- a/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
+++ b/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
@@ -3020,17 +3020,19 @@
 
       acquireIEContext();
 
+      // The number of entries to be exported is the number of entries under
+      // the base DN entry and the base entry itself.
+      long entryCount = backend.numSubordinates(baseDN, true) + 1;
       ieContext.exportTarget = target;
       if (initTask != null)
       {
         ieContext.initializeTask = initTask;
-        ieContext.initImportExportCounters(backend.getEntryCount());
+        ieContext.initImportExportCounters(entryCount);
       }
 
       // Send start message to the peer
       InitializeTargetMessage initializeMessage = new InitializeTargetMessage(
-          baseDN, serverId, ieContext.exportTarget, requestorID,
-          backend.getEntryCount());
+          baseDN, serverId, ieContext.exportTarget, requestorID, entryCount);
 
       broker.publish(initializeMessage);
 

--
Gitblit v1.10.0