| diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/grouping/dependency/DependencyTree.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/grouping/dependency/DependencyTree.java |
| index d3dded3..156f3a5 100644 |
| --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/grouping/dependency/DependencyTree.java |
| +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/grouping/dependency/DependencyTree.java |
| @@ -46,6 +46,10 @@ public class DependencyTree { |
| |
| private boolean killDependent; |
| |
| + private boolean startupOder; |
| + |
| + private boolean reverseStartupOrder; |
| + |
| private String id; |
| |
| public DependencyTree(String id) { |
| @@ -88,7 +92,7 @@ public class DependencyTree { |
| */ |
| private ApplicationContext findApplicationContextWithId(String id, List<ApplicationContext> contexts) { |
| for (ApplicationContext context : contexts) { |
| - if (context.getId().equals(id)) { |
| + if (context.getId().equals(id) && context.getCurrentStatus() == null) { |
| return context; |
| } |
| } |
| @@ -130,23 +134,23 @@ public class DependencyTree { |
| * @param id the alias/id of group/cluster in which terminated event received |
| * @return all the kill able children dependencies |
| */ |
| - public List<ApplicationContext> getKillDependencies(String id) { |
| + public List<ApplicationContext> getTerminationDependencies(String id) { |
| List<ApplicationContext> allChildrenOfAppContext = new ArrayList<ApplicationContext>(); |
| + ApplicationContext applicationContext = findApplicationContextWithId(id); |
| |
| - if (killDependent) { |
| + if (this.killDependent) { |
| //finding the ApplicationContext of the given id |
| - ApplicationContext applicationContext = findApplicationContextWithId(id); |
| //finding all the children of the found application context |
| - findAllChildrenOfAppContext(applicationContext.getApplicationContextList(), |
| - allChildrenOfAppContext); |
| - return allChildrenOfAppContext; |
| - } else if (killAll) { |
| + findAllChildrenOfAppContext(applicationContext.getApplicationContextList(), |
| + allChildrenOfAppContext); |
| + return allChildrenOfAppContext; |
| + } else if (this.killAll) { |
| //killall will be killed by the monitor from it's list. |
| findAllChildrenOfAppContext(this.applicationContextList, |
| allChildrenOfAppContext); |
| |
| } |
| - //return empty for the kill-none case |
| + //return empty for the kill-none case, what ever returns here will be killed in |
| return allChildrenOfAppContext; |
| } |
| |
| @@ -221,4 +225,20 @@ public class DependencyTree { |
| public void setId(String id) { |
| this.id = id; |
| } |
| + |
| + public boolean isStartupOder() { |
| + return startupOder; |
| + } |
| + |
| + public void setStartupOder(boolean startupOder) { |
| + this.startupOder = startupOder; |
| + } |
| + |
| + public boolean isReverseStartupOrder() { |
| + return reverseStartupOrder; |
| + } |
| + |
| + public void setReverseStartupOrder(boolean reverseStartupOrder) { |
| + this.reverseStartupOrder = reverseStartupOrder; |
| + } |
| } |
| diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/grouping/dependency/context/ApplicationContext.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/grouping/dependency/context/ApplicationContext.java |
| index f923bb0..5b98264 100644 |
| --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/grouping/dependency/context/ApplicationContext.java |
| +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/grouping/dependency/context/ApplicationContext.java |
| @@ -22,6 +22,7 @@ import org.apache.stratos.messaging.domain.topology.Status; |
| |
| import java.util.ArrayList; |
| import java.util.List; |
| +import java.util.Stack; |
| |
| /** |
| * This is to keep track of the |
| @@ -35,13 +36,13 @@ public abstract class ApplicationContext { |
| |
| private Status status; |
| |
| - private List<Status> statusLifeCycle; |
| + private Stack<Status> statusLifeCycle; |
| |
| protected boolean killDependent; |
| |
| public ApplicationContext(String id, boolean killDependent) { |
| applicationContextList = new ArrayList<ApplicationContext>(); |
| - statusLifeCycle = new ArrayList<Status>(); |
| + statusLifeCycle = new Stack<Status>(); |
| this.killDependent = killDependent; |
| this.id = id; |
| } |
| @@ -60,7 +61,7 @@ public abstract class ApplicationContext { |
| } |
| |
| public void addStatusToLIfeCycle(Status status) { |
| - this.statusLifeCycle.add(status); |
| + this.statusLifeCycle.push(status); |
| } |
| |
| public String getId() { |
| @@ -71,11 +72,11 @@ public abstract class ApplicationContext { |
| this.id = id; |
| } |
| |
| - public Status getStatus() { |
| + public Status getCurrentStatus() { |
| return status; |
| } |
| |
| - public void setStatus(Status status) { |
| + public void setCurrentStatus(Status status) { |
| this.status = status; |
| } |
| |
| @@ -83,7 +84,15 @@ public abstract class ApplicationContext { |
| return statusLifeCycle; |
| } |
| |
| - public void setStatusLifeCycle(List<Status> statusLifeCycle) { |
| - this.statusLifeCycle = statusLifeCycle; |
| + public boolean hasChild() { |
| + boolean hasChild; |
| + if(this.applicationContextList.isEmpty()) { |
| + hasChild = false; |
| + } else { |
| + hasChild = true; |
| + } |
| + return hasChild; |
| } |
| + |
| + |
| } |
| diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java |
| index 801af0e..c19c2a0 100644 |
| --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java |
| +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java |
| @@ -430,6 +430,7 @@ public class AutoscalerTopologyEventReceiver implements Runnable { |
| String memberId = memberTerminatedEvent.getMemberId(); |
| partitionContext.removeMemberStatsContext(memberId); |
| |
| + |
| if (partitionContext.removeTerminationPendingMember(memberId)) { |
| if (log.isDebugEnabled()) { |
| log.debug(String.format("Member is removed from termination pending " + |
| @@ -452,6 +453,9 @@ public class AutoscalerTopologyEventReceiver implements Runnable { |
| log.info(String.format("Member stat context has been removed " + |
| " successfully: [member] %s", memberId)); |
| } |
| + //Checking whether the cluster state can be changed either from in_active to created/terminating to terminated |
| + StatusChecker.getInstance().onMemberTermination(clusterId); |
| + |
| // partitionContext.decrementCurrentActiveMemberCount(1); |
| |
| |
| diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/Monitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/Monitor.java |
| index 4f501d2..aeb0e28 100644 |
| --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/Monitor.java |
| +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/Monitor.java |
| @@ -120,6 +120,7 @@ public abstract class Monitor implements EventHandler { |
| } |
| if (context instanceof GroupContext) { |
| startGroupMonitor(this, context.getId()); |
| + //context.setCurrentStatus(Status.Created); |
| } else if (context instanceof ClusterContext) { |
| String clusterId = context.getId(); |
| String serviceName = null; |
| @@ -144,6 +145,7 @@ public abstract class Monitor implements EventHandler { |
| log.debug("Dependency check starting the [cluster]" + clusterId); |
| } |
| startClusterMonitor(this, cluster); |
| + //context.setCurrentStatus(Status.Created); |
| } else { |
| String msg = "[Cluster] " + clusterId + " cannot be found in the " + |
| "Topology for [service] " + serviceName; |
| @@ -372,9 +374,10 @@ public abstract class Monitor implements EventHandler { |
| try { |
| if (log.isDebugEnabled()) { |
| log.debug("Group monitor is going to be started for [group] " |
| - + groupId); |
| + + groupId ); |
| } |
| monitor = AutoscalerUtil.getGroupMonitor(groupId, appId); |
| + //setting the parent monitor |
| monitor.setParent(parent); |
| //setting the status of cluster monitor w.r.t Topology cluster |
| //if(group.getStatus() != Status.Created && |
| diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java |
| index 5b6598a..5eab977 100644 |
| --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java |
| +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java |
| @@ -29,7 +29,6 @@ import org.apache.stratos.autoscaler.monitor.events.MonitorStatusEvent; |
| import org.apache.stratos.autoscaler.monitor.group.GroupMonitor; |
| import org.apache.stratos.autoscaler.status.checker.StatusChecker; |
| import org.apache.stratos.messaging.domain.topology.Application; |
| -import org.apache.stratos.messaging.domain.topology.ParentComponent; |
| import org.apache.stratos.messaging.domain.topology.Status; |
| |
| import java.util.ArrayList; |
| @@ -63,7 +62,7 @@ public class ApplicationMonitor extends Monitor { |
| for (AbstractClusterMonitor monitor : this.clusterIdToClusterMonitorsMap.values()) { |
| clusters.add(monitor.getClusterId()); |
| } |
| - //TODO rest |
| + //TODO restart |
| return clusters; |
| |
| } |
| @@ -261,7 +260,7 @@ public class ApplicationMonitor extends Monitor { |
| |
| } |
| //updating the life cycle and current status |
| - context.setStatus(statusEvent.getStatus()); |
| + context.setCurrentStatus(statusEvent.getStatus()); |
| context.addStatusToLIfeCycle(statusEvent.getStatus()); |
| if(!startDep) { |
| //Checking in the children whether all are active, |
| diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java |
| index 0bdad16..0aa89fa 100644 |
| --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java |
| +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java |
| @@ -23,16 +23,21 @@ import org.apache.commons.logging.LogFactory; |
| import org.apache.stratos.autoscaler.exception.DependencyBuilderException; |
| import org.apache.stratos.autoscaler.exception.TopologyInConsistentException; |
| import org.apache.stratos.autoscaler.grouping.dependency.context.ApplicationContext; |
| +import org.apache.stratos.autoscaler.grouping.dependency.context.ClusterContext; |
| +import org.apache.stratos.autoscaler.grouping.dependency.context.GroupContext; |
| +import org.apache.stratos.autoscaler.grouping.topic.StatusEventPublisher; |
| +import org.apache.stratos.autoscaler.monitor.AbstractClusterMonitor; |
| import org.apache.stratos.autoscaler.monitor.EventHandler; |
| import org.apache.stratos.autoscaler.monitor.Monitor; |
| import org.apache.stratos.autoscaler.monitor.MonitorStatusEventBuilder; |
| -import org.apache.stratos.autoscaler.monitor.events.ClusterStatusEvent; |
| -import org.apache.stratos.autoscaler.monitor.events.GroupStatusEvent; |
| import org.apache.stratos.autoscaler.monitor.events.MonitorStatusEvent; |
| import org.apache.stratos.autoscaler.status.checker.StatusChecker; |
| +import org.apache.stratos.messaging.domain.topology.Application; |
| import org.apache.stratos.messaging.domain.topology.Group; |
| import org.apache.stratos.messaging.domain.topology.Status; |
| -import org.apache.stratos.messaging.event.application.status.StatusEvent; |
| + |
| +import java.util.ArrayList; |
| +import java.util.List; |
| |
| /** |
| * This is GroupMonitor to monitor the group which consists of |
| @@ -43,9 +48,6 @@ public class GroupMonitor extends Monitor implements EventHandler { |
| |
| //Parent monitor of this monitor |
| private Monitor parent; |
| - //Application id of this particular monitor |
| - protected String appId; |
| - |
| |
| /** |
| * Constructor of GroupMonitor |
| @@ -53,7 +55,7 @@ public class GroupMonitor extends Monitor implements EventHandler { |
| * @throws DependencyBuilderException throws when couldn't build the Topology |
| * @throws TopologyInConsistentException throws when topology is inconsistent |
| */ |
| - public GroupMonitor(Group group) throws DependencyBuilderException, |
| + public GroupMonitor(Group group, String appId) throws DependencyBuilderException, |
| TopologyInConsistentException { |
| super(group); |
| startDependency(); |
| @@ -79,32 +81,86 @@ public class GroupMonitor extends Monitor implements EventHandler { |
| @Override |
| protected void monitor(MonitorStatusEvent statusEvent) { |
| String id = statusEvent.getId(); |
| - ApplicationContext context = this.dependencyTree. |
| - findApplicationContextWithId(id); |
| - if(context.getStatusLifeCycle().isEmpty()) { |
| - try { |
| - //if life cycle is empty, need to start the monitor |
| - boolean startDep = startDependency(statusEvent.getId()); |
| - if(log.isDebugEnabled()) { |
| - log.debug("started a child: " + startDep + " by the group/cluster: " + id); |
| + Status status1 = statusEvent.getStatus(); |
| + ApplicationContext context = this.dependencyTree.findApplicationContextWithId(id); |
| + //Events coming from parent are In_Active(in faulty detection), Scaling events, termination |
| + //TODO if statusEvent is for active, then start the next one if any available |
| + if(!isParent(id)) { |
| + if(status1 == Status.Activated) { |
| + try { |
| + //if life cycle is empty, need to start the monitor |
| + boolean startDep = startDependency(statusEvent.getId()); |
| + if (log.isDebugEnabled()) { |
| + log.debug("started a child: " + startDep + " by the group/cluster: " + id); |
| |
| + } |
| + //updating the life cycle and current status |
| + if (startDep) { |
| + context.setCurrentStatus(Status.Created); |
| + context.addStatusToLIfeCycle(Status.Created); |
| + } else { |
| + StatusChecker.getInstance().onChildStatusChange(id, this.id, this.appId); |
| + } |
| + |
| + } catch (TopologyInConsistentException e) { |
| + //TODO revert the siblings and notify parent, change a flag for reverting/un-subscription |
| + log.error(e); |
| } |
| - //updating the life cycle and current status |
| - context.setStatus(statusEvent.getStatus()); |
| - context.addStatusToLIfeCycle(statusEvent.getStatus()); |
| - if(!startDep) { |
| - //Checking in the children whether all are active, |
| - // since no dependency found to be started. |
| - StatusChecker.getInstance().onChildStatusChange(id, this.id, this.appId); |
| + } else if(status1 == Status.In_Active) { |
| + //TODO if C1 depends on C2, then if C2 is in_active, then by getting killdepend as C1 and |
| + //TODO need to send in_active for c1. When C1 in_active receives, get dependent and |
| + //TODO check whether dependent in_active. Then kill c1. |
| + //evaluate termination behavior and take action based on that. |
| + |
| + List<ApplicationContext> terminationList = new ArrayList<ApplicationContext>(); |
| + terminationList = this.dependencyTree.getTerminationDependencies(id); |
| + |
| + //check whether all the children are in_active state |
| + for(ApplicationContext terminationContext : terminationList) { |
| + terminationContext |
| + } |
| + |
| + /*if(terminationList != null && !terminationList.isEmpty()) { |
| + for(ApplicationContext context1 : terminationList) { |
| + if(context1 instanceof ClusterContext) { |
| + AbstractClusterMonitor monitor = this.clusterIdToClusterMonitorsMap. |
| + get(context1.getId()); |
| + //Whether life cycle change to Created |
| + if(monitor.getStatus() == Status.Created) { |
| + canTerminate = true; |
| + } else { |
| + //TODO sending group in_active event to dependent cluster/group |
| + StatusEventPublisher.sendGroupActivatedEvent(this.appId, this.id); |
| + //not all dependent clusters are in created state. |
| + canTerminate = false; |
| + } |
| + } |
| + } |
| + if(canTerminate) { |
| + // |
| + }*/ |
| + } else { |
| + //TODO get dependents |
| + List<ApplicationContext> dependents = this.dependencyTree.getTerminationDependencies(id); |
| } |
| - } catch (TopologyInConsistentException e) { |
| - //TODO revert the siblings and notify parent, change a flag for reverting/un-subscription |
| - log.error(e); |
| + |
| + |
| + |
| + |
| + |
| + } else if(status1 == Status.Created) { |
| + //the dependent goes to be created state, so terminate the dependents |
| } |
| } else { |
| - //TODO act based on life cycle events |
| + //If it is coming from parent, then can be unsubscribe/scaling/terminate |
| + // request upon other siblings's status changes |
| + |
| + |
| + |
| } |
| |
| + |
| + |
| } |
| |
| public Monitor getParent() { |
| @@ -123,4 +179,16 @@ public class GroupMonitor extends Monitor implements EventHandler { |
| this.appId = appId; |
| } |
| |
| + private boolean isParent(String id) { |
| + if(this.parent.getId().equals(id)) { |
| + return true; |
| + } else { |
| + return false; |
| + } |
| + } |
| + |
| + |
| + |
| + |
| + |
| } |
| diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java |
| index ee04fff..e298df3 100644 |
| --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java |
| +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java |
| @@ -64,6 +64,13 @@ public class StatusChecker { |
| } |
| } |
| |
| + public void onMemberTermination(String clusterId) { |
| + ClusterMonitor monitor = AutoscalerContext.getInstance().getMonitor(clusterId); |
| + //TODO get Topology status |
| + // if cluster not having any members and if the cluster was in_active then send created Events |
| + // if cluster was in terminating, then send terminated event. |
| + } |
| + |
| private boolean clusterActive(AbstractClusterMonitor monitor) { |
| boolean clusterActive = false; |
| for (NetworkPartitionContext networkPartitionContext : monitor.getNetworkPartitionCtxts().values()) { |
| @@ -84,6 +91,42 @@ public class StatusChecker { |
| } |
| |
| /** |
| + * @param clusterId |
| + * @param appId |
| + * @param partitionContext is to decide in which partition has less members while others have active members |
| + */ |
| + public void onMemberFaultEvent(final String clusterId, final String appId, final PartitionContext partitionContext) { |
| + ClusterMonitor monitor = AutoscalerContext.getInstance().getMonitor(clusterId); |
| + boolean clusterInActive = getClusterInActive(monitor, partitionContext); |
| + if (clusterInActive) { |
| + //TODO evaluate life cycle |
| + //send cluster In-Active event to cluster status topic |
| + |
| + } else { |
| + boolean clusterActive = clusterActive(monitor); |
| + if(clusterActive) { |
| + //TODO evaluate life cycle |
| + //send clusterActive event to cluster status topic |
| + } |
| + } |
| + } |
| + |
| + private boolean getClusterInActive(AbstractClusterMonitor monitor, PartitionContext partitionContext) { |
| + boolean clusterInActive = false; |
| + for (NetworkPartitionContext networkPartitionContext : monitor.getNetworkPartitionCtxts().values()) { |
| + for (PartitionContext partition : networkPartitionContext.getPartitionCtxts().values()) { |
| + if (partitionContext.getPartitionId().equals(partition.getPartitionId()) && |
| + partition.getActiveMemberCount() < partition.getMinimumMemberCount()) { |
| + clusterInActive = true; |
| + return clusterInActive; |
| + } |
| + } |
| + |
| + } |
| + return clusterInActive; |
| + } |
| + |
| + /** |
| * |
| * @param idOfChild |
| * @param groupId |
| @@ -149,47 +192,7 @@ public class StatusChecker { |
| } |
| |
| |
| - /** |
| - * @param clusterId |
| - * @param appId |
| - * @param partitionContext is to decide in which partition has less members while others have active members |
| - */ |
| - public void onMemberFaultEvent(final String clusterId, final String appId, final PartitionContext partitionContext) { |
| - Runnable memberFault = new Runnable() { |
| - public void run() { |
| - ClusterMonitor monitor = AutoscalerContext.getInstance().getMonitor(clusterId); |
| - boolean clusterActive = false; |
| - boolean clusterInMaintenance = false; |
| - for (NetworkPartitionContext networkPartitionContext : monitor.getNetworkPartitionCtxts().values()) { |
| - for (PartitionContext partition : networkPartitionContext.getPartitionCtxts().values()) { |
| - if (partitionContext.getPartitionId().equals(partition.getPartitionId()) && |
| - partition.getActiveMemberCount() < partition.getMinimumMemberCount()) { |
| - clusterInMaintenance = true; |
| - } else { |
| - log.info(String.format("Hence the [partition] %s, in [networkpartition], " + |
| - "%s has exceeded the [minimum], %d with current active " + |
| - "[members], %d the [cluster], %s is still in active mode." |
| - , partition.getPartitionId(), partition.getNetworkPartitionId(), |
| - partition.getMinimumMemberCount(), partition.getActiveMemberCount(), clusterId)); |
| - } |
| - if (partitionContext.getMinimumMemberCount() >= partitionContext.getActiveMemberCount()) { |
| - clusterActive = true; |
| - } |
| - clusterActive = false; |
| - } |
| - |
| - } |
| - // if in maintenance then notify upper layer |
| - if (clusterActive && clusterInMaintenance) { |
| - //send clusterInmaintenance event to cluster status topic |
| - |
| - } |
| |
| - } |
| - }; |
| - Thread faultHandlingThread = new Thread(memberFault); |
| - faultHandlingThread.start(); |
| - } |
| |
| /** |
| * This will use to calculate whether all children of a particular component is active by travesing Top |
| diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java |
| index cb03158..77af14c 100644 |
| --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java |
| +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java |
| @@ -163,7 +163,7 @@ public class AutoscalerUtil { |
| } |
| |
| clusterMonitor.addNetworkPartitionCtxt(networkPartitionContext); |
| - //clusterMonitor.setStatus(Status.Created); |
| + //clusterMonitor.setCurrentStatus(Status.Created); |
| if(log.isInfoEnabled()){ |
| log.info(String.format("Network partition context has been added: [network partition] %s", |
| networkPartitionContext.getId())); |
| diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Status.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Status.java |
| index 7ba27fc..2bd0945 100644 |
| --- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Status.java |
| +++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Status.java |
| @@ -24,8 +24,9 @@ public enum Status { |
| Created(1), |
| Running(2), |
| Activated(3), |
| - In_Maintenance(4), |
| - Removed(5); |
| + In_Active(4), |
| + Terminating(4), |
| + Terminated(5); |
| |
| private int code; |
| |
| diff --git a/tools/automation-sripts/grouping-automation-script/samples/ec2/group2.json b/tools/automation-sripts/grouping-automation-script/samples/ec2/group2.json |
| index 942ef8b..0043e2e 100755 |
| --- a/tools/automation-sripts/grouping-automation-script/samples/ec2/group2.json |
| +++ b/tools/automation-sripts/grouping-automation-script/samples/ec2/group2.json |
| @@ -4,12 +4,15 @@ |
| "group1" |
| ], |
| "cartridges": [ |
| - "tomcat" |
| + "tomcat","tomcat1" |
| ], |
| "dependencies": { |
| "startupOrders": [ |
| "group.group1,cartridge.tomcat" |
| ], |
| - "killBehaviour": "kill-dependents" |
| - } |
| + "termination": { |
| + "terminationBehaviour": "kill-dependents", |
| + "terminationOrder" : "startupOrder/reverseStartupOrder" |
| + } |
| + } |
| } |
| diff --git a/tools/automation-sripts/grouping-automation-script/samples/ec2/m2_single_subsciption_app.json b/tools/automation-sripts/grouping-automation-script/samples/ec2/m2_single_subsciption_app.json |
| index b234c49..95c61b4 100644 |
| --- a/tools/automation-sripts/grouping-automation-script/samples/ec2/m2_single_subsciption_app.json |
| +++ b/tools/automation-sripts/grouping-automation-script/samples/ec2/m2_single_subsciption_app.json |
| @@ -13,7 +13,12 @@ |
| "type": "tomcat", |
| "alias": "mygroup2tomcat" |
| |
| - } |
| + }, |
| + { |
| + "type": "tomcat1", |
| + "alias": "mygroup2tomcat1" |
| + } |
| + |
| ], |
| "subGroups": [ |
| { |
| @@ -88,6 +93,15 @@ |
| "alias": "mygroup1tomcat1", |
| "deploymentPolicy": "deployment_policy_1", |
| "autoscalingPolicy": "autoscale_policy_1" |
| + }, |
| + { |
| + "alias": "mygroup2tomcat1", |
| + "deploymentPolicy": "deployment_policy_1", |
| + "autoscalingPolicy": "autoscale_policy_1", |
| + "repoURL": "www.mygit.com/php.git", |
| + "privateRepo": "true", |
| + "repoUsername": "admin", |
| + "repoPassword": "xxxx" |
| } |
| |
| ] |