From b1ab1b61b2a5cb4a09cd2e727e05f42feb8ca669 Mon Sep 17 00:00:00 2001
From: mrossign <mrossign@localhost>
Date: Fri, 06 Nov 2009 09:11:40 +0000
Subject: [PATCH] In order to support a more clever algorithm for the DS to choose his RS,  we introduce:

---
 opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java |   57 +--------------------------------------------------------
 1 files changed, 1 insertions(+), 56 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java b/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
index 992fe7c..1f8a7e1 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
@@ -65,7 +65,6 @@
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.SortedMap;
 import java.util.TreeMap;
@@ -79,7 +78,6 @@
 import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.replication.common.AssuredMode;
 import org.opends.server.replication.common.ChangeNumber;
-import org.opends.server.replication.common.MutableBoolean;
 import org.opends.server.replication.common.ServerState;
 import org.opends.server.replication.common.ServerStatus;
 import org.opends.server.replication.common.StatusMachine;
@@ -92,8 +90,6 @@
 import org.opends.server.replication.protocol.HeartbeatMsg;
 import org.opends.server.replication.protocol.InitializeRequestMsg;
 import org.opends.server.replication.protocol.InitializeTargetMsg;
-import org.opends.server.replication.protocol.MonitorMsg;
-import org.opends.server.replication.protocol.MonitorRequestMsg;
 import org.opends.server.replication.protocol.ProtocolSession;
 import org.opends.server.replication.protocol.ProtocolVersion;
 import org.opends.server.replication.protocol.ReplicationMsg;
@@ -306,20 +302,6 @@
    */
   private final ChangeNumberGenerator generator;
 
-  /**
-   * This object is used as a conditional event to be notified about
-   * the reception of monitor information from the Replication Server.
-   */
-  private final MutableBoolean monitorResponse = new MutableBoolean(false);
-
-
-  /**
-   * A Map containing of the ServerStates of all the replicas in the topology
-   * as seen by the ReplicationServer the last time it was polled.
-   */
-  private HashMap<Integer, ServerState> replicaStates =
-    new HashMap<Integer, ServerState>();
-
   Set<String> cfgEclIncludes = new HashSet<String>();
   Set<String>    eClIncludes = new HashSet<String>();
 
@@ -586,24 +568,7 @@
    */
   public Map<Integer, ServerState> getReplicaStates()
   {
-    monitorResponse.set(false);
-
-    // publish Monitor Request Message to the Replication Server
-    broker.publish(new MonitorRequestMsg(serverID, broker.getRsServerId()));
-
-    // wait for Response up to 10 seconds.
-    try
-    {
-      synchronized (monitorResponse)
-      {
-        if (monitorResponse.get() == false)
-        {
-          monitorResponse.wait(10000);
-        }
-      }
-    } catch (InterruptedException e)
-    {}
-    return replicaStates;
+    return broker.getReplicaStates();
   }
 
   /**
@@ -834,26 +799,6 @@
           update = (UpdateMsg) msg;
           generator.adjust(update.getChangeNumber());
         }
-        else if (msg instanceof MonitorMsg)
-        {
-          // This is the response to a MonitorRequest that was sent earlier
-          // build the replicaStates Map.
-          replicaStates = new HashMap<Integer, ServerState>();
-          MonitorMsg monitorMsg = (MonitorMsg) msg;
-          Iterator<Integer> it = monitorMsg.ldapIterator();
-          while (it.hasNext())
-          {
-            int serverId = it.next();
-            replicaStates.put(
-                serverId, monitorMsg.getLDAPServerState(serverId));
-          }
-          // Notify the sender that the response was received.
-          synchronized (monitorResponse)
-          {
-            monitorResponse.set(true);
-            monitorResponse.notify();
-          }
-        }
       }
       catch (SocketTimeoutException e)
       {

--
Gitblit v1.10.0