From 4d0faf5b8ad46e978a72d35a8f736f83fb61fd2d Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 30 Mar 2011 19:21:16 +0000
Subject: [PATCH] Fix issue OpenDJ-96: Replication server monitor data computation takes too long / blocks rest of server when another RS is cannot be reached
---
opends/src/server/org/opends/server/replication/server/ReplicationServerHandler.java | 41 +++++++++++++++--------------------------
1 files changed, 15 insertions(+), 26 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/server/ReplicationServerHandler.java b/opends/src/server/org/opends/server/replication/server/ReplicationServerHandler.java
index 8845c13..77fce06 100644
--- a/opends/src/server/org/opends/server/replication/server/ReplicationServerHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/ReplicationServerHandler.java
@@ -30,7 +30,6 @@
import static org.opends.messages.ReplicationMessages.*;
import static org.opends.server.loggers.ErrorLogger.logError;
import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
-import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString;
import java.io.IOException;
import java.util.ArrayList;
@@ -779,35 +778,25 @@
attributes.add(Attributes.create("Replication-Server",
serverURL));
- try
+ MonitorData md = replicationServerDomain.getDomainMonitorData();
+
+ // Missing changes
+ long missingChanges = md.getMissingChangesRS(serverId);
+ attributes.add(Attributes.create("missing-changes",
+ String.valueOf(missingChanges)));
+
+ /* get the Server State */
+ AttributeBuilder builder = new AttributeBuilder("server-state");
+ ServerState state = md.getRSStates(serverId);
+ if (state != null)
{
- MonitorData md;
- md = replicationServerDomain.computeMonitorData(true);
-
- // Missing changes
- long missingChanges = md.getMissingChangesRS(serverId);
- attributes.add(Attributes.create("missing-changes", String
- .valueOf(missingChanges)));
-
- /* get the Server State */
- AttributeBuilder builder = new AttributeBuilder("server-state");
- ServerState state = md.getRSStates(serverId);
- if (state != null)
+ for (String str : state.toStringSet())
{
- for (String str : state.toStringSet())
- {
- builder.add(str);
- }
- attributes.add(builder.toAttribute());
+ builder.add(str);
}
+ attributes.add(builder.toAttribute());
}
- catch (Exception e)
- {
- Message message =
- ERR_ERROR_RETRIEVING_MONITOR_DATA.get(stackTraceToSingleLineString(e));
- // We failed retrieving the monitor data.
- attributes.add(Attributes.create("error", message.toString()));
- }
+
return attributes;
}
/**
--
Gitblit v1.10.0