GigaSpaces XAP 7.0 API

org.openspaces.pu.sla
Class SLA

java.lang.Object
  extended by org.openspaces.pu.sla.SLA
All Implemented Interfaces:
Serializable

public class SLA
extends Object
implements Serializable

A set of definitions controlling the nature of a processing unit deployment on the Service Grid.

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:
Serialized Form

Constructor Summary
SLA()
           
 
Method Summary
 String getClusterSchema()
          Returns the cluster schema the processing unit will use.
 List<InstanceSLA> getInstanceSLAs()
           
 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.
 int getMaxInstancesPerVM()
          Returns the maximum number of instances of the processing unit allowed to run within the same grid container.
 Map<String,Integer> getMaxInstancesPerZone()
           
 MemberAliveIndicator getMemberAliveIndicator()
           
 List<Monitor> getMonitors()
          Returns a list of monitors can be used to monitor different runtime aspects of the processing unit.
 int getNumberOfBackups()
          Returns the number of backups that each primary instance will have in a cluster.
 int getNumberOfInstances()
          Returns the number of primary instances that are running within the cluster.
 Policy 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.
 List<Requirement> getRequirements()
          Returns a list of requirements that control if a certain processing unit instance will be deployed to a grid container.
 void setClusterSchema(String clusterSchema)
          Sets the cluster schema the processing unit will use.
 void setInstanceSLAs(List<InstanceSLA> instanceSLAs)
           
 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.
 void setMaxInstancesPerVM(int maxInstancesPerVM)
          Sets the maximum number of instances of the processing unit allowed to run within the same grid container.
 void setMaxInstancesPerZone(Map<String,Integer> maxInstancesPerZone)
           
 void setMaxInstancesPerZoneAsString(String maxInstancesPerZone)
           
 void setMemberAliveIndicator(MemberAliveIndicator memberAliveIndicator)
           
 void setMonitors(List<Monitor> monitors)
          Sets a list of monitors can be used to monitor different runtime aspects of the processing unit.
 void setNumberOfBackups(int numberOfBackups)
          Sets the number of backups that each primary instance will have in a cluster.
 void setNumberOfInstances(int numberOfInstances)
          Sets the number of primary instances that are running within the cluster.
 void setPolicy(Policy policy)
          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.
 void setRequirements(List<Requirement> requirements)
          Sets a list of requirements that control if a certain processing unit instance will be deployed to a grid container.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SLA

public SLA()
Method Detail

getClusterSchema

public String getClusterSchema()
Returns the cluster schema the processing unit will use. Usually maps to the space cluster schema. Can have null value which means that it was not set.

See Also:
ClusterInfo.getSchema()

setClusterSchema

public void setClusterSchema(String clusterSchema)
Sets the cluster schema the processing unit will use. Usually maps to the space cluster schema. Can have null value which means that it was not set.

See Also:
ClusterInfo.setSchema(String)

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 by numberOfBackups. Defaults to 1.

See Also:
ClusterInfo.getNumberOfInstances()

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 by numberOfBackups. . Defaults to 1.


getNumberOfBackups

public int getNumberOfBackups()
Returns the number of backups that each primary instance will have in a cluster. Can have 0 value which means that it was not set and should not be taken into account. Defaults to 0.


setNumberOfBackups

public void setNumberOfBackups(int numberOfBackups)
Sets the number of backups that each primary instance will have in a cluster. Can have 0 value which means that it was not set and should not be taken into account. Defaults to 0.


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

public Map<String,Integer> getMaxInstancesPerZone()

setMaxInstancesPerZone

public void setMaxInstancesPerZone(Map<String,Integer> maxInstancesPerZone)

setMaxInstancesPerZoneAsString

public void setMaxInstancesPerZoneAsString(String maxInstancesPerZone)

getPolicy

public Policy 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

public void setPolicy(Policy policy)
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

public List<Requirement> 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

public void setRequirements(List<Requirement> requirements)
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.


getMonitors

public List<Monitor> 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 certain Policy that is set.


setMonitors

public void setMonitors(List<Monitor> monitors)
Sets a list of 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.


getInstanceSLAs

public List<InstanceSLA> getInstanceSLAs()

setInstanceSLAs

public void setInstanceSLAs(List<InstanceSLA> instanceSLAs)

getMemberAliveIndicator

public MemberAliveIndicator getMemberAliveIndicator()

setMemberAliveIndicator

public void setMemberAliveIndicator(MemberAliveIndicator memberAliveIndicator)

toString

public String toString()
Overrides:
toString in class Object

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.