stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From saj...@apache.org
Subject [09/11] git commit: executor service instead of thread sleep
Date Mon, 06 Oct 2014 17:22:01 GMT
executor service instead of thread sleep


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

Branch: refs/heads/master
Commit: 39e42308cecdc61b6d936cfd0fddfa138c705ef5
Parents: 909c705
Author: R-Rajkumar <rraju1990@gmail.com>
Authored: Mon Oct 6 11:25:54 2014 +0530
Committer: R-Rajkumar <rraju1990@gmail.com>
Committed: Mon Oct 6 11:25:54 2014 +0530

----------------------------------------------------------------------
 .../monitor/AbstractClusterMonitor.java         | 10 +++----
 .../KubernetesServiceClusterMonitor.java        | 28 ++++++++++----------
 .../autoscaler/monitor/VMLbClusterMonitor.java  | 26 +++++++++---------
 .../monitor/VMServiceClusterMonitor.java        | 26 +++++++++---------
 4 files changed, 45 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/39e42308/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
index e44bd72..3238d46 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
@@ -66,7 +66,7 @@ public abstract class AbstractClusterMonitor implements Runnable {
     private boolean isDestroyed;
 
     private AutoscalerRuleEvaluator autoscalerRuleEvaluator;
-    
+
     private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
 
     protected AbstractClusterMonitor(String clusterId, String serviceId,
@@ -81,13 +81,13 @@ public abstract class AbstractClusterMonitor implements Runnable {
     }
 
     protected abstract void readConfigurations();
-    
+
     public void startScheduler() {
-    	scheduler.scheduleAtFixedRate(this, 0, getMonitorIntervalMilliseconds(), TimeUnit.MILLISECONDS);
+        scheduler.scheduleAtFixedRate(this, 0, getMonitorIntervalMilliseconds(), TimeUnit.MILLISECONDS);
     }
-    
+
     protected void stopScheduler() {
-    	scheduler.shutdownNow();
+        scheduler.shutdownNow();
     }
 
     protected abstract void monitor();

http://git-wip-us.apache.org/repos/asf/stratos/blob/39e42308/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/KubernetesServiceClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/KubernetesServiceClusterMonitor.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/KubernetesServiceClusterMonitor.java
index 93580d9..6e14ce0 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/KubernetesServiceClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/KubernetesServiceClusterMonitor.java
@@ -59,22 +59,22 @@ public final class KubernetesServiceClusterMonitor extends KubernetesClusterMoni
     @Override
     public void run() {
 
-            if (log.isDebugEnabled()) {
-                log.debug("KubernetesServiceClusterMonitor is running.. " + this.toString());
-            }
-            try {
-                if (!ClusterStatus.In_Maintenance.equals(getStatus())) {
-                    monitor();
-                } else {
-                    if (log.isDebugEnabled()) {
-                        log.debug("KubernetesServiceClusterMonitor is suspended as the cluster
is in "
-                                  + ClusterStatus.In_Maintenance + " mode......");
-                    }
+        if (log.isDebugEnabled()) {
+            log.debug("KubernetesServiceClusterMonitor is running.. " + this.toString());
+        }
+        try {
+            if (!ClusterStatus.In_Maintenance.equals(getStatus())) {
+                monitor();
+            } else {
+                if (log.isDebugEnabled()) {
+                    log.debug("KubernetesServiceClusterMonitor is suspended as the cluster
is in "
+                              + ClusterStatus.In_Maintenance + " mode......");
                 }
-            } catch (Exception e) {
-                log.error("KubernetesServiceClusterMonitor : Monitor failed." + this.toString(),
-                          e);
             }
+        } catch (Exception e) {
+            log.error("KubernetesServiceClusterMonitor : Monitor failed." + this.toString(),
+                      e);
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/stratos/blob/39e42308/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMLbClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMLbClusterMonitor.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMLbClusterMonitor.java
index f950f9d..1c27380 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMLbClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMLbClusterMonitor.java
@@ -57,21 +57,21 @@ public class VMLbClusterMonitor extends VMClusterMonitor {
     @Override
     public void run() {
 
-            if (log.isDebugEnabled()) {
-                log.debug("VMLbClusterMonitor is running.. " + this.toString());
-            }
-            try {
-                if (!ClusterStatus.In_Maintenance.equals(getStatus())) {
-                    monitor();
-                } else {
-                    if (log.isDebugEnabled()) {
-                        log.debug("VMLbClusterMonitor is suspended as the cluster is in "
+
-                                  ClusterStatus.In_Maintenance + " mode......");
-                    }
+        if (log.isDebugEnabled()) {
+            log.debug("VMLbClusterMonitor is running.. " + this.toString());
+        }
+        try {
+            if (!ClusterStatus.In_Maintenance.equals(getStatus())) {
+                monitor();
+            } else {
+                if (log.isDebugEnabled()) {
+                    log.debug("VMLbClusterMonitor is suspended as the cluster is in " +
+                              ClusterStatus.In_Maintenance + " mode......");
                 }
-            } catch (Exception e) {
-                log.error("VMLbClusterMonitor : Monitor failed. " + this.toString(), e);
             }
+        } catch (Exception e) {
+            log.error("VMLbClusterMonitor : Monitor failed. " + this.toString(), e);
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/stratos/blob/39e42308/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMServiceClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMServiceClusterMonitor.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMServiceClusterMonitor.java
index d8c9e69..6f9fb26 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMServiceClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMServiceClusterMonitor.java
@@ -67,21 +67,21 @@ public class VMServiceClusterMonitor extends VMClusterMonitor {
         } catch (InterruptedException ignore) {
         }
 
-            if (log.isDebugEnabled()) {
-                log.debug("VMServiceClusterMonitor is running.. " + this.toString());
-            }
-            try {
-                if (!ClusterStatus.In_Maintenance.equals(getStatus())) {
-                    monitor();
-                } else {
-                    if (log.isDebugEnabled()) {
-                        log.debug("VMServiceClusterMonitor is suspended as the cluster is
in " +
-                                  ClusterStatus.In_Maintenance + " mode......");
-                    }
+        if (log.isDebugEnabled()) {
+            log.debug("VMServiceClusterMonitor is running.. " + this.toString());
+        }
+        try {
+            if (!ClusterStatus.In_Maintenance.equals(getStatus())) {
+                monitor();
+            } else {
+                if (log.isDebugEnabled()) {
+                    log.debug("VMServiceClusterMonitor is suspended as the cluster is in
" +
+                              ClusterStatus.In_Maintenance + " mode......");
                 }
-            } catch (Exception e) {
-                log.error("VMServiceClusterMonitor : Monitor failed." + this.toString(),
e);
             }
+        } catch (Exception e) {
+            log.error("VMServiceClusterMonitor : Monitor failed." + this.toString(), e);
+        }
     }
 
     @Override


Mime
View raw message