Modified:
trunk/conf/clustering.properties.defaults
trunk/lib/flaptor-util-trunk.jar
trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java
Log:
added configuration property for enabling/disabling saving and reading
of states
Modified: trunk/conf/clustering.properties.defaults
==============================================================================
--- trunk/conf/clustering.properties.defaults (original)
+++ trunk/conf/clustering.properties.defaults Mon Jul 21 11:49:08 2008
@@ -5,6 +5,7 @@
clustering.monitor.formatter=com.flaptor.clusterfest.monitoring.DefaultPropertyFormatter
clustering.monitor.checker=com.flaptor.clusterfest.monitoring.DefaultChecker
+clustering.monitor.enableSavedStates=true
clustering.monitor.statesDir=states
clustering.monitor.logs.defaults=
clustering.monitor.logs.size=50000
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
Mon Jul 21 11:49:08 2008
@@ -62,7 +62,9 @@
stateFileSerializer = new FileSerializer(new File(statesDir, node.getHost()+"."+node.getPort()+".states"));
- states = (LinkedList<NodeState>)stateFileSerializer.deserialize();
+ if
(Config.getConfig("clustering.properties").getBoolean("clustering.monitor.enableSavedStates")) {
+ states = (LinkedList<NodeState>)stateFileSerializer.deserialize();
+ }
if (states == null) states = new LinkedList<NodeState>();
logs = new HashMap<String, Pair<String,Long>>();
@@ -164,16 +166,19 @@
states.add(state);
cleanupStateList();
- ClusterManager.getMultiExecutor().addExecution(
- new Execution(new Callable(){
- public Object call() throws Exception {
- synchronized (states) {
- stateFileSerializer.serialize(states);
- return null;
- }
- }
- })
- );
+
+ if
(Config.getConfig("clustering.properties").getBoolean("clustering.monitor.enableSavedStates")) {
+ ClusterManager.getMultiExecutor().addExecution(
+ new Execution(new Callable(){
+ public Object call() throws Exception {
+ synchronized (states) {
+ stateFileSerializer.serialize(states);
+ return null;
+ }
+ }
+ })
+ );
+ }
}
}
}