Updated Branches: refs/heads/master 8e89271cd -> 7ac9d5774
Update rule file Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/fbd98ae3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/fbd98ae3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/fbd98ae3 Branch: refs/heads/master Commit: fbd98ae3179032299c647347f9de02751a3431b6 Parents: 8e89271 Author: Udara Liyanage <[email protected]> Authored: Tue Nov 26 19:39:24 2013 -0500 Committer: Udara Liyanage <[email protected]> Committed: Tue Nov 26 19:39:24 2013 -0500 ---------------------------------------------------------------------- .../distribution/src/main/conf/autoscaler.drl | 32 +++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/fbd98ae3/products/autoscaler/modules/distribution/src/main/conf/autoscaler.drl ---------------------------------------------------------------------- diff --git a/products/autoscaler/modules/distribution/src/main/conf/autoscaler.drl b/products/autoscaler/modules/distribution/src/main/conf/autoscaler.drl index 2d562e0..e824444 100644 --- a/products/autoscaler/modules/distribution/src/main/conf/autoscaler.drl +++ b/products/autoscaler/modules/distribution/src/main/conf/autoscaler.drl @@ -49,18 +49,20 @@ global org.apache.stratos.messaging.domain.topology.Topology $topology; rule "Minimum Rule" dialect "mvel" when - $service : Service () - $cluster : Cluster () from $service.getClusters() - $deploymentPolicy : DeploymentPolicy(id == "economy-deployment" ) from $manager.getDeploymentPolicyList() - $partitionGroup : PartitionGroup () from $deploymentPolicy.getPartitionGroups() - $partition : Partition () from $partitionGroup.getPartitions() - $clusterContext : ClusterContext() from $context.getClusterContext($cluster.getClusterId()) - eval($clusterContext.getMemberCount($partition.getId()) < $partition.getPartitionMembersMin() ) + $service : Service () + $cluster : Cluster () from $service.getClusters() + $deploymentPolicy : DeploymentPolicy(id == $cluster.getDeploymentPolicyName() ) from $manager.getDeploymentPolicyList() + $partitionGroup : PartitionGroup () from $deploymentPolicy.getPartitionGroups() + $partition : Partition () from $partitionGroup.getPartitions() + $clusterContext : ClusterContext() from $context.getClusterContext($cluster.getClusterId()) + eval($clusterContext.getMemberCount($partition.getId()) < $partition.getPartitionMembersMin()) + + then - int memberCountToBeIncreased = $partition.getPartitionMembersMin() - $clusterContext.getMemberCount($partition.getId()); - if($evaluator.delegateSpawn($partition,$cluster.getClusterId(), memberCountToBeIncreased)){ - $clusterContext.increaseMemberCountInPartitionBy($partition.getId(), memberCountToBeIncreased); - } + int memberCountToBeIncreased = 1; + if($evaluator.delegateSpawn($partition,$cluster.getClusterId(), memberCountToBeIncreased)){ + $clusterContext.increaseMemberCountInPartitionBy($partition.getId(), memberCountToBeIncreased); + } end rule "Scaler-up Rule" @@ -68,8 +70,8 @@ dialect "mvel" when $service : Service () $cluster : Cluster () from $service.getClusters() - $autoScalingPolicy : AutoscalePolicy(id == "economyPolicy" ) from $manager.getAutoscalePolicyList() - $deploymentPolicy : DeploymentPolicy(id == "economy-deployment" ) from $manager.getDeploymentPolicyList() + $autoScalingPolicy : AutoscalePolicy(id == $cluster.getAutoscalePolicyName() ) from $manager.getAutoscalePolicyList() + $deploymentPolicy : DeploymentPolicy(id == $cluster.getDeploymentPolicyName() ) from $manager.getDeploymentPolicyList() $partitionGroup : PartitionGroup () from $deploymentPolicy.getPartitionGroups() $clusterContext : ClusterContext() from $context.getClusterContext($cluster.getClusterId()) $loadThresholds :LoadThresholds() from $autoScalingPolicy.getLoadThresholds() @@ -96,8 +98,8 @@ dialect "mvel" when $service : Service () $cluster : Cluster () from $service.getClusters() - $autoScalingPolicy : AutoscalePolicy(id == "economyPolicy" ) from $manager.getAutoscalePolicyList() - $deploymentPolicy : DeploymentPolicy(id == "economy-deployment" ) from $manager.getDeploymentPolicyList() + $autoScalingPolicy : AutoscalePolicy(id == $cluster.getAutoscalePolicyName() ) from $manager.getAutoscalePolicyList() + $deploymentPolicy : DeploymentPolicy(id == $cluster.getDeploymentPolicyName() ) from $manager.getDeploymentPolicyList() $partitionGroup : PartitionGroup () from $deploymentPolicy.getPartitionGroups() $clusterContext : ClusterContext() from $context.getClusterContext($cluster.getClusterId()) $loadThresholds :LoadThresholds() from $autoScalingPolicy.getLoadThresholds()
