From 3a9e211d36ee94ff99941943b3b51e0f768624f5 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:
---
opends/src/server/org/opends/server/replication/server/ServerHandler.java | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/server/ServerHandler.java b/opends/src/server/org/opends/server/replication/server/ServerHandler.java
index 22adad3..a0ebd0c 100644
--- a/opends/src/server/org/opends/server/replication/server/ServerHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/ServerHandler.java
@@ -244,6 +244,10 @@
*/
private AtomicBoolean shuttingDown = new AtomicBoolean(false);
+ /**
+ * Weight of this remote server.
+ */
+ protected int weight = 1;
/**
* Creates a new server handler instance with the provided socket.
@@ -1215,12 +1219,23 @@
*/
public RSInfo toRSInfo()
{
- RSInfo rsInfo = new RSInfo(serverId, generationId, groupId);
+ RSInfo rsInfo = new RSInfo(serverId, generationId, groupId, weight);
return rsInfo;
}
/**
+ * Starts the monitoring publisher for the domain if not already started.
+ */
+ protected void createMonitoringPublisher()
+ {
+ if (!replicationServerDomain.isRunningMonitoringPublisher())
+ {
+ replicationServerDomain.startMonitoringPublisher();
+ }
+ }
+
+ /**
* Performs any processing periodic processing that may be desired to update
* the information associated with this monitor. Note that best-effort
* attempts will be made to ensure that calls to this method come
--
Gitblit v1.10.0