Class SLA
- All Implemented Interfaces:
Serializable,org.springframework.beans.factory.InitializingBean
The SLA allows to control a clustered deployment which maps to ClusterInfo. The clusterSchema, numberOfInstances, and numberOfBackups control the cluster topology. Note that it is up to the
user to defined the correct values according to the chosen cluster schema. For example, when
using partitioned schema, the number of backups should not be set (or set to 0).
The SLA is translated into one or more service bean definitions, each can have one or more instances. When having one or more backups, a service bean definition will be created for each primary and its backups group. So, in case of 2 instances with 1 backup, two service bean definition will be created, one for the first instance and its backup, and the second for the second instance and its backup.
Max instances per VM can also be set which using setMaxInstancesPerVM(int). It
controls how many instances of a specific deployment will be created within a grid container.
This is very beneficial when using primary with backup where we would not want the primary to run
in the same VM as the backup.
A list of monitors can be added to the SLA. The
monitors can be used to monitor different runtime aspects of the processing unit. They can
then be used to affect certain Policy that is set.
A list of Requirements can also be added
to the SLA. The requirements control if a certain processing unit instance will be
deployed to a grid container. It will only be deployed if the grid container meets the
specified requirements.
A Policy can be set on the SLA to control the actions the
grid container should take in case the policy associated monitor value breach the policy
thresholds.
- Author:
- kimchy
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns the cluster schema the processing unit will use.intReturns the maximum number of instances of the processing unit allowed to run on the same machine, regardless of the number of grid containers running on it.intReturns the maximum number of instances of the processing unit allowed to run within the same grid container.Returns a list of monitors can be used to monitor different runtime aspects of the processing unit.intReturns the number of backups that each primary instance will have in a cluster.intReturns the number of primary instances that are running within the cluster.Returns the policy associated with the SLA controlling the runtime policy on the action needed to be taken when the monitor associated with the policy breaks the policy thresholds.Returns a list of requirements that control if a certain processing unit instance will be deployed to a grid container.booleanvoidsetClusterSchema(String clusterSchema) Sets the cluster schema the processing unit will use.voidsetInstanceSLAs(List<InstanceSLA> instanceSLAs) voidsetMaxInstancesPerMachine(int maxInstancesPerMachine) Sets the maximum number of instances of the processing unit allowed to run on the same machine, regardless of the number of grid containers running on it.voidsetMaxInstancesPerVM(int maxInstancesPerVM) Sets the maximum number of instances of the processing unit allowed to run within the same grid container.voidsetMaxInstancesPerZone(Map<String, Integer> maxInstancesPerZone) voidsetMaxInstancesPerZoneAsString(String maxInstancesPerZone) voidsetMemberAliveIndicator(MemberAliveIndicator memberAliveIndicator) voidsetMonitors(List<Monitor> monitors) Sets a list of monitors can be used to monitor different runtime aspects of the processing unit.voidsetNumberOfBackups(int numberOfBackups) Sets the number of backups that each primary instance will have in a cluster.voidsetNumberOfInstances(int numberOfInstances) Sets the number of primary instances that are running within the cluster.voidSets the policy associated with the SLA controlling the runtime policy on the action needed to be taken when the monitor associated with the policy breaks the policy thresholds.voidsetPrimaryZone(String primaryZone) voidsetRequirements(List<Requirement> requirements) Sets a list of requirements that control if a certain processing unit instance will be deployed to a grid container.voidsetRequiresIsolation(boolean requiresIsolation) toString()
-
Constructor Details
-
SLA
public SLA()
-
-
Method Details
-
getClusterSchema
Returns the cluster schema the processing unit will use. Usually maps to the space cluster schema. Can havenullvalue which means that it was not set.- See Also:
-
setClusterSchema
Sets the cluster schema the processing unit will use. Usually maps to the space cluster schema. Can havenullvalue which means that it was not set.- See Also:
-
getNumberOfInstances
public int getNumberOfInstances()Returns the number of primary instances that are running within the cluster. Note, this are the number of primary instances. Each instance might also have one or more backups that are set bynumberOfBackups. Defaults to1.- See Also:
-
setNumberOfInstances
public void setNumberOfInstances(int numberOfInstances) Sets the number of primary instances that are running within the cluster. Note, this are the number of primary instances. Each instance might also have one or more backups that are set bynumberOfBackups. . Defaults to1. -
getNumberOfBackups
public int getNumberOfBackups()Returns the number of backups that each primary instance will have in a cluster. Can have0value which means that it was not set and should not be taken into account. Defaults to0. -
setNumberOfBackups
public void setNumberOfBackups(int numberOfBackups) Sets the number of backups that each primary instance will have in a cluster. Can have0value which means that it was not set and should not be taken into account. Defaults to0. -
getMaxInstancesPerVM
public int getMaxInstancesPerVM()Returns the maximum number of instances of the processing unit allowed to run within the same grid container.Note, when using number of backups higher than 0, this value only applies to a primary with its backups group.
-
setMaxInstancesPerVM
public void setMaxInstancesPerVM(int maxInstancesPerVM) Sets the maximum number of instances of the processing unit allowed to run within the same grid container.Note, when using number of backups higher than 0, this value only applies to a primary with its backups group.
-
getMaxInstancesPerMachine
public int getMaxInstancesPerMachine()Returns the maximum number of instances of the processing unit allowed to run on the same machine, regardless of the number of grid containers running on it.Note, when using number of backups higher than 0, this value only applies to a primary with its backups group.
-
setMaxInstancesPerMachine
public void setMaxInstancesPerMachine(int maxInstancesPerMachine) Sets the maximum number of instances of the processing unit allowed to run on the same machine, regardless of the number of grid containers running on it.Note, when using number of backups higher than 0, this value only applies to a primary with its backups group.
-
getMaxInstancesPerZone
-
setMaxInstancesPerZone
-
setMaxInstancesPerZoneAsString
-
getPolicy
Returns the policy associated with the SLA controlling the runtime policy on the action needed to be taken when the monitor associated with the policy breaks the policy thresholds. -
setPolicy
Sets the policy associated with the SLA controlling the runtime policy on the action needed to be taken when the monitor associated with the policy breaks the policy thresholds. -
getRequirements
Returns a list of requirements that control if a certain processing unit instance will be deployed to a grid container. It will only be deployed if the grid container meets the specified requirements. -
setRequirements
Sets a list of requirements that control if a certain processing unit instance will be deployed to a grid container. It will only be deployed if the grid container meets the specified requirements. -
getPrimaryZone
-
setPrimaryZone
-
isRequiresIsolation
public boolean isRequiresIsolation()- Returns:
- true if isolation is required per virtual machine. No processing unit instances can run on the same virtual machine. Default false.
- Since:
- 10.1.0
-
setRequiresIsolation
public void setRequiresIsolation(boolean requiresIsolation) - Parameters:
requiresIsolation- set true if isolation is required per virtual machine. No processing unit instances can run on the same virtual machine. Default false.- Since:
- 10.1.0
-
getMonitors
Returns a list of monitors can be used to monitor different runtime aspects of the processing unit. They can then be used to affect certainPolicythat is set. -
setMonitors
Sets a list of monitors can be used to monitor different runtime aspects of the processing unit. They can then be used to affect certainPolicythat is set. -
getInstanceSLAs
-
setInstanceSLAs
-
getMemberAliveIndicator
-
setMemberAliveIndicator
-
toString
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-