Delay normal cluster monitor min check until lb cluster get added (if there is)


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/e0b6e47a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/e0b6e47a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/e0b6e47a

Branch: refs/heads/master
Commit: e0b6e47aab8c89f9efa4039d9d29a51a7af83c3f
Parents: 8c7623a
Author: Lahiru Sandaruwan <[email protected]>
Authored: Sun Jan 19 23:16:10 2014 +0530
Committer: Lahiru Sandaruwan <[email protected]>
Committed: Sun Jan 19 23:16:10 2014 +0530

----------------------------------------------------------------------
 .../apache/stratos/autoscaler/algorithm/OneAfterAnother.java   | 2 +-
 .../org/apache/stratos/autoscaler/monitor/ClusterMonitor.java  | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e0b6e47a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/algorithm/OneAfterAnother.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/algorithm/OneAfterAnother.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/algorithm/OneAfterAnother.java
index 75404c0..5c094d4 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/algorithm/OneAfterAnother.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/algorithm/OneAfterAnother.java
@@ -48,7 +48,7 @@ public class OneAfterAnother implements AutoscaleAlgorithm {
 
         try {
             if (log.isDebugEnabled())
-                log.debug(String.format("Searching for a partition to up down 
[network partition] %s",
+                log.debug(String.format("Searching for a partition to up 
[network partition] %s",
                         networkPartitionContext.getId()))  ;
             int currentPartitionIndex = 
networkPartitionContext.getCurrentPartitionIndex();
             List<?> partitions = 
Arrays.asList(networkPartitionContext.getPartitions());

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e0b6e47a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/ClusterMonitor.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/ClusterMonitor.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/ClusterMonitor.java
index e76233b..6c44e4e 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/ClusterMonitor.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/ClusterMonitor.java
@@ -58,6 +58,12 @@ public class ClusterMonitor extends AbstractMonitor{
     @Override
     public void run() {
 
+        try {
+            // TODO make this configurable,
+            // this is the delay the min check of normal cluster monitor to 
wait until LB monitor is added
+            Thread.sleep(60000);
+        } catch (InterruptedException ignore) {
+        }
         while (!isDestroyed()) {
             if (log.isDebugEnabled()) {
                 log.debug("Cluster monitor is running.. "+this.toString());

Reply via email to