[clusterfest commit] r231 - in trunk: conf lib src/com/flaptor/clusterfest/monitoring

0 views
Skip to first unread message

codesite...@google.com

unread,
Jul 17, 2008, 6:23:02 PM7/17/08
to clust...@googlegroups.com
Author: martinmassera
Date: Thu Jul 17 15:21:56 2008
New Revision: 231

Modified:
trunk/conf/clustering.properties.defaults
trunk/lib/flaptor-util-trunk.jar
trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java

Log:
log size limited in configuration
catching clusterfest errors as ERROR

Modified: trunk/conf/clustering.properties.defaults
==============================================================================
--- trunk/conf/clustering.properties.defaults (original)
+++ trunk/conf/clustering.properties.defaults Thu Jul 17 15:21:56 2008
@@ -7,6 +7,7 @@

clustering.monitor.statesDir=states
clustering.monitor.logs.defaults=
+clustering.monitor.logs.size=50000

clustering.web.login.enabled=false
clustering.web.login.user=clusteruser

Modified: trunk/lib/flaptor-util-trunk.jar
==============================================================================
Binary files. No diff available.

Modified: trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java
==============================================================================
---
trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java (original)
+++
trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java
Thu Jul 17 15:21:56 2008
@@ -33,7 +33,9 @@
import com.flaptor.clusterfest.exceptions.NodeException;
import com.flaptor.clusterfest.exceptions.NodeUnreachableException;
import com.flaptor.clusterfest.monitoring.node.Monitoreable;
+import com.flaptor.util.Config;
import com.flaptor.util.DateUtil;
+import com.flaptor.util.Execute;
import com.flaptor.util.Execution;
import com.flaptor.util.FileSerializer;
import com.flaptor.util.Pair;
@@ -51,6 +53,7 @@
private Map<String, Pair<String, Long>> logs;
private NodeChecker checker;
private Monitoreable monitoreable;
+ private int logSize;

FileSerializer stateFileSerializer;

@@ -63,9 +66,10 @@
states = (LinkedList<NodeState>)stateFileSerializer.deserialize();
if (states == null) states = new LinkedList<NodeState>();

- this.logs = new HashMap<String, Pair<String,Long>>();
- this.monitoreable = MonitorModule.getModuleListener(node.getXmlrpcClient());
+ logs = new HashMap<String, Pair<String,Long>>();
+ monitoreable = MonitorModule.getModuleListener(node.getXmlrpcClient());

+ logSize = Config.getConfig("clustering.properties").getInt("clustering.monitor.logs.size");
addLogs(logNames);
}

@@ -126,7 +130,7 @@
*/
public void updateLog(String logName) throws NodeException {
try {
- String log = monitoreable.getLog(logName, 512*1024);
//retrieve only 500k
+ String log = monitoreable.getLog(logName, logSize);
getNodeDescriptor().setReachable(true);
logs.put(logName, new Pair<String, Long>(log, System.currentTimeMillis()));
} catch (Throwable t) {
@@ -139,9 +143,13 @@

NodeState state = null;
try {
- state = retrieveCurrentState();
- state.updateSanity(checker, this);
- updateLogs();
+ Map<String, Object> properties = retrieveProperties();
+ SystemProperties systemProperties = retrieveSystemProperties();
+
+ state = new NodeState(properties, systemProperties);
+ state.updateSanity(checker, this);
+
+ updateLogs();
} catch (NodeUnreachableException e) {
state = NodeState.createUnreachableState();
throw e;
@@ -149,7 +157,10 @@
logger.error("remote code exception", e.getCause());
state = NodeState.createErrorState(e.getCause());
throw e;
- } finally {
+ } catch (Throwable t) {
+ logger.error("unexpected throwable",t);
+ state = NodeState.createErrorState(t);
+ } finally {
synchronized (states) {
states.add(state);

@@ -208,10 +219,6 @@

}

- private NodeState retrieveCurrentState() throws NodeException {
- return new NodeState(retrieveProperties(), retrieveSystemProperties());
- }
-
private Map<String, Object> retrieveProperties() throws
NodeException {
try {
Map<String, Object> properties = monitoreable.getProperties();

Reply all
Reply to author
Forward
0 new messages