GigaSpaces XAP 8.0 API

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

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

public class ManualCapacityScaleConfig
extends Object
implements ScaleStrategyConfig, Externalizable

Defines a manual scaling strategy that consumes the specified memory capacity. When enabled the processing unit scales out whenever the specified memory capacity deviates from the actual memory capacity. When a backup partition is enabled (which usually is the case), the specified memory capacity is the total memory occupied by the primary partition instances and the backup partition instances.

Since:
8.0
Author:
itaif
See Also:
ManualCapacityScaleConfigurer, Serialized Form

Constructor Summary
ManualCapacityScaleConfig()
          Default constructor
ManualCapacityScaleConfig(Map<String,String> properties)
           
 
Method Summary
 boolean equals(Object other)
           
 String getBeanClassName()
          The Bean implementation class name corresponding to this BeanConfig.
 Map<String,Long> getDrivesCapacityInMB()
           
 int getMaxConcurrentRelocationsPerMachine()
           
 long getMemoryCapacityInMB()
           
 double getNumberOfCpuCores()
           
 int getPollingIntervalSeconds()
           
 Map<String,String> getProperties()
          Get the String key-value pairs properties used to configure this bean.
 int hashCode()
           
 boolean isAtMostOneContainersPerMachine()
           
 void readExternal(ObjectInput in)
           
 void setAtMostOneContainerPerMachine(boolean atMostOneContainerPerMachine)
          When set to true, at most one Grid Service Container for this Processing Unit is started per machine.
 void setDrivesCapacityInMB(Map<String,Long> megaBytesPerDrive)
          Specifies the disk and network drive capacity needed by the processing unit.
 void setMaxConcurrentRelocationsPerMachine(int maxNumberOfConcurrentRelocationsPerMachine)
          Specifies the number of processing unit instance relocations each machine can handle concurrently.
 void setMemoryCapacityInMB(long memory)
          Specifies the total memory capacity of the processing unit.
 void setNumberOfCpuCores(double cpuCores)
          Specifies the total CPU cores for the processing unit.
 void setPollingIntervalSeconds(int seconds)
          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.
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManualCapacityScaleConfig

public ManualCapacityScaleConfig()
Default constructor


ManualCapacityScaleConfig

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

setMemoryCapacityInMB

public void setMemoryCapacityInMB(long memory)
Specifies the total memory capacity of the processing unit.


getMemoryCapacityInMB

public long getMemoryCapacityInMB()
                           throws NumberFormatException
Throws:
NumberFormatException

setNumberOfCpuCores

public void setNumberOfCpuCores(double cpuCores)
Specifies the total CPU cores for the processing unit.


getNumberOfCpuCores

public double getNumberOfCpuCores()

setPollingIntervalSeconds

public void setPollingIntervalSeconds(int seconds)
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:
seconds - - the polling interval in seconds

getPollingIntervalSeconds

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

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

isAtMostOneContainersPerMachine

public boolean isAtMostOneContainersPerMachine()

setAtMostOneContainerPerMachine

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

Since:
8.0.3

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.

toString

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

setDrivesCapacityInMB

public void setDrivesCapacityInMB(Map<String,Long> megaBytesPerDrive)
Specifies the disk and network drive capacity needed by the processing unit.

Parameters:
megaBytesPerDrive - - a mapping between the file system directory representing the drive and its capacity (in mega-bytes) needed by the pu . For example the drive "/" (on linux) has the size of 50*1024MBs or the drive "c:\" (on windows) has the size of 50*1024MBs
Since:
8.0.3

getDrivesCapacityInMB

public Map<String,Long> getDrivesCapacityInMB()
                                       throws NumberFormatException
Throws:
NumberFormatException

equals

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

hashCode

public int hashCode()
Specified by:
hashCode in interface ScaleStrategyConfig
Overrides:
hashCode 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 8.0 API

Copyright © GigaSpaces.