You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2015/01/25 18:01:36 UTC

[1/2] stratos git commit: Renaming method names for clarity

Repository: stratos
Updated Branches:
  refs/heads/master fcdc4b4e3 -> b6d3262b0


Renaming method names for clarity


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

Branch: refs/heads/master
Commit: 5cb0e143d2e9dea3ee103c5900edf4736fe1a036
Parents: fcdc4b4
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Sun Jan 25 22:18:02 2015 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Sun Jan 25 22:20:14 2015 +0530

----------------------------------------------------------------------
 .../applications/dependency/DependencyBuilder.java      |  6 +++---
 .../applications/dependency/DependencyTree.java         | 12 ++++++------
 .../monitor/component/ParentComponentMonitor.java       |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/5cb0e143/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
index 3964ac2..721e1f5 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
@@ -92,7 +92,7 @@ public class DependencyBuilder {
                             String id = applicationContext.getId();
 
                             ApplicationChildContext existingApplicationContext =
-                                    dependencyTree.findApplicationContextWithIdInPrimaryTree(id);
+                                    dependencyTree.getApplicationChildContextByIdInPrimaryTree(id);
                             if (existingApplicationContext == null) {
                                 if (parentContext != null) {
                                     //appending the start up order to already added parent group/cluster
@@ -150,14 +150,14 @@ public class DependencyBuilder {
         // as they can start in parallel.
         Collection<Group> groups = component.getAliasToGroupMap().values();
         for (Group group1 : groups) {
-            if (dependencyTree.findApplicationContextWithIdInPrimaryTree(group1.getAlias()) == null) {
+            if (dependencyTree.getApplicationChildContextByIdInPrimaryTree(group1.getAlias()) == null) {
                 ApplicationChildContext context = ApplicationChildContextFactory.getGroupChildContext(group1.getAlias(), dependencyTree.isTerminateDependent());
                 dependencyTree.addPrimaryApplicationContext(context);
             }
         }
         Collection<ClusterDataHolder> clusterData = component.getClusterDataMap().values();
         for (ClusterDataHolder dataHolder : clusterData) {
-            if (dependencyTree.findApplicationContextWithIdInPrimaryTree(dataHolder.getClusterId()) == null) {
+            if (dependencyTree.getApplicationChildContextByIdInPrimaryTree(dataHolder.getClusterId()) == null) {
                 ApplicationChildContext context = ApplicationChildContextFactory.getClusterChildContext(dataHolder,
                         dependencyTree.isTerminateDependent());
                 dependencyTree.addPrimaryApplicationContext(context);

http://git-wip-us.apache.org/repos/asf/stratos/blob/5cb0e143/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyTree.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyTree.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyTree.java
index 288a220..fccdd2d 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyTree.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyTree.java
@@ -70,8 +70,8 @@ public class DependencyTree {
      * @param id the alias/id of group/cluster
      * @return ApplicationContext of the given id
      */
-    public ApplicationChildContext findApplicationContextWithIdInPrimaryTree(String id) {
-        return findApplicationContextWithId(id, primaryApplicationContextList);
+    public ApplicationChildContext getApplicationChildContextByIdInPrimaryTree(String id) {
+        return getApplicationChildContextById(id, primaryApplicationContextList);
     }
 
     /**
@@ -81,7 +81,7 @@ public class DependencyTree {
      * @param contexts the list of contexts in the same level of the tree
      * @return ApplicationContext of the given id
      */
-    private ApplicationChildContext findApplicationContextWithId(String id, List<ApplicationChildContext> contexts) {
+    private ApplicationChildContext getApplicationChildContextById(String id, List<ApplicationChildContext> contexts) {
         for (ApplicationChildContext context : contexts) {
             //TODO check for the status
             if (context.getId().equals(id)) {
@@ -90,7 +90,7 @@ public class DependencyTree {
         }
         //if not found in the top level search recursively
         for (ApplicationChildContext context : contexts) {
-            return findApplicationContextWithId(id, context.getApplicationChildContextList());
+            return getApplicationChildContextById(id, context.getApplicationChildContextList());
         }
         return null;
     }
@@ -139,7 +139,7 @@ public class DependencyTree {
     public List<ApplicationChildContext> getStarAbleDependencies(String id) {
         //finding the application context which received the activated event and
         // returning it's immediate children as the dependencies.
-        ApplicationChildContext context = findApplicationContextWithIdInPrimaryTree(id);
+        ApplicationChildContext context = getApplicationChildContextByIdInPrimaryTree(id);
         return context.getApplicationChildContextList();
     }
 
@@ -190,7 +190,7 @@ public class DependencyTree {
      */
     public List<ApplicationChildContext> getTerminationDependencies(String id) {
         List<ApplicationChildContext> allChildrenOfAppContext = new ArrayList<ApplicationChildContext>();
-        ApplicationChildContext applicationContext = findApplicationContextWithIdInPrimaryTree(id);
+        ApplicationChildContext applicationContext = getApplicationChildContextByIdInPrimaryTree(id);
         if (getTerminationBehavior() == TerminationBehavior.TERMINATE_DEPENDENT) {
             //finding the ApplicationContext of the given id
             //finding all the children of the found application context

http://git-wip-us.apache.org/repos/asf/stratos/blob/5cb0e143/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
index fe04671..97934a1 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
@@ -435,7 +435,7 @@ public abstract class ParentComponentMonitor extends Monitor implements Runnable
         boolean allDependentTerminated = false;
 
         ApplicationChildContext context = this.startupDependencyTree.
-                findApplicationContextWithIdInPrimaryTree(eventId);
+                getApplicationChildContextByIdInPrimaryTree(eventId);
         context.setTerminated(true);
         terminationList = this.startupDependencyTree.getTerminationDependencies(eventId);
         //Make sure that all the dependents have been terminated properly to start the recovery


[2/2] stratos git commit: s/notifyParentOnMaxOut/notifyParentOnScalingUpBeyondMax

Posted by la...@apache.org.
s/notifyParentOnMaxOut/notifyParentOnScalingUpBeyondMax


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

Branch: refs/heads/master
Commit: b6d3262b0537862b1e852dccfa6e56abf1949a7d
Parents: 5cb0e14
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Sun Jan 25 22:35:15 2015 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Sun Jan 25 22:35:15 2015 +0530

----------------------------------------------------------------------
 .../stratos/autoscaler/monitor/component/GroupMonitor.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b6d3262b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
index aac802f..7b498fc 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
@@ -148,7 +148,7 @@ public class GroupMonitor extends ParentComponentMonitor {
             createGroupInstanceOnScaling(networkPartitionContext,
                     instanceContext.getParentInstanceId());
         } else {
-            notifyParentOnMaxOut(networkPartitionContext, instanceContext);
+            notifyParentOnScalingUpBeyondMax(networkPartitionContext, instanceContext);
         }
         //Resetting the max events
         instanceContext.setIdToScalingOverMaxEvent(
@@ -257,8 +257,8 @@ public class GroupMonitor extends ParentComponentMonitor {
         }
     }
 
-    private void notifyParentOnMaxOut(NetworkPartitionContext networkPartitionContext,
-                                      InstanceContext instanceContext) {
+    private void notifyParentOnScalingUpBeyondMax(NetworkPartitionContext networkPartitionContext,
+                                                  InstanceContext instanceContext) {
         //has scaling dependents. Should notify the parent
         if (log.isDebugEnabled()) {
             log.debug("This [Group] " + id + " [scale-up] dependencies. " +