GigaSpaces XAP 9.1 API

org.openspaces.grid.gsm.strategy
Class AbstractCapacityScaleStrategyBean

java.lang.Object
  extended by org.openspaces.grid.gsm.strategy.AbstractScaleStrategyBean
      extended by org.openspaces.grid.gsm.strategy.AbstractCapacityScaleStrategyBean
All Implemented Interfaces:
Runnable, Bean, ContainersSlaEnforcementEndpointAware, ElasticMachineProvisioningAware, GridServiceContainerConfigAware, ElasticProcessingUnitMachineIsolationAware, MachinesSlaEnforcementEndpointAware, ProcessingUnitAware, RebalancingSlaEnforcementEndpointAware, ElasticScaleStrategyEventStorageAware, ScaleStrategyBean
Direct Known Subclasses:
AutomaticCapacityScaleStrategyBean, ManualCapacityPerZonesScaleStrategyBean, ManualCapacityScaleStrategyBean

public abstract class AbstractCapacityScaleStrategyBean
extends AbstractScaleStrategyBean
implements GridServiceContainerConfigAware, RebalancingSlaEnforcementEndpointAware, ContainersSlaEnforcementEndpointAware, MachinesSlaEnforcementEndpointAware

A class for code reuse between ManualCapacityScaleStrategyBean and AutomaticCapacityScaleStrategyBean

Since:
9.0.0
Author:
itaif

Constructor Summary
AbstractCapacityScaleStrategyBean()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a bean factory after it has set all bean properties.
protected  long calcRoundedTotalMemoryInMB()
           
protected  void enforcePlannedCapacity()
           
 CapacityRequirementsPerZones getAllocatedCapacity()
           
protected  ZonesConfig getDefaultZones()
           
 org.openspaces.admin.internal.pu.elastic.GridServiceContainerConfig getGridServiceContainerConfig()
           
protected  CapacityRequirementsPerZonesConfig getPlannedCapacity()
           
protected  Set<ZonesConfig> getPlannedZones()
           
protected  boolean isGridServiceAgentZonesAware()
           
protected  boolean isRecoveredStateOnEsmStart(ProcessingUnit otherPu)
           
protected  boolean isUndeploying()
           
protected  void recoverStateOnEsmStart()
           
 void setContainersSlaEnforcementEndpoint(ContainersSlaEnforcementEndpoint containersService)
           
 void setGridServiceContainerConfig(org.openspaces.admin.internal.pu.elastic.GridServiceContainerConfig containersConfig)
           
 void setMachinesSlaEnforcementEndpoint(MachinesSlaEnforcementEndpoint machinesService)
           
protected  void setPlannedCapacity(CapacityRequirementsPerZones plannedCapacity)
           
protected  boolean setPlannedCapacity(CapacityRequirementsPerZonesConfig newPlannedCapacity)
          Call once in order to modify the behavior of enforcePlannedCapacity()
protected  void setPlannedCapacity(ScaleStrategyCapacityRequirementConfig newPlannedCapacityForDefaultZone)
          Call once in order to modify the behavior of enforcePlannedCapacity() Uses the default machine provisioning zone as the zone to start machines in.
 void setRebalancingSlaEnforcementEndpoint(RebalancingSlaEnforcementEndpoint relocationService)
           
protected  void setScaleStrategyConfig(ScaleStrategyConfig scaleStrategy)
           
 
Methods inherited from class org.openspaces.grid.gsm.strategy.AbstractScaleStrategyBean
agentProvisioningCompletedEvent, agentProvisioningInProgressEvent, containerProvisioningCompletedEvent, containerProvisioningInProgressEvent, destroy, enforceSla, getAdmin, getContainerNumberOfCpuCores, getDiscoveredMachinesCache, getEventsStore, getIsolation, getLogger, getMachineProvisioning, getMaximumNumberOfInstances, getMinimumNumberOfMachines, getPollingIntervalSeconds, getProcessingUnit, getProperties, getSchemaConfig, isScaleInProgress, machineProvisioningCompletedEvent, machineProvisioningInProgressEvent, puInstanceProvisioningCompletedEvent, puInstanceProvisioningInProgressEvent, run, setAdmin, setElasticMachineProvisioning, setElasticProcessingUnitMachineIsolation, setElasticScaleStrategyEventStorage, setMachineDiscoveryQuiteMode, setProcessingUnit, setProcessingUnitSchema, setProperties, validateAllProcessingUnitsRecoveredStateOnEsmStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openspaces.grid.gsm.strategy.ScaleStrategyBean
getConfig
 

Constructor Detail

AbstractCapacityScaleStrategyBean

public AbstractCapacityScaleStrategyBean()
Method Detail

setMachinesSlaEnforcementEndpoint

public void setMachinesSlaEnforcementEndpoint(MachinesSlaEnforcementEndpoint machinesService)
Specified by:
setMachinesSlaEnforcementEndpoint in interface MachinesSlaEnforcementEndpointAware

setContainersSlaEnforcementEndpoint

public void setContainersSlaEnforcementEndpoint(ContainersSlaEnforcementEndpoint containersService)
Specified by:
setContainersSlaEnforcementEndpoint in interface ContainersSlaEnforcementEndpointAware

setRebalancingSlaEnforcementEndpoint

public void setRebalancingSlaEnforcementEndpoint(RebalancingSlaEnforcementEndpoint relocationService)
Specified by:
setRebalancingSlaEnforcementEndpoint in interface RebalancingSlaEnforcementEndpointAware

getDefaultZones

protected ZonesConfig getDefaultZones()

setPlannedCapacity

protected void setPlannedCapacity(CapacityRequirementsPerZones plannedCapacity)

setPlannedCapacity

protected void setPlannedCapacity(ScaleStrategyCapacityRequirementConfig newPlannedCapacityForDefaultZone)
Call once in order to modify the behavior of enforcePlannedCapacity() Uses the default machine provisioning zone as the zone to start machines in.


setPlannedCapacity

protected boolean setPlannedCapacity(CapacityRequirementsPerZonesConfig newPlannedCapacity)
Call once in order to modify the behavior of enforcePlannedCapacity()

Returns:
false if planned has not changed, true if plan changed

getPlannedCapacity

protected CapacityRequirementsPerZonesConfig getPlannedCapacity()

setScaleStrategyConfig

protected void setScaleStrategyConfig(ScaleStrategyConfig scaleStrategy)

setGridServiceContainerConfig

public void setGridServiceContainerConfig(org.openspaces.admin.internal.pu.elastic.GridServiceContainerConfig containersConfig)
Specified by:
setGridServiceContainerConfig in interface GridServiceContainerConfigAware

getGridServiceContainerConfig

public org.openspaces.admin.internal.pu.elastic.GridServiceContainerConfig getGridServiceContainerConfig()

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: Bean
Invoked by a bean factory after it has set all bean properties. This method allows the bean instance to perform non-blocking initialization, which is only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface Bean
Overrides:
afterPropertiesSet in class AbstractScaleStrategyBean
See Also:
BeanConfigurationException, BeanInitializationException

enforcePlannedCapacity

protected void enforcePlannedCapacity()
                               throws SlaEnforcementInProgressException
Throws:
SlaEnforcementInProgressException

getPlannedZones

protected Set<ZonesConfig> getPlannedZones()

calcRoundedTotalMemoryInMB

protected long calcRoundedTotalMemoryInMB()

isUndeploying

protected boolean isUndeploying()
Specified by:
isUndeploying in class AbstractScaleStrategyBean
Returns:
true if this is an undeployment strategy (pu is undeploying)

recoverStateOnEsmStart

protected void recoverStateOnEsmStart()
                               throws MachinesSlaEnforcementInProgressException,
                                      SomeProcessingUnitsHaveNotCompletedStateRecoveryException,
                                      NeedToWaitUntilAllGridServiceAgentsDiscoveredException,
                                      UndeployInProgressException
Specified by:
recoverStateOnEsmStart in class AbstractScaleStrategyBean
Throws:
MachinesSlaEnforcementInProgressException
SomeProcessingUnitsHaveNotCompletedStateRecoveryException
NeedToWaitUntilAllGridServiceAgentsDiscoveredException
UndeployInProgressException

isRecoveredStateOnEsmStart

protected boolean isRecoveredStateOnEsmStart(ProcessingUnit otherPu)
Specified by:
isRecoveredStateOnEsmStart in class AbstractScaleStrategyBean

getAllocatedCapacity

public CapacityRequirementsPerZones getAllocatedCapacity()
                                                  throws MachinesSlaEnforcementInProgressException
Throws:
MachinesSlaEnforcementInProgressException

isGridServiceAgentZonesAware

protected boolean isGridServiceAgentZonesAware()

GigaSpaces XAP 9.1 API

Copyright © GigaSpaces.