Removing DAS-Artifacts
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/a61331e0 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/a61331e0 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/a61331e0 Branch: refs/heads/master Commit: a61331e0cb9c2a7f87e95a6bc4fec233109a3daf Parents: d5d7f79 Author: Thanuja <[email protected]> Authored: Thu Jul 23 15:00:58 2015 +0530 Committer: Thanuja <[email protected]> Committed: Thu Jul 23 15:00:58 2015 +0530 ---------------------------------------------------------------------- DAS-Artifacts/CCEventReceiver.xml | 9 - DAS-Artifacts/SparkQuery.txt | 19 - ...g.apache.stratos.cloud.controller_1.0.0.json | 112 --- .../org_apache_stratos_cloud_controller.xml | 1 - .../autoscaler/rule/RuleTasksDelegator.java | 688 +++++++++---------- .../util/CloudControllerConstants.java | 478 ++++++------- 6 files changed, 583 insertions(+), 724 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/a61331e0/DAS-Artifacts/CCEventReceiver.xml ---------------------------------------------------------------------- diff --git a/DAS-Artifacts/CCEventReceiver.xml b/DAS-Artifacts/CCEventReceiver.xml deleted file mode 100644 index 0ddd086..0000000 --- a/DAS-Artifacts/CCEventReceiver.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<eventReceiver name="CCEventReceiver" statistics="disable" - trace="enable" xmlns="http://wso2.org/carbon/eventreceiver"> - <from eventAdapterType="wso2event"> - <property name="events.duplicated.in.cluster">false</property> - </from> - <mapping customMapping="disable" type="wso2event"/> - <to streamName="org.apache.stratos.cloud.controller" version="1.0.0"/> -</eventReceiver> http://git-wip-us.apache.org/repos/asf/stratos/blob/a61331e0/DAS-Artifacts/SparkQuery.txt ---------------------------------------------------------------------- diff --git a/DAS-Artifacts/SparkQuery.txt b/DAS-Artifacts/SparkQuery.txt deleted file mode 100644 index 39f7d47..0000000 --- a/DAS-Artifacts/SparkQuery.txt +++ /dev/null @@ -1,19 +0,0 @@ -CREATE TEMPORARY TABLE memberstatus -USING CarbonAnalytics -OPTIONS (tableName "ORG_APACHE_STRATOS_CLOUD_CONTROLLER"); - -CREATE TEMPORARY TABLE memberstatusnew -USING CarbonAnalytics -OPTIONS (tableName "CLUSTER_MEMBER_NEW", - schema "startTime String, endTime String, clusterId STRING, activatedInstanceCount INT, terminatedInstanceCount INT, activeInstanceCount INT"); - - -;WITH InstanceCount as -(select clusterId, count(case when status='Active' and timeStamp > current_time(null)-60000 and timeStamp <= current_time(null) then 1 else NULL end) as activatedInstanceCount, count(case when status='Terminated' and timeStamp > current_time(null)-60000 and timeStamp <= current_time(null) then 1 else NULL end) as terminatedInstanceCount, (sum(case when status='Active' then 1 else 0 end) - sum(case when status='Terminated' then 1 else 0 end))as activeInstanceCount from memberstatus group by clusterId) -INSERT INTO table memberstatusnew select time(current_time(null)-60000),time(current_time(null)),clusterId, activatedInstanceCount, terminatedInstanceCount,activeInstanceCount from InstanceCount; - -CREATE TEMPORARY TABLE membersnew -USING CarbonAnalytics -OPTIONS (tableName "MEMBER_NEW",schema "clusterId STRING, clusterInstanceId STRING, partitionId STRING, networkId STRING, cartridgeType STRING, instanceType STRING, memberId STRING, scalingTime LONG,scalingReason STRING, timeStamp LONG"); - -INSERT INTO TABLE membersnew select clusterId, clusterInstanceId,partitionId,networkId,cartridgeType,instanceType, memberId, time(scalingTime),scalingReason,time(timeStamp) FROM memberstatus where status='Created'; http://git-wip-us.apache.org/repos/asf/stratos/blob/a61331e0/DAS-Artifacts/org.apache.stratos.cloud.controller_1.0.0.json ---------------------------------------------------------------------- diff --git a/DAS-Artifacts/org.apache.stratos.cloud.controller_1.0.0.json b/DAS-Artifacts/org.apache.stratos.cloud.controller_1.0.0.json deleted file mode 100644 index de1025f..0000000 --- a/DAS-Artifacts/org.apache.stratos.cloud.controller_1.0.0.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "name": "org.apache.stratos.cloud.controller", - "version": "1.0.0", - "nickName": "cloud.controller", - "description": "Instances booted up by the Cloud Controller", - "payloadData": [ - { - "name": "timeStamp", - "type": "LONG" - }, - { - "name": "memberId", - "type": "STRING" - }, - { - "name": "cartridgeType", - "type": "STRING" - }, - { - "name": "clusterId", - "type": "STRING" - }, - { - "name": "clusterInstanceId", - "type": "STRING" - }, - { - "name": "lbclusterId", - "type": "STRING" - }, - { - "name": "partitionId", - "type": "STRING" - }, - { - "name": "networkId", - "type": "STRING" - }, - { - "name": "instanceType", - "type": "STRING" - }, - { - "name": "scalingReason", - "type": "STRING" - }, - { - "name": "scalingTime", - "type": "LONG" - }, - { - "name": "isMultiTenant", - "type": "STRING" - }, - { - "name": "iaas", - "type": "STRING" - }, - { - "name": "status", - "type": "STRING" - }, - { - "name": "hostName", - "type": "STRING" - }, - { - "name": "hypervisor", - "type": "STRING" - }, - { - "name": "ram", - "type": "STRING" - }, - { - "name": "imageId", - "type": "STRING" - }, - { - "name": "loginPort", - "type": "INT" - }, - { - "name": "osName", - "type": "STRING" - }, - { - "name": "osVersion", - "type": "STRING" - }, - { - "name": "osArch", - "type": "STRING" - }, - { - "name": "is64bitOS", - "type": "STRING" - }, - { - "name": "privateIPAddresses", - "type": "STRING" - }, - { - "name": "publicIPAddresses", - "type": "STRING" - }, - { - "name": "allocateIPAddresses", - "type": "STRING" - } - ] -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/a61331e0/DAS-Artifacts/org_apache_stratos_cloud_controller.xml ---------------------------------------------------------------------- diff --git a/DAS-Artifacts/org_apache_stratos_cloud_controller.xml b/DAS-Artifacts/org_apache_stratos_cloud_controller.xml deleted file mode 100644 index ee99acd..0000000 --- a/DAS-Artifacts/org_apache_stratos_cloud_controller.xml +++ /dev/null @@ -1 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EventStoreConfiguration><TableSchema><ColumnDefinition><Name>timeStamp</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>LONG</Type></ColumnDefinition><ColumnDefinition><Name>memberId</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>cartridgeType</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>clusterId</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>clusterInstanceId</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScorePar am>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>lbclusterId</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>partitionId</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>networkId</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>instanceType</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>scalingReason</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam ><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>scalingTime</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>LONG</Type></ColumnDefinition><ColumnDefinition><Name>isMultiTenant</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>iaas</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>status</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>hostName</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><Co lumnDefinition><Name>hypervisor</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>ram</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>imageId</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>loginPort</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>INTEGER</Type></ColumnDefinition><ColumnDefinition><Name>osName</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>osVersion</Name><EnableIn dexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>osArch</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>is64bitOS</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>privateIPAddresses</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>publicIPAddresses</Name><EnableIndexing>false</EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition><ColumnDefinition><Name>allocateIPAddresses</Name><EnableIndexing>false< /EnableIndexing><IsPrimaryKey>false</IsPrimaryKey><EnableScoreParam>false</EnableScoreParam><Type>STRING</Type></ColumnDefinition></TableSchema><Source><StreamId>org.apache.stratos.cloud.controller:1.0.0</StreamId></Source><RecordStoreName>EVENT_STORE</RecordStoreName></EventStoreConfiguration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/a61331e0/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 3a69880..d569ed2 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 @@ -43,348 +43,348 @@ import org.apache.stratos.common.constants.StratosConstants; */ public class RuleTasksDelegator { - private static boolean arspiIsSet = false; - - private static final Log log = LogFactory.getLog(RuleTasksDelegator.class); - - public double getPredictedValueForNextMinute(float average, float gradient, float secondDerivative, - int timeInterval) { - double predictedValue; - // s = u * t + 0.5 * a * t * t - if (log.isDebugEnabled()) { - log.debug(String.format("Predicting the value, [average]: %s , [gradient]: %s , [second derivative] " + - ": %s , [time intervals]: %s ", average, gradient, secondDerivative, timeInterval)); - } - predictedValue = average + gradient * timeInterval + 0.5 * secondDerivative * timeInterval * timeInterval; - - return predictedValue; - } - - public int getNumberOfInstancesRequiredBasedOnRif(float rifPredictedValue, float rifThreshold) { - - if (rifThreshold != 0) { - - float requiredNumberOfInstances = rifPredictedValue / rifThreshold; - return (int) Math.ceil(requiredNumberOfInstances); - } else { - log.error("Request in flight threshold is Zero"); - return 0; - } - - } - - public int getNumberOfInstancesRequiredBasedOnMemoryConsumption(float threshold, double predictedValue, int min, - int max) { - double numberOfAdditionalInstancesRequired = 0; - if (predictedValue != threshold) { - - float scalingRange = 100 - threshold; - int instanceRange = max - min; - - if (instanceRange != 0) { - - float gradient = scalingRange / instanceRange; - numberOfAdditionalInstancesRequired = (predictedValue - threshold) / gradient; - } - - if (predictedValue < threshold) { - //Since predicted-value is less, it can be scale-down - return min - 1; - } - } - - return (int) Math.ceil(min + numberOfAdditionalInstancesRequired); - } - - public int getNumberOfInstancesRequiredBasedOnLoadAverage(float threshold, double predictedValue, int min) { - - double numberOfInstances; - if (threshold != 0) { - - numberOfInstances = (min * predictedValue) / threshold; - return (int) Math.ceil(numberOfInstances); - } - - return min; - } - - public int getMaxNumberOfInstancesRequired(int numberOfInstancesRequiredBasedOnRif, - int numberOfInstancesRequiredBasedOnMemoryConsumption, boolean mcReset, - int numberOfInstancesReuquiredBasedOnLoadAverage, boolean laReset) { - int numberOfInstances = 0; - - int rifBasedRequiredInstances = 0; - int mcBasedRequiredInstances = 0; - int laBasedRequiredInstances = 0; - if (arspiIsSet) { - rifBasedRequiredInstances = numberOfInstancesRequiredBasedOnRif; - } - if (mcReset) { - mcBasedRequiredInstances = numberOfInstancesRequiredBasedOnMemoryConsumption; - } - if (laReset) { - laBasedRequiredInstances = numberOfInstancesReuquiredBasedOnLoadAverage; - } - numberOfInstances = Math.max(Math.max(numberOfInstancesRequiredBasedOnMemoryConsumption, - numberOfInstancesReuquiredBasedOnLoadAverage), - numberOfInstancesRequiredBasedOnRif); - return numberOfInstances; - } - - public PartitionAlgorithm getPartitionAlgorithm(String partitionAlgorithm) { - - PartitionAlgorithm autoscaleAlgorithm = null; - //FIXME to not parse for algo when partition is chosen by the parent - - if (partitionAlgorithm == null) { - //Send one after another as default - partitionAlgorithm = StratosConstants.PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID; - } - if (log.isDebugEnabled()) { - log.debug(String.format("Retrieving partition algorithm [Partition algorithm]: %s", partitionAlgorithm)); - } - if (StratosConstants.PARTITION_ROUND_ROBIN_ALGORITHM_ID.equals(partitionAlgorithm)) { - autoscaleAlgorithm = new RoundRobin(); - } else if (StratosConstants.PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID.equals(partitionAlgorithm)) { - autoscaleAlgorithm = new OneAfterAnother(); - } else { - if (log.isErrorEnabled()) { - log.error(String.format("Partition algorithm %s could not be identified !", partitionAlgorithm)); - } - } - return autoscaleAlgorithm; - } - - public void delegateInstanceCleanup(String memberId) { - try { - // send the instance notification event. - InstanceNotificationPublisher.getInstance().sendInstanceCleanupEventForMember(memberId); - log.info("Instance clean up event sent for [member] " + memberId); - - } catch (Exception e) { - log.error("Cannot terminate instance", e); - } - } - - /** - * Invoked from drools to start an instance. - * - * @param clusterMonitorPartitionContext Cluster monitor partition context - * @param clusterId Cluster id - * @param clusterInstanceId Instance id - * @param isPrimary Is a primary member - */ - public void delegateSpawn(ClusterLevelPartitionContext clusterMonitorPartitionContext, String clusterId, - String clusterInstanceId, boolean isPrimary, String autoscalingReason, long scalingTime) { - - try { - String nwPartitionId = clusterMonitorPartitionContext.getNetworkPartitionId(); - - // Calculate accumulation of minimum counts of all the partition of current network partition - int minimumCountOfNetworkPartition; - ClusterMonitor clusterMonitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId); - ClusterContext clusterContext = clusterMonitor.getClusterContext(); - ClusterLevelNetworkPartitionContext clusterLevelNetworkPartitionContext = - clusterContext.getNetworkPartitionCtxt(nwPartitionId); - ClusterInstanceContext clusterInstanceContext = - (ClusterInstanceContext) clusterLevelNetworkPartitionContext. - getInstanceContext( - clusterInstanceId); - minimumCountOfNetworkPartition = clusterInstanceContext.getMinInstanceCount(); - - MemberContext memberContext = AutoscalerCloudControllerClient.getInstance().startInstance( - clusterMonitorPartitionContext.getPartition(), clusterId, clusterInstanceId, - clusterMonitorPartitionContext.getNetworkPartitionId(), isPrimary, minimumCountOfNetworkPartition, - autoscalingReason, scalingTime); - if (memberContext != null) { - ClusterLevelPartitionContext partitionContext = clusterInstanceContext. - getPartitionCtxt( - clusterMonitorPartitionContext - .getPartitionId()); - partitionContext.addPendingMember(memberContext); - partitionContext.addMemberStatsContext(new MemberStatsContext(memberContext.getMemberId())); - if (log.isDebugEnabled()) { - log.debug(String.format("Pending member added, [member] %s [partition] %s", - memberContext.getMemberId(), memberContext.getPartition().getId())); - } - - } else { - if (log.isErrorEnabled()) { - log.error("Member context returned from cloud controller is null"); - } - } - } catch (Exception e) { - String message = String.format("Could not start instance: [cluster-id] %s [instance-id] %s", clusterId, - clusterInstanceId); - log.error(message, e); - throw new RuntimeException(message, e); - } - } - - public void delegateScalingDependencyNotification(String clusterId, String networkPartitionId, String instanceId, - int requiredInstanceCount, int minimumInstanceCount) { - - if (log.isDebugEnabled()) { - log.debug("Scaling dependent notification is going to the [parentInstance] " + instanceId); - } - //Notify parent for checking scaling dependencies - ClusterMonitor clusterMonitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId); - float fMinimumInstanceCount = minimumInstanceCount; - float factor = requiredInstanceCount / fMinimumInstanceCount; - clusterMonitor.sendClusterScalingEvent(networkPartitionId, instanceId, factor); - } - - public void delegateScalingOverMaxNotification(String clusterId, String networkPartitionId, String instanceId) { - if (log.isDebugEnabled()) { - log.debug("Scaling max out notification is going to the [parentInstance] " + instanceId); - } - //Notify parent for checking scaling dependencies - ClusterMonitor clusterMonitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId); - clusterMonitor.sendScalingOverMaxEvent(networkPartitionId, instanceId); - } - - public void delegateScalingDownBeyondMinNotification(String clusterId, String networkPartitionId, - String instanceId) { - if (log.isDebugEnabled()) { - log.debug("Scaling down lower min notification is going to the [parentInstance] " + instanceId); - } - //Notify parent for checking scaling dependencies - ClusterMonitor clusterMonitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId); - clusterMonitor.sendScalingDownBeyondMinEvent(networkPartitionId, instanceId); - } - - public void delegateTerminate(ClusterLevelPartitionContext clusterMonitorPartitionContext, String memberId) { - - try { - //Moving member to pending termination list - if (clusterMonitorPartitionContext.activeMemberAvailable(memberId)) { - - log.info(String.format("[scale-down] Moving active member to termination pending list [member id] %s " + - "[partition] %s [network partition] %s", memberId, - clusterMonitorPartitionContext.getPartitionId(), - clusterMonitorPartitionContext.getNetworkPartitionId())); - clusterMonitorPartitionContext.moveActiveMemberToTerminationPendingMembers(memberId); - clusterMonitorPartitionContext.removeMemberStatsContext(memberId); - } else if (clusterMonitorPartitionContext.pendingMemberAvailable(memberId)) { - - log.info(String.format( - "[scale-down] Moving pending member to termination pending list [member id] %s " + - "[partition] %s [network partition] %s", memberId, - clusterMonitorPartitionContext.getPartitionId(), - clusterMonitorPartitionContext.getNetworkPartitionId())); - clusterMonitorPartitionContext.movePendingMemberToObsoleteMembers(memberId); - clusterMonitorPartitionContext.removeMemberStatsContext(memberId); - } - } catch (Exception e) { - log.error("[scale-down] Cannot move member to termination pending list ", e); - } - } - - public void delegateTerminateDependency(ClusterLevelPartitionContext clusterMonitorPartitionContext, - String memberId) { - try { - //calling SM to send the instance notification event. - if (log.isDebugEnabled()) { - log.debug("delegateTerminateDependency:memberId:" + memberId); - } - - } catch (Exception e) { - log.error("Cannot terminate instance", e); - } - } - - public void terminateObsoleteInstance(String memberId) { - try { - AutoscalerCloudControllerClient.getInstance().terminateInstance(memberId); - } catch (Exception e) { - log.error("Cannot terminate instance", e); - } - } - - //Grouping - public void delegateTerminateAll(String clusterId) { - try { - if (log.isDebugEnabled()) { - log.debug("delegateTerminateAll - begin"); - } - AutoscalerCloudControllerClient.getInstance().terminateAllInstances(clusterId); - if (log.isDebugEnabled()) { - log.debug("delegateTerminateAll - done"); - } - } catch (Exception e) { - log.error("Cannot terminate instance", e); - } - } - - public int getPredictedReplicasForStat(int minReplicas, float statUpperLimit, float statPredictedValue) { - if (statUpperLimit == 0) { - return 0; - } - float predictedValue = ((minReplicas / statUpperLimit) * statPredictedValue); - return (int) Math.ceil(predictedValue); - } - - public double getLoadAveragePredictedValue(ClusterInstanceContext clusterInstanceContext) { - double loadAveragePredicted = 0.0d; - int totalMemberCount = 0; - for (ClusterLevelPartitionContext partitionContext : clusterInstanceContext.getPartitionCtxts()) { - for (MemberStatsContext memberStatsContext : partitionContext.getMemberStatsContexts().values()) { - - float memberAverageLoadAverage = memberStatsContext.getLoadAverage().getAverage(); - float memberGredientLoadAverage = memberStatsContext.getLoadAverage().getGradient(); - float memberSecondDerivativeLoadAverage = memberStatsContext.getLoadAverage().getSecondDerivative(); - - double memberPredictedLoadAverage = - getPredictedValueForNextMinute(memberAverageLoadAverage, memberGredientLoadAverage, - memberSecondDerivativeLoadAverage, 1); - - if (log.isDebugEnabled()) { - log.debug(String.format("[cluster-instance-id] %s [member-id] %s " + "[predicted load average] %s ", - clusterInstanceContext.getId(), memberStatsContext.getMemberId(), - memberPredictedLoadAverage)); - } - loadAveragePredicted += memberPredictedLoadAverage; - ++totalMemberCount; - } - } - - if (totalMemberCount > 0) { - log.debug("Predicted load average : " + loadAveragePredicted / totalMemberCount); - return loadAveragePredicted / totalMemberCount; - } else { - return 0; - } - } - - public double getMemoryConsumptionPredictedValue(ClusterInstanceContext clusterInstanceContext) { - double memoryConsumptionPredicted = 0.0d; - int totalMemberCount = 0; - for (ClusterLevelPartitionContext partitionContext : clusterInstanceContext.getPartitionCtxts()) { - for (MemberStatsContext memberStatsContext : partitionContext.getMemberStatsContexts().values()) { - - float memberMemoryConsumptionAverage = memberStatsContext.getMemoryConsumption().getAverage(); - float memberMemoryConsumptionGredient = memberStatsContext.getMemoryConsumption().getGradient(); - float memberMemoryConsumptionSecondDerivative = - memberStatsContext.getMemoryConsumption().getSecondDerivative(); - - double memberPredictedMemoryConsumption = - getPredictedValueForNextMinute(memberMemoryConsumptionAverage, memberMemoryConsumptionGredient, - memberMemoryConsumptionSecondDerivative, 1); - - if (log.isDebugEnabled()) { - log.debug(String.format("[member-id] %s [predicted memory consumption] %s ", - memberStatsContext.getMemberId(), memberPredictedMemoryConsumption)); - } - memoryConsumptionPredicted += memberPredictedMemoryConsumption; - ++totalMemberCount; - } - } - - if (totalMemberCount > 0) { - log.debug("Predicted memory consumption : " + memoryConsumptionPredicted / totalMemberCount); - return memoryConsumptionPredicted / totalMemberCount; - } else { - return 0; - } - } + private static boolean arspiIsSet = false; + + private static final Log log = LogFactory.getLog(RuleTasksDelegator.class); + + public double getPredictedValueForNextMinute(float average, float gradient, float secondDerivative, + int timeInterval) { + double predictedValue; + // s = u * t + 0.5 * a * t * t + if (log.isDebugEnabled()) { + log.debug(String.format("Predicting the value, [average]: %s , [gradient]: %s , [second derivative] " + + ": %s , [time intervals]: %s ", average, gradient, secondDerivative, timeInterval)); + } + predictedValue = average + gradient * timeInterval + 0.5 * secondDerivative * timeInterval * timeInterval; + + return predictedValue; + } + + public int getNumberOfInstancesRequiredBasedOnRif(float rifPredictedValue, float rifThreshold) { + + if (rifThreshold != 0) { + + float requiredNumberOfInstances = rifPredictedValue / rifThreshold; + return (int) Math.ceil(requiredNumberOfInstances); + } else { + log.error("Request in flight threshold is Zero"); + return 0; + } + + } + + public int getNumberOfInstancesRequiredBasedOnMemoryConsumption(float threshold, double predictedValue, int min, + int max) { + double numberOfAdditionalInstancesRequired = 0; + if (predictedValue != threshold) { + + float scalingRange = 100 - threshold; + int instanceRange = max - min; + + if (instanceRange != 0) { + + float gradient = scalingRange / instanceRange; + numberOfAdditionalInstancesRequired = (predictedValue - threshold) / gradient; + } + + if (predictedValue < threshold) { + //Since predicted-value is less, it can be scale-down + return min - 1; + } + } + + return (int) Math.ceil(min + numberOfAdditionalInstancesRequired); + } + + public int getNumberOfInstancesRequiredBasedOnLoadAverage(float threshold, double predictedValue, int min) { + + double numberOfInstances; + if (threshold != 0) { + + numberOfInstances = (min * predictedValue) / threshold; + return (int) Math.ceil(numberOfInstances); + } + + return min; + } + + public int getMaxNumberOfInstancesRequired(int numberOfInstancesRequiredBasedOnRif, + int numberOfInstancesRequiredBasedOnMemoryConsumption, boolean mcReset, + int numberOfInstancesReuquiredBasedOnLoadAverage, boolean laReset) { + int numberOfInstances = 0; + + int rifBasedRequiredInstances = 0; + int mcBasedRequiredInstances = 0; + int laBasedRequiredInstances = 0; + if (arspiIsSet) { + rifBasedRequiredInstances = numberOfInstancesRequiredBasedOnRif; + } + if (mcReset) { + mcBasedRequiredInstances = numberOfInstancesRequiredBasedOnMemoryConsumption; + } + if (laReset) { + laBasedRequiredInstances = numberOfInstancesReuquiredBasedOnLoadAverage; + } + numberOfInstances = Math.max(Math.max(numberOfInstancesRequiredBasedOnMemoryConsumption, + numberOfInstancesReuquiredBasedOnLoadAverage), + numberOfInstancesRequiredBasedOnRif); + return numberOfInstances; + } + + public PartitionAlgorithm getPartitionAlgorithm(String partitionAlgorithm) { + + PartitionAlgorithm autoscaleAlgorithm = null; + //FIXME to not parse for algo when partition is chosen by the parent + + if (partitionAlgorithm == null) { + //Send one after another as default + partitionAlgorithm = StratosConstants.PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID; + } + if (log.isDebugEnabled()) { + log.debug(String.format("Retrieving partition algorithm [Partition algorithm]: %s", partitionAlgorithm)); + } + if (StratosConstants.PARTITION_ROUND_ROBIN_ALGORITHM_ID.equals(partitionAlgorithm)) { + autoscaleAlgorithm = new RoundRobin(); + } else if (StratosConstants.PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID.equals(partitionAlgorithm)) { + autoscaleAlgorithm = new OneAfterAnother(); + } else { + if (log.isErrorEnabled()) { + log.error(String.format("Partition algorithm %s could not be identified !", partitionAlgorithm)); + } + } + return autoscaleAlgorithm; + } + + public void delegateInstanceCleanup(String memberId) { + try { + // send the instance notification event. + InstanceNotificationPublisher.getInstance().sendInstanceCleanupEventForMember(memberId); + log.info("Instance clean up event sent for [member] " + memberId); + + } catch (Exception e) { + log.error("Cannot terminate instance", e); + } + } + + /** + * Invoked from drools to start an instance. + * + * @param clusterMonitorPartitionContext Cluster monitor partition context + * @param clusterId Cluster id + * @param clusterInstanceId Instance id + * @param isPrimary Is a primary member + */ + public void delegateSpawn(ClusterLevelPartitionContext clusterMonitorPartitionContext, String clusterId, + String clusterInstanceId, boolean isPrimary, String autoscalingReason, long scalingTime) { + + try { + String nwPartitionId = clusterMonitorPartitionContext.getNetworkPartitionId(); + + // Calculate accumulation of minimum counts of all the partition of current network partition + int minimumCountOfNetworkPartition; + ClusterMonitor clusterMonitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId); + ClusterContext clusterContext = clusterMonitor.getClusterContext(); + ClusterLevelNetworkPartitionContext clusterLevelNetworkPartitionContext = + clusterContext.getNetworkPartitionCtxt(nwPartitionId); + ClusterInstanceContext clusterInstanceContext = + (ClusterInstanceContext) clusterLevelNetworkPartitionContext. + getInstanceContext( + clusterInstanceId); + minimumCountOfNetworkPartition = clusterInstanceContext.getMinInstanceCount(); + + MemberContext memberContext = AutoscalerCloudControllerClient.getInstance().startInstance( + clusterMonitorPartitionContext.getPartition(), clusterId, clusterInstanceId, + clusterMonitorPartitionContext.getNetworkPartitionId(), isPrimary, minimumCountOfNetworkPartition, + autoscalingReason, scalingTime); + if (memberContext != null) { + ClusterLevelPartitionContext partitionContext = clusterInstanceContext. + getPartitionCtxt( + clusterMonitorPartitionContext + .getPartitionId()); + partitionContext.addPendingMember(memberContext); + partitionContext.addMemberStatsContext(new MemberStatsContext(memberContext.getMemberId())); + if (log.isDebugEnabled()) { + log.debug(String.format("Pending member added, [member] %s [partition] %s", + memberContext.getMemberId(), memberContext.getPartition().getId())); + } + + } else { + if (log.isErrorEnabled()) { + log.error("Member context returned from cloud controller is null"); + } + } + } catch (Exception e) { + String message = String.format("Could not start instance: [cluster-id] %s [instance-id] %s", clusterId, + clusterInstanceId); + log.error(message, e); + throw new RuntimeException(message, e); + } + } + + public void delegateScalingDependencyNotification(String clusterId, String networkPartitionId, String instanceId, + int requiredInstanceCount, int minimumInstanceCount) { + + if (log.isDebugEnabled()) { + log.debug("Scaling dependent notification is going to the [parentInstance] " + instanceId); + } + //Notify parent for checking scaling dependencies + ClusterMonitor clusterMonitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId); + float fMinimumInstanceCount = minimumInstanceCount; + float factor = requiredInstanceCount / fMinimumInstanceCount; + clusterMonitor.sendClusterScalingEvent(networkPartitionId, instanceId, factor); + } + + public void delegateScalingOverMaxNotification(String clusterId, String networkPartitionId, String instanceId) { + if (log.isDebugEnabled()) { + log.debug("Scaling max out notification is going to the [parentInstance] " + instanceId); + } + //Notify parent for checking scaling dependencies + ClusterMonitor clusterMonitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId); + clusterMonitor.sendScalingOverMaxEvent(networkPartitionId, instanceId); + } + + public void delegateScalingDownBeyondMinNotification(String clusterId, String networkPartitionId, + String instanceId) { + if (log.isDebugEnabled()) { + log.debug("Scaling down lower min notification is going to the [parentInstance] " + instanceId); + } + //Notify parent for checking scaling dependencies + ClusterMonitor clusterMonitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId); + clusterMonitor.sendScalingDownBeyondMinEvent(networkPartitionId, instanceId); + } + + public void delegateTerminate(ClusterLevelPartitionContext clusterMonitorPartitionContext, String memberId) { + + try { + //Moving member to pending termination list + if (clusterMonitorPartitionContext.activeMemberAvailable(memberId)) { + + log.info(String.format("[scale-down] Moving active member to termination pending list [member id] %s " + + "[partition] %s [network partition] %s", memberId, + clusterMonitorPartitionContext.getPartitionId(), + clusterMonitorPartitionContext.getNetworkPartitionId())); + clusterMonitorPartitionContext.moveActiveMemberToTerminationPendingMembers(memberId); + clusterMonitorPartitionContext.removeMemberStatsContext(memberId); + } else if (clusterMonitorPartitionContext.pendingMemberAvailable(memberId)) { + + log.info(String.format( + "[scale-down] Moving pending member to termination pending list [member id] %s " + + "[partition] %s [network partition] %s", memberId, + clusterMonitorPartitionContext.getPartitionId(), + clusterMonitorPartitionContext.getNetworkPartitionId())); + clusterMonitorPartitionContext.movePendingMemberToObsoleteMembers(memberId); + clusterMonitorPartitionContext.removeMemberStatsContext(memberId); + } + } catch (Exception e) { + log.error("[scale-down] Cannot move member to termination pending list ", e); + } + } + + public void delegateTerminateDependency(ClusterLevelPartitionContext clusterMonitorPartitionContext, + String memberId) { + try { + //calling SM to send the instance notification event. + if (log.isDebugEnabled()) { + log.debug("delegateTerminateDependency:memberId:" + memberId); + } + + } catch (Exception e) { + log.error("Cannot terminate instance", e); + } + } + + public void terminateObsoleteInstance(String memberId) { + try { + AutoscalerCloudControllerClient.getInstance().terminateInstance(memberId); + } catch (Exception e) { + log.error("Cannot terminate instance", e); + } + } + + //Grouping + public void delegateTerminateAll(String clusterId) { + try { + if (log.isDebugEnabled()) { + log.debug("delegateTerminateAll - begin"); + } + AutoscalerCloudControllerClient.getInstance().terminateAllInstances(clusterId); + if (log.isDebugEnabled()) { + log.debug("delegateTerminateAll - done"); + } + } catch (Exception e) { + log.error("Cannot terminate instance", e); + } + } + + public int getPredictedReplicasForStat(int minReplicas, float statUpperLimit, float statPredictedValue) { + if (statUpperLimit == 0) { + return 0; + } + float predictedValue = ((minReplicas / statUpperLimit) * statPredictedValue); + return (int) Math.ceil(predictedValue); + } + + public double getLoadAveragePredictedValue(ClusterInstanceContext clusterInstanceContext) { + double loadAveragePredicted = 0.0d; + int totalMemberCount = 0; + for (ClusterLevelPartitionContext partitionContext : clusterInstanceContext.getPartitionCtxts()) { + for (MemberStatsContext memberStatsContext : partitionContext.getMemberStatsContexts().values()) { + + float memberAverageLoadAverage = memberStatsContext.getLoadAverage().getAverage(); + float memberGredientLoadAverage = memberStatsContext.getLoadAverage().getGradient(); + float memberSecondDerivativeLoadAverage = memberStatsContext.getLoadAverage().getSecondDerivative(); + + double memberPredictedLoadAverage = + getPredictedValueForNextMinute(memberAverageLoadAverage, memberGredientLoadAverage, + memberSecondDerivativeLoadAverage, 1); + + if (log.isDebugEnabled()) { + log.debug(String.format("[cluster-instance-id] %s [member-id] %s " + "[predicted load average] %s ", + clusterInstanceContext.getId(), memberStatsContext.getMemberId(), + memberPredictedLoadAverage)); + } + loadAveragePredicted += memberPredictedLoadAverage; + ++totalMemberCount; + } + } + + if (totalMemberCount > 0) { + log.debug("Predicted load average : " + loadAveragePredicted / totalMemberCount); + return loadAveragePredicted / totalMemberCount; + } else { + return 0; + } + } + + public double getMemoryConsumptionPredictedValue(ClusterInstanceContext clusterInstanceContext) { + double memoryConsumptionPredicted = 0.0d; + int totalMemberCount = 0; + for (ClusterLevelPartitionContext partitionContext : clusterInstanceContext.getPartitionCtxts()) { + for (MemberStatsContext memberStatsContext : partitionContext.getMemberStatsContexts().values()) { + + float memberMemoryConsumptionAverage = memberStatsContext.getMemoryConsumption().getAverage(); + float memberMemoryConsumptionGredient = memberStatsContext.getMemoryConsumption().getGradient(); + float memberMemoryConsumptionSecondDerivative = + memberStatsContext.getMemoryConsumption().getSecondDerivative(); + + double memberPredictedMemoryConsumption = + getPredictedValueForNextMinute(memberMemoryConsumptionAverage, memberMemoryConsumptionGredient, + memberMemoryConsumptionSecondDerivative, 1); + + if (log.isDebugEnabled()) { + log.debug(String.format("[member-id] %s [predicted memory consumption] %s ", + memberStatsContext.getMemberId(), memberPredictedMemoryConsumption)); + } + memoryConsumptionPredicted += memberPredictedMemoryConsumption; + ++totalMemberCount; + } + } + + if (totalMemberCount > 0) { + log.debug("Predicted memory consumption : " + memoryConsumptionPredicted / totalMemberCount); + return memoryConsumptionPredicted / totalMemberCount; + } else { + return 0; + } + } } http://git-wip-us.apache.org/repos/asf/stratos/blob/a61331e0/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java index e2d953b..41dd8f0 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java @@ -24,261 +24,261 @@ import java.io.File; public final class CloudControllerConstants { - /** - * cloud-controller XML file's elements - */ - public static final String CLOUD_CONTROLLER_ELEMENT = "cloudController"; - public static final String SERIALIZATION_DIR_ELEMENT = "serializationDir"; - public static final String IAAS_PROVIDERS_ELEMENT = "iaasProviders"; - public static final String IAAS_PROVIDER_ELEMENT = "iaasProvider"; - public static final String PARTITION_ELEMENT = "partition"; - public static final String PARTITIONS_ELEMENT = "partitions"; - public static final String REGION_ELEMENT = "region"; - public static final String ZONE_ELEMENT = "zone"; - public static final String DEPLOYMENT_ELEMENT = "deployment"; - public static final String PORT_MAPPING_ELEMENT = "portMapping"; - public static final String APP_TYPES_ELEMENT = "appTypes"; - public static final String TYPE_ATTR = "type"; - public static final String HOST_ATTR = "host"; - public static final String BASE_DIR_ATTR = "baseDir"; - public static final String PROVIDER_ATTR = "provider"; - public static final String VERSION_ATTR = "version"; - public static final String MULTI_TENANT_ATTR = "multiTenant"; - public static final String PORT_ATTR = "port"; - public static final String PROXY_PORT_ATTR = "proxyPort"; - public static final String NAME_ATTR = "name"; - public static final String APP_SPECIFIC_MAPPING_ATTR = "appSpecificMapping"; + /** + * cloud-controller XML file's elements + */ + public static final String CLOUD_CONTROLLER_ELEMENT = "cloudController"; + public static final String SERIALIZATION_DIR_ELEMENT = "serializationDir"; + public static final String IAAS_PROVIDERS_ELEMENT = "iaasProviders"; + public static final String IAAS_PROVIDER_ELEMENT = "iaasProvider"; + public static final String PARTITION_ELEMENT = "partition"; + public static final String PARTITIONS_ELEMENT = "partitions"; + public static final String REGION_ELEMENT = "region"; + public static final String ZONE_ELEMENT = "zone"; + public static final String DEPLOYMENT_ELEMENT = "deployment"; + public static final String PORT_MAPPING_ELEMENT = "portMapping"; + public static final String APP_TYPES_ELEMENT = "appTypes"; + public static final String TYPE_ATTR = "type"; + public static final String HOST_ATTR = "host"; + public static final String BASE_DIR_ATTR = "baseDir"; + public static final String PROVIDER_ATTR = "provider"; + public static final String VERSION_ATTR = "version"; + public static final String MULTI_TENANT_ATTR = "multiTenant"; + public static final String PORT_ATTR = "port"; + public static final String PROXY_PORT_ATTR = "proxyPort"; + public static final String NAME_ATTR = "name"; + public static final String APP_SPECIFIC_MAPPING_ATTR = "appSpecificMapping"; - public static final String CARTRIDGES_ELEMENT = "cartridges"; - public static final String CARTRIDGE_ELEMENT = "cartridge"; + public static final String CARTRIDGES_ELEMENT = "cartridges"; + public static final String CARTRIDGE_ELEMENT = "cartridge"; - public static final String DISPLAY_NAME_ELEMENT = "displayName"; - public static final String DESCRIPTION_ELEMENT = "description"; - public static final String PROPERTY_ELEMENT = "property"; - public static final String PROPERTY_NAME_ATTR = "name"; - public static final String PROPERTY_VALUE_ATTR = "value"; - public static final String IMAGE_ID_ELEMENT = "imageId"; - public static final String SCALE_DOWN_ORDER_ELEMENT = "scaleDownOrder"; - public static final String SCALE_UP_ORDER_ELEMENT = "scaleUpOrder"; - public static final String CLASS_NAME_ELEMENT = "className"; - public static final String PROVIDER_ELEMENT = "provider"; - public static final String IDENTITY_ELEMENT = "identity"; - public static final String TYPE_ELEMENT = "type"; - public static final String SCOPE_ELEMENT = "scope"; - public static final String ID_ELEMENT = "id"; - public static final String CREDENTIAL_ELEMENT = "credential"; - public static final String DEFAULT_SERVICE_ELEMENT = "default"; - public static final String SERVICE_ELEMENT = "service"; - public static final String SERVICES_ELEMENT = "services"; - public static final String DIRECTORY_ELEMENT = "dir"; - public static final String HTTP_ELEMENT = "http"; - public static final String HTTPS_ELEMENT = "https"; - public static final String APP_TYPE_ELEMENT = "appType"; - public static final String SERVICE_DOMAIN_ATTR = "domain"; - public static final String SERVICE_SUB_DOMAIN_ATTR = "subDomain"; - public static final String SERVICE_TENANT_RANGE_ATTR = "tenantRange"; - public static final String POLICY_NAME = "policyName"; - public static final String PAYLOAD_ELEMENT = "payload"; - public static final String DATA_PUBLISHER_ELEMENT = "dataPublisher"; - public static final String TOPOLOGY_SYNC_ELEMENT = "topologySync"; - public static final String ENABLE_ATTR = "enable"; - public static final String BAM_SERVER_ELEMENT = "bamServer"; - public static final String CRON_ELEMENT = "cron"; - public static final String BAM_SERVER_ADMIN_USERNAME_ELEMENT = "adminUserName"; - public static final String BAM_SERVER_ADMIN_PASSWORD_ELEMENT = "adminPassword"; - public static final String CASSANDRA_INFO_ELEMENT = "cassandraInfo"; - public static final String HOST_ELEMENT = "host"; - public static final String CONNECTION_URL_ELEMENT = "connectionUrl"; - public static final String HOST_PORT_ELEMENT = "port"; - public static final String USER_NAME_ELEMENT = "userName"; - public static final String PASSWORD_ELEMENT = "password"; - public static final String CLOUD_CONTROLLER_EVENT_STREAM = "org.apache.stratos.cloud.controller"; - public static final String CLOUD_CONTROLLER_COL_FAMILY = CLOUD_CONTROLLER_EVENT_STREAM.replaceAll("[/.]", "_"); + public static final String DISPLAY_NAME_ELEMENT = "displayName"; + public static final String DESCRIPTION_ELEMENT = "description"; + public static final String PROPERTY_ELEMENT = "property"; + public static final String PROPERTY_NAME_ATTR = "name"; + public static final String PROPERTY_VALUE_ATTR = "value"; + public static final String IMAGE_ID_ELEMENT = "imageId"; + public static final String SCALE_DOWN_ORDER_ELEMENT = "scaleDownOrder"; + public static final String SCALE_UP_ORDER_ELEMENT = "scaleUpOrder"; + public static final String CLASS_NAME_ELEMENT = "className"; + public static final String PROVIDER_ELEMENT = "provider"; + public static final String IDENTITY_ELEMENT = "identity"; + public static final String TYPE_ELEMENT = "type"; + public static final String SCOPE_ELEMENT = "scope"; + public static final String ID_ELEMENT = "id"; + public static final String CREDENTIAL_ELEMENT = "credential"; + public static final String DEFAULT_SERVICE_ELEMENT = "default"; + public static final String SERVICE_ELEMENT = "service"; + public static final String SERVICES_ELEMENT = "services"; + public static final String DIRECTORY_ELEMENT = "dir"; + public static final String HTTP_ELEMENT = "http"; + public static final String HTTPS_ELEMENT = "https"; + public static final String APP_TYPE_ELEMENT = "appType"; + public static final String SERVICE_DOMAIN_ATTR = "domain"; + public static final String SERVICE_SUB_DOMAIN_ATTR = "subDomain"; + public static final String SERVICE_TENANT_RANGE_ATTR = "tenantRange"; + public static final String POLICY_NAME = "policyName"; + public static final String PAYLOAD_ELEMENT = "payload"; + public static final String DATA_PUBLISHER_ELEMENT = "dataPublisher"; + public static final String TOPOLOGY_SYNC_ELEMENT = "topologySync"; + public static final String ENABLE_ATTR = "enable"; + public static final String BAM_SERVER_ELEMENT = "bamServer"; + public static final String CRON_ELEMENT = "cron"; + public static final String BAM_SERVER_ADMIN_USERNAME_ELEMENT = "adminUserName"; + public static final String BAM_SERVER_ADMIN_PASSWORD_ELEMENT = "adminPassword"; + public static final String CASSANDRA_INFO_ELEMENT = "cassandraInfo"; + public static final String HOST_ELEMENT = "host"; + public static final String CONNECTION_URL_ELEMENT = "connectionUrl"; + public static final String HOST_PORT_ELEMENT = "port"; + public static final String USER_NAME_ELEMENT = "userName"; + public static final String PASSWORD_ELEMENT = "password"; + public static final String CLOUD_CONTROLLER_EVENT_STREAM = "org.apache.stratos.cloud.controller"; + public static final String CLOUD_CONTROLLER_COL_FAMILY = CLOUD_CONTROLLER_EVENT_STREAM.replaceAll("[/.]", "_"); - /** - * column names - */ - public static final String PAYLOAD_PREFIX = "payload_"; - public static final String MEMBER_ID_COL = "memberId"; - public static final String CARTRIDGE_TYPE_COL = "cartridgeType"; - public static final String CLUSTER_ID_COL = "clusterId"; - public static final String CLUSTER_INSTANCE_ID_COL = "clusterInstanceId"; - public static final String PARTITION_ID_COL = "partitionId"; - public static final String NETWORK_ID_COL = "networkId"; - public static final String ALIAS_COL = "alias"; - public static final String TENANT_RANGE_COL = "tenantRange"; - public static final String IS_MULTI_TENANT_COL = "isMultiTenant"; - public static final String IAAS_COL = "iaas"; - public static final String STATUS_COL = "status"; - public static final String HOST_NAME_COL = "hostName"; - public static final String HYPERVISOR_COL = "hypervisor"; - public static final String RAM_COL = "ram"; - public static final String IMAGE_ID_COL = "imageId"; - public static final String LOGIN_PORT_COL = "loginPort"; - public static final String OS_NAME_COL = "osName"; - public static final String OS_VERSION_COL = "osVersion"; - public static final String OS_ARCH_COL = "osArch"; - public static final String OS_BIT_COL = "is64bitOS"; - public static final String PRIV_IP_COL = "privateIPAddresses"; - public static final String PUB_IP_COL = "publicIPAddresses"; - public static final String ALLOCATE_IP_COL = "allocateIPAddresses"; - public static final String TIME_STAMP = "timeStamp"; - public static final String SCALING_REASON = "scalingReason"; - public static final String SCALING_TIME = "scalingTime"; + /** + * column names + */ + public static final String PAYLOAD_PREFIX = "payload_"; + public static final String MEMBER_ID_COL = "memberId"; + public static final String CARTRIDGE_TYPE_COL = "cartridgeType"; + public static final String CLUSTER_ID_COL = "clusterId"; + public static final String CLUSTER_INSTANCE_ID_COL = "clusterInstanceId"; + public static final String PARTITION_ID_COL = "partitionId"; + public static final String NETWORK_ID_COL = "networkId"; + public static final String ALIAS_COL = "alias"; + public static final String TENANT_RANGE_COL = "tenantRange"; + public static final String IS_MULTI_TENANT_COL = "isMultiTenant"; + public static final String IAAS_COL = "iaas"; + public static final String STATUS_COL = "status"; + public static final String HOST_NAME_COL = "hostName"; + public static final String HYPERVISOR_COL = "hypervisor"; + public static final String RAM_COL = "ram"; + public static final String IMAGE_ID_COL = "imageId"; + public static final String LOGIN_PORT_COL = "loginPort"; + public static final String OS_NAME_COL = "osName"; + public static final String OS_VERSION_COL = "osVersion"; + public static final String OS_ARCH_COL = "osArch"; + public static final String OS_BIT_COL = "is64bitOS"; + public static final String PRIV_IP_COL = "privateIPAddresses"; + public static final String PUB_IP_COL = "publicIPAddresses"; + public static final String ALLOCATE_IP_COL = "allocateIPAddresses"; + public static final String TIME_STAMP = "timeStamp"; + public static final String SCALING_REASON = "scalingReason"; + public static final String SCALING_TIME = "scalingTime"; - /** - * Properties - */ - public static final String REGION_PROPERTY = "region"; - public static final String TOPICS_PROPERTY = "topics"; - public static final String PUBLIC_IP_PROPERTY = "public_ip"; - public static final String TENANT_ID_PROPERTY = "tenant_id"; - public static final String ALIAS_PROPERTY = "alias"; - public static final String AUTO_ASSIGN_IP_PROPERTY = "autoAssignIp"; - public static final String JCLOUDS_ENDPOINT = "jclouds.endpoint"; - public static final String CRON_PROPERTY = "cron"; - public static final String AMQP_CONNECTION_URL_PROPERTY = "amqpConnectionUrl"; - public static final String AMQP_INITIAL_CONTEXT_FACTORY_PROPERTY = "amqpInitialContextFactory"; - public static final String AMQP_TOPIC_CONNECTION_FACTORY_PROPERTY = "amqpTopicConnectionFactory"; - public static final String INSTANCE_TOPIC = "instance/*"; - // pre define a floating ip - public static final String FLOATING_IP_PROPERTY = "floatingIp"; - public static final String DEFAULT_FLOATING_IP_POOL = "defaultFloatingIpPool"; - public static final String OPENSTACK_NETWORKING_PROVIDER = "openstack.networking.provider"; - public static final String OPENSTACK_NEUTRON_NETWORKING = "neutron"; + /** + * Properties + */ + public static final String REGION_PROPERTY = "region"; + public static final String TOPICS_PROPERTY = "topics"; + public static final String PUBLIC_IP_PROPERTY = "public_ip"; + public static final String TENANT_ID_PROPERTY = "tenant_id"; + public static final String ALIAS_PROPERTY = "alias"; + public static final String AUTO_ASSIGN_IP_PROPERTY = "autoAssignIp"; + public static final String JCLOUDS_ENDPOINT = "jclouds.endpoint"; + public static final String CRON_PROPERTY = "cron"; + public static final String AMQP_CONNECTION_URL_PROPERTY = "amqpConnectionUrl"; + public static final String AMQP_INITIAL_CONTEXT_FACTORY_PROPERTY = "amqpInitialContextFactory"; + public static final String AMQP_TOPIC_CONNECTION_FACTORY_PROPERTY = "amqpTopicConnectionFactory"; + public static final String INSTANCE_TOPIC = "instance/*"; + // pre define a floating ip + public static final String FLOATING_IP_PROPERTY = "floatingIp"; + public static final String DEFAULT_FLOATING_IP_POOL = "defaultFloatingIpPool"; + public static final String OPENSTACK_NETWORKING_PROVIDER = "openstack.networking.provider"; + public static final String OPENSTACK_NEUTRON_NETWORKING = "neutron"; - /** - * XPath expressions - */ - public static final String IAAS_PROVIDER_XPATH = - "/" + CLOUD_CONTROLLER_ELEMENT + "/" + IAAS_PROVIDERS_ELEMENT + "/" + IAAS_PROVIDER_ELEMENT; - public static final String PARTITION_XPATH = - "/" + CLOUD_CONTROLLER_ELEMENT + "/" + PARTITIONS_ELEMENT + "/" + PARTITION_ELEMENT; - public static final String REGION_XPATH = - "/" + CLOUD_CONTROLLER_ELEMENT + "/" + IAAS_PROVIDERS_ELEMENT + "/" + IAAS_PROVIDER_ELEMENT + "/" + - REGION_ELEMENT; - public static final String ZONE_XPATH = - "/" + CLOUD_CONTROLLER_ELEMENT + "/" + IAAS_PROVIDERS_ELEMENT + "/" + IAAS_PROVIDER_ELEMENT + "/" + - REGION_ELEMENT + "/" + ZONE_ELEMENT; - public static final String HOST_XPATH = - "/" + CLOUD_CONTROLLER_ELEMENT + "/" + IAAS_PROVIDERS_ELEMENT + "/" + IAAS_PROVIDER_ELEMENT + "/" + - REGION_ELEMENT + "/" + ZONE_ELEMENT + "/" + HOST_ELEMENT; - public static final String PROPERTY_ELEMENT_XPATH = "/" + PROPERTY_ELEMENT; - public static final String IMAGE_ID_ELEMENT_XPATH = "/" + IMAGE_ID_ELEMENT; - public static final String SCALE_UP_ORDER_ELEMENT_XPATH = "/" + SCALE_UP_ORDER_ELEMENT; - public static final String SCALE_DOWN_ORDER_ELEMENT_XPATH = "/" + SCALE_DOWN_ORDER_ELEMENT; - public static final String PROVIDER_ELEMENT_XPATH = "/" + PROPERTY_ELEMENT; - public static final String IDENTITY_ELEMENT_XPATH = "/" + IDENTITY_ELEMENT; - public static final String CREDENTIAL_ELEMENT_XPATH = "/" + CREDENTIAL_ELEMENT; - public static final String SERVICES_ELEMENT_XPATH = "/" + SERVICES_ELEMENT + "/" + SERVICE_ELEMENT; - public static final String SERVICE_ELEMENT_XPATH = "/" + SERVICE_ELEMENT; - public static final String CARTRIDGE_ELEMENT_XPATH = "/" + CARTRIDGE_ELEMENT; - public static final String PAYLOAD_ELEMENT_XPATH = "/" + PAYLOAD_ELEMENT; - public static final String HOST_ELEMENT_XPATH = "/" + HOST_ELEMENT; - public static final String CARTRIDGES_ELEMENT_XPATH = "/" + CARTRIDGES_ELEMENT + "/" + CARTRIDGE_ELEMENT; - public static final String IAAS_PROVIDER_ELEMENT_XPATH = "/" + IAAS_PROVIDER_ELEMENT; - public static final String DEPLOYMENT_ELEMENT_XPATH = "/" + DEPLOYMENT_ELEMENT; - public static final String PORT_MAPPING_ELEMENT_XPATH = "/" + PORT_MAPPING_ELEMENT; - public static final String APP_TYPES_ELEMENT_XPATH = "/" + APP_TYPES_ELEMENT; + /** + * XPath expressions + */ + public static final String IAAS_PROVIDER_XPATH = + "/" + CLOUD_CONTROLLER_ELEMENT + "/" + IAAS_PROVIDERS_ELEMENT + "/" + IAAS_PROVIDER_ELEMENT; + public static final String PARTITION_XPATH = + "/" + CLOUD_CONTROLLER_ELEMENT + "/" + PARTITIONS_ELEMENT + "/" + PARTITION_ELEMENT; + public static final String REGION_XPATH = + "/" + CLOUD_CONTROLLER_ELEMENT + "/" + IAAS_PROVIDERS_ELEMENT + "/" + IAAS_PROVIDER_ELEMENT + "/" + + REGION_ELEMENT; + public static final String ZONE_XPATH = + "/" + CLOUD_CONTROLLER_ELEMENT + "/" + IAAS_PROVIDERS_ELEMENT + "/" + IAAS_PROVIDER_ELEMENT + "/" + + REGION_ELEMENT + "/" + ZONE_ELEMENT; + public static final String HOST_XPATH = + "/" + CLOUD_CONTROLLER_ELEMENT + "/" + IAAS_PROVIDERS_ELEMENT + "/" + IAAS_PROVIDER_ELEMENT + "/" + + REGION_ELEMENT + "/" + ZONE_ELEMENT + "/" + HOST_ELEMENT; + public static final String PROPERTY_ELEMENT_XPATH = "/" + PROPERTY_ELEMENT; + public static final String IMAGE_ID_ELEMENT_XPATH = "/" + IMAGE_ID_ELEMENT; + public static final String SCALE_UP_ORDER_ELEMENT_XPATH = "/" + SCALE_UP_ORDER_ELEMENT; + public static final String SCALE_DOWN_ORDER_ELEMENT_XPATH = "/" + SCALE_DOWN_ORDER_ELEMENT; + public static final String PROVIDER_ELEMENT_XPATH = "/" + PROPERTY_ELEMENT; + public static final String IDENTITY_ELEMENT_XPATH = "/" + IDENTITY_ELEMENT; + public static final String CREDENTIAL_ELEMENT_XPATH = "/" + CREDENTIAL_ELEMENT; + public static final String SERVICES_ELEMENT_XPATH = "/" + SERVICES_ELEMENT + "/" + SERVICE_ELEMENT; + public static final String SERVICE_ELEMENT_XPATH = "/" + SERVICE_ELEMENT; + public static final String CARTRIDGE_ELEMENT_XPATH = "/" + CARTRIDGE_ELEMENT; + public static final String PAYLOAD_ELEMENT_XPATH = "/" + PAYLOAD_ELEMENT; + public static final String HOST_ELEMENT_XPATH = "/" + HOST_ELEMENT; + public static final String CARTRIDGES_ELEMENT_XPATH = "/" + CARTRIDGES_ELEMENT + "/" + CARTRIDGE_ELEMENT; + public static final String IAAS_PROVIDER_ELEMENT_XPATH = "/" + IAAS_PROVIDER_ELEMENT; + public static final String DEPLOYMENT_ELEMENT_XPATH = "/" + DEPLOYMENT_ELEMENT; + public static final String PORT_MAPPING_ELEMENT_XPATH = "/" + PORT_MAPPING_ELEMENT; + public static final String APP_TYPES_ELEMENT_XPATH = "/" + APP_TYPES_ELEMENT; - public static final String DATA_PUBLISHER_XPATH = "/" + CLOUD_CONTROLLER_ELEMENT + "/" + DATA_PUBLISHER_ELEMENT; - public static final String TOPOLOGY_SYNC_XPATH = "/" + CLOUD_CONTROLLER_ELEMENT + "/" + TOPOLOGY_SYNC_ELEMENT; - public static final String DATA_PUBLISHER_CRON_XPATH = "/" + CLOUD_CONTROLLER_ELEMENT + "/" + CRON_ELEMENT; - public static final String BAM_SERVER_ADMIN_USERNAME_XPATH = - "/" + CLOUD_CONTROLLER_ELEMENT + "/" + BAM_SERVER_ADMIN_USERNAME_ELEMENT; - public static final String BAM_SERVER_ADMIN_PASSWORD_XPATH = - "/" + CLOUD_CONTROLLER_ELEMENT + "/" + BAM_SERVER_ADMIN_PASSWORD_ELEMENT; + public static final String DATA_PUBLISHER_XPATH = "/" + CLOUD_CONTROLLER_ELEMENT + "/" + DATA_PUBLISHER_ELEMENT; + public static final String TOPOLOGY_SYNC_XPATH = "/" + CLOUD_CONTROLLER_ELEMENT + "/" + TOPOLOGY_SYNC_ELEMENT; + public static final String DATA_PUBLISHER_CRON_XPATH = "/" + CLOUD_CONTROLLER_ELEMENT + "/" + CRON_ELEMENT; + public static final String BAM_SERVER_ADMIN_USERNAME_XPATH = + "/" + CLOUD_CONTROLLER_ELEMENT + "/" + BAM_SERVER_ADMIN_USERNAME_ELEMENT; + public static final String BAM_SERVER_ADMIN_PASSWORD_XPATH = + "/" + CLOUD_CONTROLLER_ELEMENT + "/" + BAM_SERVER_ADMIN_PASSWORD_ELEMENT; - /** - * Secret Manager related aliases. - */ - public static final String ALIAS_ATTRIBUTE = "secretAlias"; - public static final String ALIAS_ATTRIBUTE_PREFIX = "svns"; - public static final String ALIAS_NAMESPACE = "http://org.wso2.securevault/configuration"; + /** + * Secret Manager related aliases. + */ + public static final String ALIAS_ATTRIBUTE = "secretAlias"; + public static final String ALIAS_ATTRIBUTE_PREFIX = "svns"; + public static final String ALIAS_NAMESPACE = "http://org.wso2.securevault/configuration"; - /** - * Payload related constants - */ - public static final String PAYLOAD_NAME = "payload"; - public static final String ENTRY_SEPARATOR = ","; + /** + * Payload related constants + */ + public static final String PAYLOAD_NAME = "payload"; + public static final String ENTRY_SEPARATOR = ","; - /** - * Publisher task related constants - */ - public static final String DATA_PUB_TASK_TYPE = "CLOUD_CONTROLLER_DATA_PUBLISHER_TASK"; - // default is : data publisher will run in first second of every minute - public static final String PUB_CRON_EXPRESSION = "1 * * * * ? *"; - public static final String DATA_PUB_TASK_NAME = "CartridgeInstanceDataPublisher"; - public static final String DEFAULT_BAM_SERVER_USER_NAME = "admin"; - public static final String DEFAULT_BAM_SERVER_PASSWORD = "admin"; - public static final String DEFAULT_CASSANDRA_URL = "localhost:9160"; - public static final String DEFAULT_CASSANDRA_USER = "admin"; - public static final String DEFAULT_CASSANDRA_PASSWORD = "admin"; - public static final String DEFAULT_CASSANDRA_CLUSTER_NAME = "Test Cluster"; - public static final String DEFAULT_CASSANDRA_KEY_SPACE = "EVENT_KS"; + /** + * Publisher task related constants + */ + public static final String DATA_PUB_TASK_TYPE = "CLOUD_CONTROLLER_DATA_PUBLISHER_TASK"; + // default is : data publisher will run in first second of every minute + public static final String PUB_CRON_EXPRESSION = "1 * * * * ? *"; + public static final String DATA_PUB_TASK_NAME = "CartridgeInstanceDataPublisher"; + public static final String DEFAULT_BAM_SERVER_USER_NAME = "admin"; + public static final String DEFAULT_BAM_SERVER_PASSWORD = "admin"; + public static final String DEFAULT_CASSANDRA_URL = "localhost:9160"; + public static final String DEFAULT_CASSANDRA_USER = "admin"; + public static final String DEFAULT_CASSANDRA_PASSWORD = "admin"; + public static final String DEFAULT_CASSANDRA_CLUSTER_NAME = "Test Cluster"; + public static final String DEFAULT_CASSANDRA_KEY_SPACE = "EVENT_KS"; - /** - * Directories - */ - public static final String SERVICES_DIR = - CarbonUtils.getCarbonRepository() + File.separator + "services" + File.separator; + /** + * Directories + */ + public static final String SERVICES_DIR = + CarbonUtils.getCarbonRepository() + File.separator + "services" + File.separator; - /** - * Topology sync related constants - */ - public static final String TOPOLOGY_FILE_PATH = - CarbonUtils.getCarbonConfigDirPath() + File.separator + "service-topology.conf"; - public static final String TOPOLOGY_SYNC_CRON = "1 * * * * ? *"; - public static final String TOPOLOGY_SYNC_TASK_NAME = "TOPOLOGY_SYNC_TASK"; - public static final String TOPOLOGY_SYNC_TASK_TYPE = "TOPOLOGY_SYNC_TASK_TYPE"; - public static final String AMQP_CONNECTION_URL = - "amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5672'"; - public static final String AMQP_INITIAL_CONTEXT_FACTORY = "org.wso2.andes.jndi.PropertiesFileInitialContextFactory"; - public static final String AMQP_TOPIC_CONNECTION_FACTORY = "qpidConnectionfactory"; + /** + * Topology sync related constants + */ + public static final String TOPOLOGY_FILE_PATH = + CarbonUtils.getCarbonConfigDirPath() + File.separator + "service-topology.conf"; + public static final String TOPOLOGY_SYNC_CRON = "1 * * * * ? *"; + public static final String TOPOLOGY_SYNC_TASK_NAME = "TOPOLOGY_SYNC_TASK"; + public static final String TOPOLOGY_SYNC_TASK_TYPE = "TOPOLOGY_SYNC_TASK_TYPE"; + public static final String AMQP_CONNECTION_URL = + "amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5672'"; + public static final String AMQP_INITIAL_CONTEXT_FACTORY = "org.wso2.andes.jndi.PropertiesFileInitialContextFactory"; + public static final String AMQP_TOPIC_CONNECTION_FACTORY = "qpidConnectionfactory"; - /** - * Persistence - */ - public static final String DATA_RESOURCE = "/cloud.controller/data"; - public static final String TOPOLOGY_RESOURCE = "/cloud.controller/topology"; - public static final String AVAILABILITY_ZONE = "availabilityZone"; - public static final String KEY_PAIR = "keyPair"; - public static final String HOST = "host"; - public static final String SECURITY_GROUP_IDS = "securityGroupIds"; - public static final String SECURITY_GROUPS = "securityGroups"; - public static final String SUBNET_ID = "subnetId"; - public static final String TAGS = "tags"; - public static final String TAGS_AS_KEY_VALUE_PAIRS_PREFIX = "tag:"; - public static final String AUTO_ASSIGN_IP = "autoAssignIp"; - public static final String BLOCK_UNTIL_RUNNING = "blockUntilRunning"; - public static final String INSTANCE_TYPE = "instanceType"; - public static final String ASSOCIATE_PUBLIC_IP_ADDRESS = "associatePublicIpAddress"; - public static final String LB_CLUSTER_ID_COL = "lbclusterId"; - public static final String NETWORK_INTERFACES = "networkInterfaces"; - public static final String NETWORK_FIXED_IP = "fixedIp"; - public static final String NETWORK_PORT = "portUuid"; - public static final String NETWORK_UUID = "networkUuid"; + /** + * Persistence + */ + public static final String DATA_RESOURCE = "/cloud.controller/data"; + public static final String TOPOLOGY_RESOURCE = "/cloud.controller/topology"; + public static final String AVAILABILITY_ZONE = "availabilityZone"; + public static final String KEY_PAIR = "keyPair"; + public static final String HOST = "host"; + public static final String SECURITY_GROUP_IDS = "securityGroupIds"; + public static final String SECURITY_GROUPS = "securityGroups"; + public static final String SUBNET_ID = "subnetId"; + public static final String TAGS = "tags"; + public static final String TAGS_AS_KEY_VALUE_PAIRS_PREFIX = "tag:"; + public static final String AUTO_ASSIGN_IP = "autoAssignIp"; + public static final String BLOCK_UNTIL_RUNNING = "blockUntilRunning"; + public static final String INSTANCE_TYPE = "instanceType"; + public static final String ASSOCIATE_PUBLIC_IP_ADDRESS = "associatePublicIpAddress"; + public static final String LB_CLUSTER_ID_COL = "lbclusterId"; + public static final String NETWORK_INTERFACES = "networkInterfaces"; + public static final String NETWORK_FIXED_IP = "fixedIp"; + public static final String NETWORK_PORT = "portUuid"; + public static final String NETWORK_UUID = "networkUuid"; - // CloudStack specific - public static final String USER_NAME = "username"; - public static final String DOMAIN_ID = "domainId"; - public static final String DISK_OFFERING = "diskOffering"; - public static final String NETWORK_IDS = "networkIds"; + // CloudStack specific + public static final String USER_NAME = "username"; + public static final String DOMAIN_ID = "domainId"; + public static final String DISK_OFFERING = "diskOffering"; + public static final String NETWORK_IDS = "networkIds"; - public static final String IS_LOAD_BALANCER = "load.balancer"; + public static final String IS_LOAD_BALANCER = "load.balancer"; - /** - * PortRange min max - */ - public static final int PORT_RANGE_MAX = 65535; - public static final int PORT_RANGE_MIN = 1; + /** + * PortRange min max + */ + public static final int PORT_RANGE_MAX = 65535; + public static final int PORT_RANGE_MIN = 1; - public static final String KUBERNETES_PARTITION_PROVIDER = "kubernetes"; + public static final String KUBERNETES_PARTITION_PROVIDER = "kubernetes"; - /** - * Load balancing ip type enumeration values - */ - public static final String LOADBALANCING_IP_TYPE_PRIVATE = "private"; - public static final String LOADBALANCING_IP_TYPE_PUBLIC = "public"; + /** + * Load balancing ip type enumeration values + */ + public static final String LOADBALANCING_IP_TYPE_PRIVATE = "private"; + public static final String LOADBALANCING_IP_TYPE_PUBLIC = "public"; }
