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 <[email protected]> Authored: Sun Jan 25 22:18:02 2015 +0530 Committer: Lahiru Sandaruwan <[email protected]> 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
