You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ud...@apache.org on 2013/12/23 10:51:42 UTC

[1/3] git commit: refactor eventName in HealthEventMessageDelegator

Updated Branches:
  refs/heads/master bbbe3a032 -> c367a8f01


refactor eventName in HealthEventMessageDelegator


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

Branch: refs/heads/master
Commit: 345bd78d12360665756a1e775726e0bcc75001fd
Parents: a189459
Author: Udara Liyanage <ud...@wso2.com>
Authored: Mon Dec 23 04:48:10 2013 -0500
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Mon Dec 23 04:48:10 2013 -0500

----------------------------------------------------------------------
 .../health/HealthEventMessageDelegator.java     | 41 ++++++++++----------
 1 file changed, 21 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/345bd78d/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/HealthEventMessageDelegator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/HealthEventMessageDelegator.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/HealthEventMessageDelegator.java
index c361c7b..6fbc4e4 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/HealthEventMessageDelegator.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/HealthEventMessageDelegator.java
@@ -66,51 +66,52 @@ public class HealthEventMessageDelegator implements Runnable {
                     log.debug("Health event message received: [message] " + messageText);
 
                 Event event = jsonToEvent(messageText);
+                String eventName = event.getEventName();
 
                 if (log.isInfoEnabled()) {
-                    log.info(String.format("Received event: [event-name] %s", event.getEventName()));
+                    log.info(String.format("Received event: [event-name] %s", eventName));
                 }
 
-                if (Constants.AVERAGE_REQUESTS_IN_FLIGHT.equals(event.getEventName())) {
+                if (Constants.AVERAGE_REQUESTS_IN_FLIGHT.equals(eventName)) {
                     String clusterId = event.getProperties().get("cluster_id");
                     String networkPartitionId = event.getProperties().get("network_partition_id");
                     String value = event.getProperties().get("value");
                     Float floatValue = Float.parseFloat(value);
 
                     if (log.isDebugEnabled()) {
-                        log.debug(String.format("%s event: [cluster] %s [network-partition] %s [value] %s", event.getEventName(), clusterId, networkPartitionId, value));
+                        log.debug(String.format("%s event: [cluster] %s [network-partition] %s [value] %s", eventName, clusterId, networkPartitionId, value));
                     }
 
                     AutoscalerContext.getInstance().getMonitor(clusterId).getNetworkPartitionCtxt(networkPartitionId)
                             .setAverageRequestsInFlight(floatValue);
 
-                } else if (Constants.GRADIENT_OF_REQUESTS_IN_FLIGHT.equals(event.getEventName())) {
+                } else if (Constants.GRADIENT_OF_REQUESTS_IN_FLIGHT.equals(eventName)) {
                     String clusterId = event.getProperties().get("cluster_id");
                     String networkPartitionId = event.getProperties().get("network_partition_id");
                     String value = event.getProperties().get("value");
                     Float floatValue = Float.parseFloat(value);
 
                     if (log.isDebugEnabled()) {
-                        log.debug(String.format("%s event: [cluster] %s [network-partition] %s [value] %s", event.getEventName(), clusterId, networkPartitionId, value));
+                        log.debug(String.format("%s event: [cluster] %s [network-partition] %s [value] %s", eventName, clusterId, networkPartitionId, value));
                     }
 
                     AutoscalerContext.getInstance().getMonitor(clusterId).getNetworkPartitionCtxt(networkPartitionId)
                             .setRequestsInFlightGradient(floatValue);
 
-                } else if (Constants.SECOND_DERIVATIVE_OF_REQUESTS_IN_FLIGHT.equals(event.getEventName())) {
+                } else if (Constants.SECOND_DERIVATIVE_OF_REQUESTS_IN_FLIGHT.equals(eventName)) {
                     String clusterId = event.getProperties().get("cluster_id");
                     String networkPartitionId = event.getProperties().get("network_partition_id");
                     String value = event.getProperties().get("value");
                     Float floatValue = Float.parseFloat(value);
 
                     if (log.isDebugEnabled()) {
-                        log.debug(String.format("%s event: [cluster] %s [network-partition] %s [value] %s", event.getEventName(), clusterId, networkPartitionId, value));
+                        log.debug(String.format("%s event: [cluster] %s [network-partition] %s [value] %s", eventName, clusterId, networkPartitionId, value));
                     }
 
                     AutoscalerContext.getInstance().getMonitor(clusterId).getNetworkPartitionCtxt(networkPartitionId)
                             .setRequestsInFlightSecondDerivative(floatValue);
 
-                } else if (Constants.MEMBER_FAULT_EVENT_NAME.equals(event.getEventName())) {
+                } else if (Constants.MEMBER_FAULT_EVENT_NAME.equals(eventName)) {
                     String clusterId = event.getProperties().get("cluster_id");
                     String memberId = event.getProperties().get("member_id");
 
@@ -121,7 +122,7 @@ public class HealthEventMessageDelegator implements Runnable {
                     } else {
                         handleMemberFaultEvent(clusterId, memberId);
                     }
-                } else if(Constants.MEMBER_AVERAGE_LOAD_AVERAGE.equals(event.getEventName())) {
+                } else if(Constants.MEMBER_AVERAGE_LOAD_AVERAGE.equals(eventName)) {
                     LoadAverage loadAverage = findLoadAverage(event);
                     if(loadAverage != null) {
                         String value = event.getProperties().get("value");
@@ -132,7 +133,7 @@ public class HealthEventMessageDelegator implements Runnable {
                             log.debug(String.format("%s event: [member] %s [value] %s", event, event.getProperties().get("member_id"), value));
                         }
                     }
-                } else if(Constants.MEMBER_SECOND_DERIVATIVE_OF_LOAD_AVERAGE.equals(event.getEventName())) {
+                } else if(Constants.MEMBER_SECOND_DERIVATIVE_OF_LOAD_AVERAGE.equals(eventName)) {
                     LoadAverage loadAverage = findLoadAverage(event);
                     if(loadAverage != null) {
                         String value = event.getProperties().get("value");
@@ -143,7 +144,7 @@ public class HealthEventMessageDelegator implements Runnable {
                             log.debug(String.format("%s event: [member] %s [value] %s", event, event.getProperties().get("member_id"), value));
                         }
                     }
-                } else if(Constants.MEMBER_GRADIENT_LOAD_AVERAGE.equals(event.getEventName())) {
+                } else if(Constants.MEMBER_GRADIENT_LOAD_AVERAGE.equals(eventName)) {
                     LoadAverage loadAverage = findLoadAverage(event);
                     if(loadAverage != null) {
                         String value = event.getProperties().get("value");
@@ -154,7 +155,7 @@ public class HealthEventMessageDelegator implements Runnable {
                             log.debug(String.format("%s event: [member] %s [value] %s", event, event.getProperties().get("member_id"), value));
                         }
                     }
-                } else if(Constants.MEMBER_AVERAGE_MEMORY_CONSUMPTION.equals(event.getEventName())) {
+                } else if(Constants.MEMBER_AVERAGE_MEMORY_CONSUMPTION.equals(eventName)) {
                     MemoryConsumption memoryConsumption = findMemoryConsumption(event);
                     if(memoryConsumption != null) {
                         String value = event.getProperties().get("value");
@@ -165,7 +166,7 @@ public class HealthEventMessageDelegator implements Runnable {
                             log.debug(String.format("%s event: [member] %s [value] %s", event, event.getProperties().get("member_id"), value));
                         }
                     }
-                } else if(Constants.MEMBER_SECOND_DERIVATIVE_OF_MEMORY_CONSUMPTION.equals(event.getEventName())) {
+                } else if(Constants.MEMBER_SECOND_DERIVATIVE_OF_MEMORY_CONSUMPTION.equals(eventName)) {
                     MemoryConsumption memoryConsumption = findMemoryConsumption(event);
                     if(memoryConsumption != null) {
                         String value = event.getProperties().get("value");
@@ -176,7 +177,7 @@ public class HealthEventMessageDelegator implements Runnable {
                             log.debug(String.format("%s event: [member] %s [value] %s", event, event.getProperties().get("member_id"), value));
                         }
                     }
-                } else if(Constants.MEMBER_GRADIENT_MEMORY_CONSUMPTION.equals(event.getEventName())) {
+                } else if(Constants.MEMBER_GRADIENT_MEMORY_CONSUMPTION.equals(eventName)) {
                     MemoryConsumption memoryConsumption = findMemoryConsumption(event);
                     if(memoryConsumption != null) {
                         String value = event.getProperties().get("value");
@@ -188,17 +189,17 @@ public class HealthEventMessageDelegator implements Runnable {
                         }
                     }
 
-                } else if(Constants.AVERAGE_LOAD_AVERAGE.equals(event.getEventName())) {
+                } else if(Constants.AVERAGE_LOAD_AVERAGE.equals(eventName)) {
                     //do nothing for network partition wise events yet
-                } else if(Constants.SECOND_DERIVATIVE_OF_LOAD_AVERAGE.equals(event.getEventName())) {
+                } else if(Constants.SECOND_DERIVATIVE_OF_LOAD_AVERAGE.equals(eventName)) {
                      //do nothing for network partition wise events yet
-                } else if(Constants.GRADIENT_LOAD_AVERAGE.equals(event.getEventName())) {
+                } else if(Constants.GRADIENT_LOAD_AVERAGE.equals(eventName)) {
                      //do nothing for network partition wise events yet
-                } else if(Constants.AVERAGE_MEMORY_CONSUMPTION.equals(event.getEventName())) {
+                } else if(Constants.AVERAGE_MEMORY_CONSUMPTION.equals(eventName)) {
                      //do nothing for network partition wise events yet
-                } else if(Constants.SECOND_DERIVATIVE_OF_MEMORY_CONSUMPTION.equals(event.getEventName())) {
+                } else if(Constants.SECOND_DERIVATIVE_OF_MEMORY_CONSUMPTION.equals(eventName)) {
                      //do nothing for network partition wise events yet
-                } else if(Constants.GRADIENT_MEMORY_CONSUMPTION.equals(event.getEventName())) {
+                } else if(Constants.GRADIENT_MEMORY_CONSUMPTION.equals(eventName)) {
                      //do nothing for network partition wise events yet
                 }
             } catch (Exception e) {


[3/3] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos

Posted by ud...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos


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

Branch: refs/heads/master
Commit: c367a8f013db06165eb52f34f54aa95503c2a2c3
Parents: 3700934 bbbe3a0
Author: Udara Liyanage <ud...@wso2.com>
Authored: Mon Dec 23 04:51:08 2013 -0500
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Mon Dec 23 04:51:08 2013 -0500

----------------------------------------------------------------------
 .../internal/AutoscalerServerComponent.java     |   2 +-
 .../topology/AutoscalerTopologyReceiver.java    | 315 +++++++++----------
 2 files changed, 142 insertions(+), 175 deletions(-)
----------------------------------------------------------------------



[2/3] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos

Posted by ud...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos


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

Branch: refs/heads/master
Commit: 370093460702b5ea6d228f593bb2f50258c43151
Parents: 345bd78 aa539db
Author: Udara Liyanage <ud...@wso2.com>
Authored: Mon Dec 23 04:50:34 2013 -0500
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Mon Dec 23 04:50:34 2013 -0500

----------------------------------------------------------------------
 .../topology/AutoscalerTopologyReceiver.java    | 401 +++++++++++++++++++
 .../topology/AutoscalerTopologyReceiver.java    | 401 -------------------
 2 files changed, 401 insertions(+), 401 deletions(-)
----------------------------------------------------------------------