You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ga...@apache.org on 2015/12/07 11:19:35 UTC

[06/50] [abbrv] stratos git commit: Add instance id to log messages in autoscaler ClusterStatusActiveProcessor

Add instance id to log messages in autoscaler ClusterStatusActiveProcessor


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

Branch: refs/heads/release-4.1.5
Commit: 9540eae4ed82f1a354317b19e902da967b00079e
Parents: 706887a
Author: Akila Perera <ra...@gmail.com>
Authored: Mon Nov 30 00:16:32 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Mon Dec 7 10:16:25 2015 +0000

----------------------------------------------------------------------
 .../cluster/ClusterStatusActiveProcessor.java   | 22 ++++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/9540eae4/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java
index a8521d5..8dd9a8e 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java
@@ -53,8 +53,9 @@ public class ClusterStatusActiveProcessor extends ClusterStatusProcessor {
                 // ask the next processor to take care of the message.
                 return nextProcessor.process(type, clusterId, instanceId);
             } else {
-                log.warn(String.format("No possible state change found for [type] %s [cluster] %s " +
-                        "[instance] %s", type, clusterId, instanceId));
+                log.warn(
+                        String.format("No possible state change found for [type] %s, [cluster] %s, [instance] %s", type,
+                                clusterId, instanceId));
             }
         }
         return false;
@@ -64,12 +65,10 @@ public class ClusterStatusActiveProcessor extends ClusterStatusProcessor {
         ClusterMonitor monitor = AutoscalerContext.getInstance().
                 getClusterMonitor(clusterId);
         boolean clusterActive = false;
-        for (NetworkPartitionContext clusterLevelNetworkPartitionContext :
-                monitor.getNetworkPartitionCtxts()) {
+        for (NetworkPartitionContext clusterLevelNetworkPartitionContext : monitor.getNetworkPartitionCtxts()) {
             //minimum check per partition
-            ClusterInstanceContext instanceContext =
-                    (ClusterInstanceContext) clusterLevelNetworkPartitionContext.
-                            getInstanceContext(instanceId);
+            ClusterInstanceContext instanceContext = (ClusterInstanceContext) clusterLevelNetworkPartitionContext.
+                    getInstanceContext(instanceId);
             if (instanceContext != null) {
                 if (instanceContext.getActiveMembers() >= instanceContext.getMinInstanceCount()) {
                     clusterActive = true;
@@ -79,12 +78,13 @@ public class ClusterStatusActiveProcessor extends ClusterStatusProcessor {
         }
         if (clusterActive) {
             if (log.isInfoEnabled()) {
-                log.info("Publishing cluster activated event for [application]: "
-                        + monitor.getAppId() + " [cluster]: " + clusterId);
+                log.info(String.format("Publishing cluster activated event for [application-id] %s, [cluster-id] %s, "
+                        + "[cluster-instance-id] %s", monitor.getAppId(), clusterId, instanceId));
             }
             //TODO service call
-            ClusterStatusEventPublisher.sendClusterActivatedEvent(monitor.getAppId(),
-                    monitor.getServiceId(), monitor.getClusterId(), instanceId);
+            ClusterStatusEventPublisher
+                    .sendClusterActivatedEvent(monitor.getAppId(), monitor.getServiceId(), monitor.getClusterId(),
+                            instanceId);
         }
         return clusterActive;
     }