You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2013/12/14 17:20:44 UTC
[1/4] git commit: wsdl wasn't correctly generated
Updated Branches:
refs/heads/master 6f3d930f9 -> b86ab5393
wsdl wasn't correctly generated
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/0003b1d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/0003b1d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/0003b1d5
Branch: refs/heads/master
Commit: 0003b1d5a598820c5ebe4b151e03bb687a4770e9
Parents: 6f3d930
Author: Nirmal Fernando <ni...@apache.org>
Authored: Sat Dec 14 19:33:22 2013 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Sat Dec 14 19:33:22 2013 +0530
----------------------------------------------------------------------
.../src/main/resources/CloudControllerService.wsdl | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0003b1d5/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl b/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
index 205d872..0d2a45a 100644
--- a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
+++ b/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
@@ -142,7 +142,7 @@
<xs:element name="startInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="member" nillable="true" type="ax210:MemberContext"/>
+ <xs:element minOccurs="0" name="memberContext" nillable="true" type="ax210:MemberContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -236,11 +236,11 @@
<xs:element minOccurs="0" name="initTime" type="xs:long"/>
<xs:element minOccurs="0" name="lbClusterId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="nodeId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="partition" nillable="true" type="ax29:Partition"/>
<xs:element minOccurs="0" name="privateIpAddress" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="publicIpAddress" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Registrant">
@@ -832,22 +832,22 @@
</wsdl:binding>
<wsdl:service name="CloudControllerService">
<wsdl:port name="CloudControllerServiceHttpSoap11Endpoint" binding="ns:CloudControllerServiceSoap11Binding">
- <soap:address location="http://10.100.1.154:9764/services/CloudControllerService.CloudControllerServiceHttpSoap11Endpoint/"/>
+ <soap:address location="http://192.168.1.4:9764/services/CloudControllerService.CloudControllerServiceHttpSoap11Endpoint/"/>
</wsdl:port>
<wsdl:port name="CloudControllerServiceHttpsSoap11Endpoint" binding="ns:CloudControllerServiceSoap11Binding">
- <soap:address location="https://10.100.1.154:9444/services/CloudControllerService.CloudControllerServiceHttpsSoap11Endpoint/"/>
+ <soap:address location="https://192.168.1.4:9444/services/CloudControllerService.CloudControllerServiceHttpsSoap11Endpoint/"/>
</wsdl:port>
<wsdl:port name="CloudControllerServiceHttpSoap12Endpoint" binding="ns:CloudControllerServiceSoap12Binding">
- <soap12:address location="http://10.100.1.154:9764/services/CloudControllerService.CloudControllerServiceHttpSoap12Endpoint/"/>
+ <soap12:address location="http://192.168.1.4:9764/services/CloudControllerService.CloudControllerServiceHttpSoap12Endpoint/"/>
</wsdl:port>
<wsdl:port name="CloudControllerServiceHttpsSoap12Endpoint" binding="ns:CloudControllerServiceSoap12Binding">
- <soap12:address location="https://10.100.1.154:9444/services/CloudControllerService.CloudControllerServiceHttpsSoap12Endpoint/"/>
+ <soap12:address location="https://192.168.1.4:9444/services/CloudControllerService.CloudControllerServiceHttpsSoap12Endpoint/"/>
</wsdl:port>
<wsdl:port name="CloudControllerServiceHttpEndpoint" binding="ns:CloudControllerServiceHttpBinding">
- <http:address location="http://10.100.1.154:9764/services/CloudControllerService.CloudControllerServiceHttpEndpoint/"/>
+ <http:address location="http://192.168.1.4:9764/services/CloudControllerService.CloudControllerServiceHttpEndpoint/"/>
</wsdl:port>
<wsdl:port name="CloudControllerServiceHttpsEndpoint" binding="ns:CloudControllerServiceHttpBinding">
- <http:address location="https://10.100.1.154:9444/services/CloudControllerService.CloudControllerServiceHttpsEndpoint/"/>
+ <http:address location="https://192.168.1.4:9444/services/CloudControllerService.CloudControllerServiceHttpsEndpoint/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
\ No newline at end of file
[3/4] git commit: correction to debug logs
Posted by ni...@apache.org.
correction to debug logs
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/eea9431e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/eea9431e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/eea9431e
Branch: refs/heads/master
Commit: eea9431e4f0be4b6cde7eabd3667e3fb43c9c230
Parents: e50d531
Author: Nirmal Fernando <ni...@apache.org>
Authored: Sat Dec 14 19:35:58 2013 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Sat Dec 14 19:35:58 2013 +0530
----------------------------------------------------------------------
.../impl/CloudControllerServiceImpl.java | 31 +++++++++-----------
1 file changed, 14 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/eea9431e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
index df7655c..99bd59e 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
@@ -337,8 +337,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
String clusterId = memberContext.getClusterId();
Partition partition = memberContext.getPartition();
- String memberAsString = memberContext.toString();
- log.info("Starting new instance : " + memberAsString);
+ log.info("Starting new instance : " + memberContext.toString());
ComputeService computeService = null;
Template template = null;
@@ -346,7 +345,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
if (partition == null) {
String msg =
"Instance start-up failed. Specified Partition is null. " +
- memberAsString;
+ memberContext.toString();
log.error(msg);
throw new IllegalArgumentException(msg);
}
@@ -355,7 +354,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
ClusterContext ctxt = dataHolder.getClusterContext(clusterId);
if (ctxt == null) {
- String msg = "Instance start-up failed. Invalid cluster id. " + memberAsString;
+ String msg = "Instance start-up failed. Invalid cluster id. " + memberContext.toString();
log.error(msg);
throw new IllegalArgumentException(msg);
}
@@ -367,7 +366,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
if (cartridge == null) {
String msg =
"Instance start-up failed. No valid Cartridge found. " +
- memberAsString;
+ memberContext.toString();
log.error(msg);
throw new UnregisteredCartridgeException(msg);
}
@@ -379,7 +378,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
IaasProvider iaasProvider = cartridge.getIaasProviderOfPartition(partitionId);
if (iaasProvider == null) {
String msg =
- "Instance start-up failed. " + memberAsString + ". " +
+ "Instance start-up failed. " + memberContext.toString() + ". " +
"There's no IaaS provided for the partition: " + partitionId +
" and for the Cartridge type: " + cartridgeType;
log.fatal(msg);
@@ -411,7 +410,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
try {
iaas = setIaas(iaasProvider);
} catch (InvalidIaasProviderException e) {
- String msg ="Instance start up failed. "+memberAsString+
+ String msg ="Instance start up failed. "+memberContext.toString()+
"Unable to build Iaas of this IaasProvider [Provider] : " + type;
log.error(msg, e);
throw new CloudControllerException(msg, e);
@@ -427,7 +426,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
if (template == null) {
String msg =
"Failed to start an instance. " +
- memberAsString +
+ memberContext.toString() +
". Reason : Template is null. You have not specify a matching service " +
"element in the configuration file of Autoscaler.\n Hence, will try to " +
"start in another IaaS if available.";
@@ -461,7 +460,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// node id
String nodeId = node.getId();
if (nodeId == null) {
- String msg = "Node id of the starting instance is null.\n" + memberAsString;
+ String msg = "Node id of the starting instance is null.\n" + memberContext.toString();
log.fatal(msg);
throw new CloudControllerException(msg);
}
@@ -469,7 +468,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
memberContext.setNodeId(nodeId);
if(log.isDebugEnabled()) {
- log.debug("Node id was set. "+memberAsString);
+ log.debug("Node id was set. "+memberContext.toString());
}
// reset ip
@@ -480,7 +479,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// allocate an IP address - manual IP assigning mode
ip = iaas.associateAddress(iaasProvider, node);
memberContext.setAllocatedIpAddress(ip);
- log.info("Allocated an ip address: " + memberAsString);
+ log.info("Allocated an ip address: " + memberContext.toString());
}
// public ip
@@ -488,7 +487,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
node.getPublicAddresses().iterator().hasNext()) {
ip = node.getPublicAddresses().iterator().next();
memberContext.setPublicIpAddress(ip);
- log.info("Public ip address: " + memberAsString);
+ log.info("Public ip address: " + memberContext.toString());
}
// private IP
@@ -496,7 +495,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
node.getPrivateAddresses().iterator().hasNext()) {
ip = node.getPrivateAddresses().iterator().next();
memberContext.setPrivateIpAddress(ip);
- log.info("Private ip address: " + memberAsString);
+ log.info("Private ip address: " + memberContext.toString());
}
dataHolder.addMemberContext(memberContext);
@@ -513,7 +512,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
log.debug("Node details: \n" + node.toString() + "\n***************\n");
}
- log.info("Instance is successfully starting up. "+memberAsString);
+ log.info("Instance is successfully starting up. "+memberContext.toString());
return memberContext;
@@ -523,7 +522,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
}
} catch (Exception e) {
- String msg = "Failed to start an instance. " + memberAsString;
+ String msg = "Failed to start an instance. " + memberContext.toString();
log.error(msg, e);
throw new CloudControllerException(msg, e);
}
@@ -1067,8 +1066,6 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// if and only if the deployment policy valid
cartridge.addIaasProviders(partitionToIaasProviders);
- persist();
-
return true;
}
[2/4] git commit: adding lb reference property to Cluster monitor and
setting its value globally in drools session
Posted by ni...@apache.org.
adding lb reference property to Cluster monitor and setting its value globally in drools session
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/e50d5316
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/e50d5316
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/e50d5316
Branch: refs/heads/master
Commit: e50d5316c592a5fdcc55ce619db6b6ba003e61b7
Parents: 0003b1d
Author: Nirmal Fernando <ni...@apache.org>
Authored: Sat Dec 14 19:35:17 2013 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Sat Dec 14 19:35:17 2013 +0530
----------------------------------------------------------------------
.../stratos/autoscaler/ClusterMonitor.java | 20 +++++++++++++-
.../stratos/autoscaler/LbClusterMonitor.java | 5 ++++
.../stratos/autoscaler/PartitionContext.java | 1 +
.../autoscaler/rule/RuleTasksDelegator.java | 28 +++++++++++---------
.../stratos/autoscaler/util/AutoscalerUtil.java | 27 ++++++++++---------
5 files changed, 55 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e50d5316/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ClusterMonitor.java
index 1ae757f..8a3d5bc 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ClusterMonitor.java
@@ -60,6 +60,8 @@ public class ClusterMonitor implements Runnable{
private FactHandle scaleCheckFactHandle;
private AutoscalerRuleEvaluator autoscalerRuleEvaluator;
+
+ private String lbReferenceType;
public ClusterMonitor(String clusterId, String serviceId, DeploymentPolicy deploymentPolicy,
AutoscalePolicy autoscalePolicy) {
@@ -152,7 +154,8 @@ public class ClusterMonitor implements Runnable{
for(PartitionContext partitionContext: networkPartitionContext.getPartitionCtxts().values()){
minCheckKnowledgeSession.setGlobal("clusterId", clusterId);
-
+ minCheckKnowledgeSession.setGlobal("lbRef", lbReferenceType);
+
if (log.isDebugEnabled()) {
log.debug(String.format("Running minimum check for partition %s ", partitionContext.getPartitionId()));
}
@@ -219,6 +222,13 @@ public class ClusterMonitor implements Runnable{
return autoscalePolicy;
}
+ @Override
+ public String toString() {
+ return "ClusterMonitor [clusterId=" + clusterId + ", serviceId=" + serviceId +
+ ", deploymentPolicy=" + deploymentPolicy + ", autoscalePolicy=" + autoscalePolicy +
+ ", lbReferenceType=" + lbReferenceType + "]";
+ }
+
public void setAutoscalePolicy(AutoscalePolicy autoscalePolicy) {
this.autoscalePolicy = autoscalePolicy;
}
@@ -230,4 +240,12 @@ public class ClusterMonitor implements Runnable{
public boolean memberExist(String memberId){
return this.memberPartitionMap.containsKey(memberId);
}
+
+ public String getLbReferenceType() {
+ return lbReferenceType;
+ }
+
+ public void setLbReferenceType(String lbReferenceType) {
+ this.lbReferenceType = lbReferenceType;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e50d5316/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/LbClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/LbClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/LbClusterMonitor.java
index 131dfe6..8a4f3e5 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/LbClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/LbClusterMonitor.java
@@ -218,4 +218,9 @@ public class LbClusterMonitor implements Runnable{
public boolean memberExist(String memberId){
return this.memberPartitionMap.containsKey(memberId);
}
+
+ @Override
+ public String toString() {
+ return "LbClusterMonitor [clusterId=" + clusterId + ", serviceId=" + serviceId + "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e50d5316/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 2843e16..a4c1b68 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
@@ -72,6 +72,7 @@ public class PartitionContext implements Serializable{
public PartitionContext(Partition partition) {
this.setPartition(partition);
+ this.minimumMemberCount = partition.getPartitionMin();
this.partitionId = partition.getId();
this.pendingMembers = new ArrayList<MemberContext>();
this.activeMembers = new ArrayList<MemberContext>();
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e50d5316/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
index 906e002..4e9f1c9 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
@@ -44,7 +44,7 @@ public class RuleTasksDelegator {
return autoscaleAlgorithm;
}
- public void delegateSpawn(PartitionContext partitionContext, String clusterId) {
+ public void delegateSpawn(PartitionContext partitionContext, String clusterId, String lbRefType) {
try {
String nwPartitionId = partitionContext.getNetworkPartitionId();
@@ -52,7 +52,8 @@ public class RuleTasksDelegator {
PartitionManager.getInstance()
.getNetworkPartition(nwPartitionId);
- String lbClusterId = getLbClusterId(partitionContext, ctxt);
+
+ String lbClusterId = getLbClusterId(lbRefType, partitionContext, ctxt);
MemberContext memberContext =
CloudControllerClient.getInstance()
@@ -72,18 +73,21 @@ public class RuleTasksDelegator {
- public static String getLbClusterId(PartitionContext partitionContext, NetworkPartitionContext ctxt) {
- Properties props = partitionContext.getProperties();
- String value =
- (String) props.get(org.apache.stratos.messaging.util.Constants.LOAD_BALANCER_REF);
+ public static String getLbClusterId(String lbRefType, PartitionContext partitionCtxt,
+ NetworkPartitionContext nwPartitionCtxt) {
+
String lbClusterId = null;
- if (value.equals(org.apache.stratos.messaging.util.Constants.DEFAULT_LOAD_BALANCER)) {
- lbClusterId = ctxt.getDefaultLbClusterId();
- } else if (value.equals(org.apache.stratos.messaging.util.Constants.SERVICE_AWARE_LOAD_BALANCER)) {
- String serviceName = partitionContext.getServiceName();
- lbClusterId = ctxt.getLBClusterIdOfService(serviceName);
- }
+ if (lbRefType != null) {
+ if (lbRefType.equals(org.apache.stratos.messaging.util.Constants.DEFAULT_LOAD_BALANCER)) {
+ lbClusterId = nwPartitionCtxt.getDefaultLbClusterId();
+ } else if (lbRefType.equals(org.apache.stratos.messaging.util.Constants.SERVICE_AWARE_LOAD_BALANCER)) {
+ String serviceName = partitionCtxt.getServiceName();
+ lbClusterId = nwPartitionCtxt.getLBClusterIdOfService(serviceName);
+ } else {
+ log.warn("Invalid LB reference type defined: [value] "+lbRefType);
+ }
+ }
return lbClusterId;
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e50d5316/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
----------------------------------------------------------------------
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 a171d4c..4bfa271 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
@@ -110,6 +110,7 @@ public class AutoscalerUtil {
new ClusterMonitor(cluster.getClusterId(),
cluster.getServiceName(),
deploymentPolicy, policy);
+
for (PartitionGroup partitionGroup: deploymentPolicy.getPartitionGroups()){
NetworkPartitionContext networkPartitionContext = new NetworkPartitionContext(partitionGroup.getId());
@@ -145,20 +146,20 @@ public class AutoscalerUtil {
clusterMonitor.addNetworkPartitionCtxt(networkPartitionContext);
}
-// if (policy != null) {
-//
-// // get values from policy
-// LoadThresholds loadThresholds = policy.getLoadThresholds();
-// float averageLimit = loadThresholds.getRequestsInFlight().getAverage();
-// float gradientLimit = loadThresholds.getRequestsInFlight().getGradient();
-// float secondDerivativeLimit = loadThresholds.getRequestsInFlight().getSecondDerivative();
-//
-// clusterMonitor.setRequestsInFlightGradientThreshold(gradientLimit);
-// clusterMonitor.setRequestsInFlightSecondDerivativeThreshold(secondDerivativeLimit);
-// clusterMonitor.setAverageRequestsInFlightThreshold(averageLimit);
-//
-// }
+
+
+ // find lb reference type
+ java.util.Properties props = cluster.getProperties();
+
+ if(props.containsKey(Constants.LOAD_BALANCER_REF)) {
+ String value = props.getProperty(Constants.LOAD_BALANCER_REF);
+ clusterMonitor.setLbReferenceType(value);
+ if(log.isDebugEnabled()) {
+ log.debug("Set the lb reference type: "+value);
+ }
+ }
+ log.info("Cluster monitor created: "+clusterMonitor.toString());
return clusterMonitor;
}
[4/4] git commit: implementing toString methods and using it in debug
logs
Posted by ni...@apache.org.
implementing toString methods and using it in debug logs
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/b86ab539
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/b86ab539
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/b86ab539
Branch: refs/heads/master
Commit: b86ab53932e0f12f464275d7d1c98e8934270d34
Parents: eea9431
Author: Nirmal Fernando <ni...@apache.org>
Authored: Sat Dec 14 21:49:37 2013 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Sat Dec 14 21:49:37 2013 +0530
----------------------------------------------------------------------
.../org/apache/stratos/cloud/controller/pojo/Properties.java | 6 ++++++
.../org/apache/stratos/cloud/controller/pojo/Property.java | 7 ++++---
.../org/apache/stratos/cloud/controller/pojo/Registrant.java | 7 +++++++
.../cloud/controller/topology/TopologyEventSender.java | 6 +-----
4 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b86ab539/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
index 3d21200..d5a2fdc 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
@@ -19,6 +19,7 @@
package org.apache.stratos.cloud.controller.pojo;
import java.io.Serializable;
+import java.util.Arrays;
/**
* Had to wrap {@link Property} array using a class, since there's a bug in current
@@ -36,5 +37,10 @@ public class Properties implements Serializable{
public void setProperties(Property[] properties) {
this.properties = properties;
}
+
+ @Override
+ public String toString() {
+ return "Properties [properties=" + Arrays.toString(properties) + "]";
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b86ab539/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Property.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Property.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Property.java
index 0de93c1..e6de83d 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Property.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Property.java
@@ -54,8 +54,9 @@ public class Property implements Serializable{
this.value = value;
}
- public String toString () {
-
- return name + " : " + value;
+ @Override
+ public String toString() {
+ return "Property [name=" + name + ", value=" + value + "]";
}
+
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b86ab539/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Registrant.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Registrant.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Registrant.java
index 40acbf7..fe7a7e9 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Registrant.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Registrant.java
@@ -84,4 +84,11 @@ public class Registrant {
public void setDeploymentPolicyName(String deploymentPolicyName) {
this.deploymentPolicyName = deploymentPolicyName;
}
+ @Override
+ public String toString() {
+ return "Registrant [clusterId=" + clusterId + ", tenantRange=" + tenantRange +
+ ", hostName=" + hostName + ", cartridgeType=" + cartridgeType + ", properties=" +
+ properties + ", autoScalerPolicyName=" + autoScalerPolicyName +
+ ", deploymentPolicyName=" + deploymentPolicyName + "]";
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b86ab539/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventSender.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventSender.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventSender.java
index 0a21df6..b6feaa6 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventSender.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventSender.java
@@ -87,11 +87,7 @@ public class TopologyEventSender {
clusterCreatedEvent.setDeploymentPolicyName(registrant.getDeploymentPolicyName());
if(log.isInfoEnabled()) {
- log.info(String.format("Publishing cluster created event: " +
- "[service] %s [cluster] %s [host] %s [tenant-range] %s [autoscaling-policy] %s [deployment-policy] %s ",
- registrant.getCartridgeType(), registrant.getClusterId(),
- registrant.getHostName(), registrant.getTenantRange(), registrant.getAutoScalerPolicyName(),
- registrant.getDeploymentPolicyName()));
+ log.info("Publishing cluster created event: " +registrant.toString());
}
publishEvent(clusterCreatedEvent);