GigaSpaces XAP 9.7.2 API

org.openspaces.admin.pu.elastic.config
Class AutomaticCapacityScaleConfig

java.lang.Object
  extended by org.openspaces.admin.pu.elastic.config.AutomaticCapacityScaleConfig
All Implemented Interfaces:
Externalizable, Serializable, BeanConfig, ScaleStrategyAgentZonesAwareConfig, ScaleStrategyConfig

public class AutomaticCapacityScaleConfig
extends Object
implements ScaleStrategyConfig, ScaleStrategyAgentZonesAwareConfig, Externalizable

Defines an automatic scaling strategy that increases and decreases capacity. The trigger is when a monitored values crosses a threshold

Since:
9.0
Author:
itaif
See Also:
AutomaticCapacityScaleConfigurer, Serialized Form

Constructor Summary
AutomaticCapacityScaleConfig()
          Default constructor
AutomaticCapacityScaleConfig(Map<String,String> properties)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getBeanClassName()
          The Bean implementation class name corresponding to this BeanConfig.
 long getCooldownAfterScaleInSeconds()
           
 long getCooldownAfterScaleOutSeconds()
           
 long getCooldownAfterScaleSeconds()
          Deprecated. 
 CapacityRequirementsConfig getInitialCapacity()
           
 CapacityRequirementsConfig getMaxCapacity()
           
 CapacityRequirementsConfig getMaxCapacityPerZone()
           
 int getMaxConcurrentRelocationsPerMachine()
           
 CapacityRequirementsConfig getMinCapacity()
           
 CapacityRequirementsConfig getMinCapacityPerZone()
           
 int getPollingIntervalSeconds()
           
 Map<String,String> getProperties()
          Get the String key-value pairs properties used to configure this bean.
 AutomaticCapacityScaleRuleConfig[] getRules()
           
 long getStatisticsPollingIntervalSeconds()
           
 int hashCode()
           
 boolean isAllowAboveAverageMemoryPerMachine()
           
 boolean isAtMostOneConcurrentRelocation()
           
 boolean isAtMostOneContainerPerMachine()
           
 boolean isGridServiceAgentZonesAware()
           
 void readExternal(ObjectInput in)
           
 void setAllowAboveAverageMemoryPerMachine(boolean allowAboveAverageMemoryPerMachine)
          Allows a single machine to accommodate for more than the average maximum memory allocation of a Processing Unit.
 void setAtMostOneConcurrentRelocation(boolean atMostOneConcurrentRelocation)
          Limits the number of concurrent relocations for the entire cluster to 1.
 void setAtMostOneContainerPerMachine(boolean atMostOneContainerPerMachine)
          When set to true, at most one Grid Service Container for this Processing Unit is started per machine.
 void setCooldownAfterScaleInSeconds(long cooldownAfterInstanceRemovedSeconds)
          Sets the number of seconds after a ProcessingUnitInstance is removed and the ProcessingUnit.getStatus() is DeploymentStatus.INTACT that all scaling rules are disabled.
 void setCooldownAfterScaleOutSeconds(long cooldownAfterInstanceAddedSeconds)
          Sets the number of seconds after a ProcessingUnitInstance is added and the ProcessingUnit.getStatus() is DeploymentStatus.INTACT that all scaling rules are disabled.
 void setCooldownAfterScaleSeconds(long cooldownAfterInstanceRemovedSeconds)
          Deprecated. 
 void setGridServiceAgentZonesAware(boolean enableAgentZonesAware)
          By default disabled, which means that the following machines: - Machines started due to failover of another machine
 void setInitialCapacity(CapacityRequirementsConfig initialCapacity)
           
 void setMaxCapacity(CapacityRequirementsConfig maxCapacity)
          Sets the maximum scale capacity that the @{link ProcessingUnit is deployed with.
 void setMaxCapacityPerZone(CapacityRequirementsConfig maxCapacityPerZone)
          Sets the maximum scale capacity per agent zone that the @{link ProcessingUnit is deployed with.
 void setMaxConcurrentRelocationsPerMachine(int maxNumberOfConcurrentRelocationsPerMachine)
          Specifies the number of processing unit instance relocations each machine can handle concurrently.
 void setMinCapacity(CapacityRequirementsConfig minCapacity)
          Sets the minimum scale capacity that the @{link ProcessingUnit is deployed with.
 void setMinCapacityPerZone(CapacityRequirementsConfig minCapacityPerZone)
          Sets the minimum scale capacity per agent zone that the @{link ProcessingUnit is deployed with.
 void setPollingIntervalSeconds(int pollingTimeIntervalSeconds)
          Sets the polling interval in which the scale strategy SLA is monitored and enforced.
 void setProperties(Map<String,String> properties)
          Set with String key-value pairs to configure properties belonging to this bean.
 void setRules(AutomaticCapacityScaleRuleConfig[] rules)
           
 void setStatisticsPollingIntervalSeconds(int statisticsPollingIntervalSeconds)
          Sets the polling rate in which statistics are gathered.
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AutomaticCapacityScaleConfig

public AutomaticCapacityScaleConfig()
Default constructor


AutomaticCapacityScaleConfig

public AutomaticCapacityScaleConfig(Map<String,String> properties)
Method Detail

getProperties

public Map<String,String> getProperties()
Description copied from interface: BeanConfig
Get the String key-value pairs properties used to configure this bean.

Specified by:
getProperties in interface BeanConfig
Returns:
the properties used to configure this bean object.

setProperties

public void setProperties(Map<String,String> properties)
Description copied from interface: BeanConfig
Set with String key-value pairs to configure properties belonging to this bean. Overrides all previously set properties.

Specified by:
setProperties in interface BeanConfig
Parameters:
properties - the properties to configure this bean object.

getBeanClassName

public String getBeanClassName()
Description copied from interface: BeanConfig
The Bean implementation class name corresponding to this BeanConfig.

Specified by:
getBeanClassName in interface BeanConfig
Returns:
the name of the admin Bean implementation class.

getMaxConcurrentRelocationsPerMachine

public int getMaxConcurrentRelocationsPerMachine()
Specified by:
getMaxConcurrentRelocationsPerMachine in interface ScaleStrategyConfig

setMaxConcurrentRelocationsPerMachine

public void setMaxConcurrentRelocationsPerMachine(int maxNumberOfConcurrentRelocationsPerMachine)
Description copied from interface: ScaleStrategyConfig
Specifies the number of processing unit instance relocations each machine can handle concurrently. Relocation requires network and CPU resources, and too many concurrent relocations per machine may degrade its performance temporarily. The data recovery running as part of the relocation uses by default 4 threads. So the total number of threads is 4 multiplied by the specified value. By setting this value higher than 1, processing unit rebalancing completes faster, by using more machine cpu and network resources. Default value is 1. This is an advanced property setting.

Specified by:
setMaxConcurrentRelocationsPerMachine in interface ScaleStrategyConfig

setAtMostOneConcurrentRelocation

public void setAtMostOneConcurrentRelocation(boolean atMostOneConcurrentRelocation)
Description copied from interface: ScaleStrategyConfig
Limits the number of concurrent relocations for the entire cluster to 1. Notice this is an aggregated property across all machines.

Specified by:
setAtMostOneConcurrentRelocation in interface ScaleStrategyConfig
See Also:
ScaleStrategyConfig.setMaxConcurrentRelocationsPerMachine(int)

isAtMostOneConcurrentRelocation

public boolean isAtMostOneConcurrentRelocation()
Specified by:
isAtMostOneConcurrentRelocation in interface ScaleStrategyConfig

setAllowAboveAverageMemoryPerMachine

public void setAllowAboveAverageMemoryPerMachine(boolean allowAboveAverageMemoryPerMachine)
Description copied from interface: ScaleStrategyConfig
Allows a single machine to accommodate for more than the average maximum memory allocation of a Processing Unit. The average is calculated like so : (memoryCapacityPerContainer * totalNumberOfProcessingUnitInstances) / minimumNumberOfMachines

Specified by:
setAllowAboveAverageMemoryPerMachine in interface ScaleStrategyConfig

isAllowAboveAverageMemoryPerMachine

public boolean isAllowAboveAverageMemoryPerMachine()
Specified by:
isAllowAboveAverageMemoryPerMachine in interface ScaleStrategyConfig

setPollingIntervalSeconds

public void setPollingIntervalSeconds(int pollingTimeIntervalSeconds)
Description copied from interface: ScaleStrategyConfig
Sets the polling interval in which the scale strategy SLA is monitored and enforced.

Specified by:
setPollingIntervalSeconds in interface ScaleStrategyConfig
Parameters:
pollingTimeIntervalSeconds - - the polling interval in seconds

getPollingIntervalSeconds

public int getPollingIntervalSeconds()
Specified by:
getPollingIntervalSeconds in interface ScaleStrategyConfig

isAtMostOneContainerPerMachine

public boolean isAtMostOneContainerPerMachine()
Specified by:
isAtMostOneContainerPerMachine in interface ScaleStrategyConfig

setAtMostOneContainerPerMachine

public void setAtMostOneContainerPerMachine(boolean atMostOneContainerPerMachine)
Description copied from interface: ScaleStrategyConfig
When set to true, at most one Grid Service Container for this Processing Unit is started per machine.

Specified by:
setAtMostOneContainerPerMachine in interface ScaleStrategyConfig

setStatisticsPollingIntervalSeconds

public void setStatisticsPollingIntervalSeconds(int statisticsPollingIntervalSeconds)
Sets the polling rate in which statistics are gathered.


getStatisticsPollingIntervalSeconds

public long getStatisticsPollingIntervalSeconds()

setCooldownAfterScaleOutSeconds

public void setCooldownAfterScaleOutSeconds(long cooldownAfterInstanceAddedSeconds)
Sets the number of seconds after a ProcessingUnitInstance is added and the ProcessingUnit.getStatus() is DeploymentStatus.INTACT that all scaling rules are disabled. Must be equal or bigger than setStatisticsPollingIntervalSeconds(int)


getCooldownAfterScaleOutSeconds

public long getCooldownAfterScaleOutSeconds()

setCooldownAfterScaleSeconds

@Deprecated
public void setCooldownAfterScaleSeconds(long cooldownAfterInstanceRemovedSeconds)
Deprecated. 

See Also:
setCooldownAfterScaleInSeconds(long)

setCooldownAfterScaleInSeconds

public void setCooldownAfterScaleInSeconds(long cooldownAfterInstanceRemovedSeconds)
Sets the number of seconds after a ProcessingUnitInstance is removed and the ProcessingUnit.getStatus() is DeploymentStatus.INTACT that all scaling rules are disabled. Must be equal or bigger than setStatisticsPollingIntervalSeconds(int)


getCooldownAfterScaleSeconds

@Deprecated
public long getCooldownAfterScaleSeconds()
Deprecated. 

See Also:
getCooldownAfterScaleInSeconds()

getCooldownAfterScaleInSeconds

public long getCooldownAfterScaleInSeconds()

setMinCapacity

public void setMinCapacity(CapacityRequirementsConfig minCapacity)
Sets the minimum scale capacity that the @{link ProcessingUnit is deployed with. The result of a scaling rule result that decreases capacity will never breach the minimum scale capacity.


getMinCapacity

public CapacityRequirementsConfig getMinCapacity()

setMaxCapacity

public void setMaxCapacity(CapacityRequirementsConfig maxCapacity)
Sets the maximum scale capacity that the @{link ProcessingUnit is deployed with. The result of a scaling rule result that increases capacity will never breach the maximum scale capacity.


getMinCapacityPerZone

public CapacityRequirementsConfig getMinCapacityPerZone()

setMinCapacityPerZone

public void setMinCapacityPerZone(CapacityRequirementsConfig minCapacityPerZone)
Sets the minimum scale capacity per agent zone that the @{link ProcessingUnit is deployed with. The result of a scaling rule result that increases capacity will never breach the minimum scale capacity per agent zone. This attribute should be used together with setGridServiceAgentZonesAware(boolean) enabled.


getMaxCapacityPerZone

public CapacityRequirementsConfig getMaxCapacityPerZone()

setMaxCapacityPerZone

public void setMaxCapacityPerZone(CapacityRequirementsConfig maxCapacityPerZone)
Sets the maximum scale capacity per agent zone that the @{link ProcessingUnit is deployed with. The result of a scaling rule result that increases capacity will never breach the maximum scale capacity per agent zone. This attribute should be used together with setGridServiceAgentZonesAware(boolean) enabled.


setRules

public void setRules(AutomaticCapacityScaleRuleConfig[] rules)

getRules

public AutomaticCapacityScaleRuleConfig[] getRules()

getMaxCapacity

public CapacityRequirementsConfig getMaxCapacity()

setInitialCapacity

public void setInitialCapacity(CapacityRequirementsConfig initialCapacity)

getInitialCapacity

public CapacityRequirementsConfig getInitialCapacity()

isGridServiceAgentZonesAware

public boolean isGridServiceAgentZonesAware()
Specified by:
isGridServiceAgentZonesAware in interface ScaleStrategyAgentZonesAwareConfig

setGridServiceAgentZonesAware

public void setGridServiceAgentZonesAware(boolean enableAgentZonesAware)
Description copied from interface: ScaleStrategyAgentZonesAwareConfig
By default disabled, which means that the following machines: - Machines started due to failover of another machine. - Machines started by AutomaticCapacityScaleRuleConfig sue to threshold breach are started with a Grid Service Agent zones as described in #getGridServiceAgentZones() When enabled, these machines are started with the same ExactZonesConfig as the failed machine, or the same ExactZonesConfig as the machines whose threshold was breached.

Specified by:
setGridServiceAgentZonesAware in interface ScaleStrategyAgentZonesAwareConfig

toString

public String toString()
Specified by:
toString in interface ScaleStrategyConfig
Overrides:
toString in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface ScaleStrategyConfig
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Specified by:
equals in interface ScaleStrategyConfig
Overrides:
equals in class Object

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.