Class SLA

java.lang.Object
org.openspaces.pu.sla.SLA
All Implemented Interfaces:
Serializable, org.springframework.beans.factory.InitializingBean

public class SLA extends Object implements Serializable, org.springframework.beans.factory.InitializingBean
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:
  • Constructor Details

    • SLA

      public SLA()
  • Method Details

    • 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:
    • 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:
    • 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:
    • 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.
    • getPrimaryZone

      public String getPrimaryZone()
    • setPrimaryZone

      public void setPrimaryZone(String primaryZone)
    • 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

      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
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception