Updated Branches: refs/heads/master dc13917dc -> 11231e0cf
adding a test resource Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/11231e0c Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/11231e0c Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/11231e0c Branch: refs/heads/master Commit: 11231e0cf9319ffc7903aa26ae9fd904954887d1 Parents: dc13917 Author: Isuru <[email protected]> Authored: Wed Feb 5 14:47:33 2014 +0530 Committer: Isuru <[email protected]> Committed: Wed Feb 5 14:47:33 2014 +0530 ---------------------------------------------------------------------- .../stratos/autoscaler/PartitionContext.java | 6 +++ .../stratos/autoscaler/TestMinimumRule.java | 2 +- .../autoscaler/TestObsoletedMemberRule.java | 2 +- .../src/test/resources/autoscaler.xml | 43 ++++++++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/11231e0c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java index ca4cd99..7d75943 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java @@ -86,6 +86,9 @@ public class PartitionContext implements Serializable{ this.activeMembers = new ArrayList<MemberContext>(); this.terminationPendingMembers = new ArrayList<MemberContext>(); expiryTime = memberExpiryTime; + //if (log.isDebugEnabled()) { + log.info("Member expiry time is set to: " + expiryTime); + //} } public PartitionContext(Partition partition) { @@ -102,6 +105,9 @@ public class PartitionContext implements Serializable{ // check if a different value has been set for expiryTime XMLConfiguration conf = ConfUtil.getInstance(null).getConfiguration(); expiryTime = conf.getLong("autoscaler.member.expiryTimeout", 900000); + //if (log.isDebugEnabled()) { + log.info("Member expiry time is set to: " + expiryTime); + //} Thread th = new Thread(new PendingMemberWatcher(this)); th.start(); http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/11231e0c/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestMinimumRule.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestMinimumRule.java b/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestMinimumRule.java index 30d63bc..0c73cd2 100644 --- a/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestMinimumRule.java +++ b/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestMinimumRule.java @@ -64,7 +64,7 @@ public class TestMinimumRule { kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); - conf = ConfUtil.getInstance("autoscaler.xml").getConfiguration(); + conf = ConfUtil.getInstance("src/test/resources/autoscaler.xml").getConfiguration(); } @Test http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/11231e0c/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestObsoletedMemberRule.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestObsoletedMemberRule.java b/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestObsoletedMemberRule.java index e602539..49d2036 100644 --- a/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestObsoletedMemberRule.java +++ b/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/TestObsoletedMemberRule.java @@ -67,7 +67,7 @@ public class TestObsoletedMemberRule { kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); log.info("Knowledge base has been set up."); - conf = ConfUtil.getInstance("autoscaler.xml").getConfiguration(); + conf = ConfUtil.getInstance("src/test/resources/autoscaler.xml").getConfiguration(); } @Test http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/11231e0c/components/org.apache.stratos.autoscaler/src/test/resources/autoscaler.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/test/resources/autoscaler.xml b/components/org.apache.stratos.autoscaler/src/test/resources/autoscaler.xml new file mode 100644 index 0000000..39125af --- /dev/null +++ b/components/org.apache.stratos.autoscaler/src/test/resources/autoscaler.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +<configuration> + <autoscaler> + <rulesEvaluator> + <schedule> + <initialDelay>30</initialDelay> + <period>15</period> + </schedule> + </rulesEvaluator> + <cloudController> + <hostname>localhost</hostname> + <port>9444</port> + <clientTimeout>300000</clientTimeout> + </cloudController> + <stratosManager> + <hostname>localhost</hostname> + <port>9445</port> + <clientTimeout>300000</clientTimeout> + </stratosManager> + <member> + <expiryTimeout>900000</expiryTimeout> + </member> + </autoscaler> +</configuration>
