GigaSpaces XAP 9.7.2 API

org.openspaces.grid.gsm.strategy
Class AbstractScaleStrategyBean

java.lang.Object
  extended by org.openspaces.grid.gsm.strategy.AbstractScaleStrategyBean
All Implemented Interfaces:
Runnable, Bean, ElasticMachineProvisioningAware, MachinesStateBackupAware, ElasticProcessingUnitMachineIsolationAware, ProcessingUnitAware, ElasticScaleStrategyEventStorageAware, ScaleStrategyBean
Direct Known Subclasses:
AbstractCapacityScaleStrategyBean, EagerScaleStrategyBean, UndeployScaleStrategyBean

public abstract class AbstractScaleStrategyBean
extends Object
implements ElasticMachineProvisioningAware, ProcessingUnitAware, ElasticScaleStrategyEventStorageAware, ScaleStrategyBean, ElasticProcessingUnitMachineIsolationAware, MachinesStateBackupAware, Bean, Runnable


Constructor Summary
AbstractScaleStrategyBean()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a bean factory after it has set all bean properties.
protected  void agentProvisioningCompletedEvent(ZonesConfig zones)
           
protected  void agentProvisioningInProgressEvent(GridServiceAgentSlaEnforcementInProgressException e, ZonesConfig zones)
           
protected  void capacityPlanningCompletedEvent()
           
protected  void capacityPlanningCompletedEvent(ZonesConfig zones)
           
protected  void capacityPlanningInProgressEvent(AutoScalingSlaEnforcementInProgressException e, ZonesConfig zones)
           
 void capacityPlanningInProgressEvent(ElasticStatelessProcessingUnitPlannedNumberOfInstancesChangedEvent event)
           
protected  void containerProvisioningCompletedEvent()
           
protected  void containerProvisioningInProgressEvent(ContainersSlaEnforcementInProgressException e)
           
 void destroy()
          Invoked by a bean factory on destruction of a singleton.
protected abstract  void enforceSla()
           
protected  org.openspaces.admin.internal.admin.InternalAdmin getAdmin()
           
 org.openspaces.core.internal.commons.math.fraction.Fraction getContainerNumberOfCpuCores(ManualCapacityScaleConfig slaConfig)
           
protected  DiscoveredMachinesCache getDiscoveredMachinesCache()
           
 ElasticMachineProvisioning getElasticMachineProvisioningOrNull()
           
protected  ElasticProcessingUnitMachineIsolation getIsolation()
           
protected  Log getLogger()
           
protected  NonBlockingElasticMachineProvisioning getMachineProvisioning()
           
protected  int getMaximumNumberOfInstances()
           
protected  int getMinimumNumberOfMachines()
           
protected  long getPollingIntervalSeconds()
           
protected  org.openspaces.admin.internal.pu.InternalProcessingUnit getProcessingUnit()
           
 Map<String,String> getProperties()
           
protected abstract  MachinesSlaEnforcementState.RecoveryState getRecoveredStateOnEsmStart(ProcessingUnit otherPu)
           
 Remote getRemoteApi(String apiName)
           
protected  org.openspaces.admin.internal.pu.elastic.ProcessingUnitSchemaConfig getSchemaConfig()
           
 boolean isScaleInProgress()
           
protected abstract  boolean isUndeploying()
           
protected  void machineProvisioningCompletedEvent(ZonesConfig zones)
           
protected  void machineProvisioningInProgressEvent(MachinesSlaEnforcementInProgressException e, ZonesConfig zones)
           
protected  void puInstanceProvisioningCompletedEvent()
           
protected  void puInstanceProvisioningInProgressEvent(RebalancingSlaEnforcementInProgressException e)
           
protected abstract  void recoverStateOnEsmStart()
           
 void run()
           
 void setAdmin(Admin admin)
          Set the Admin instance to be used by this Bean.
 void setElasticMachineProvisioning(NonBlockingElasticMachineProvisioning machineProvisioning)
           
 void setElasticProcessingUnitMachineIsolation(ElasticProcessingUnitMachineIsolation isolation)
           
 void setElasticScaleStrategyEventStorage(org.jini.rio.monitor.event.EventsStore eventQueue)
           
protected  void setMachineDiscoveryQuiteMode(boolean discoveryQuiteMode)
           
 void setMachinesStateBackup(MachinesStateBackup stateBackup)
           
 void setProcessingUnit(ProcessingUnit pu)
           
 void setProcessingUnitSchema(org.openspaces.admin.internal.pu.elastic.ProcessingUnitSchemaConfig schemaConfig)
           
 void setProperties(Map<String,String> properties)
          The bean properties supplied using a client side bean configuration object, or by plain String key-value pairs.
protected  void validateAllProcessingUnitsRecoveredStateOnEsmStart()
          Make sure the other PUs have updated their state, so their won't be race condition on allocating discovered agents when enforcing sla.
 
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

AbstractScaleStrategyBean

public AbstractScaleStrategyBean()
Method Detail

getAdmin

protected org.openspaces.admin.internal.admin.InternalAdmin getAdmin()

getLogger

protected Log getLogger()

getMinimumNumberOfMachines

protected int getMinimumNumberOfMachines()

getProperties

public Map<String,String> getProperties()
Specified by:
getProperties in interface Bean
Returns:
properties used to configure this bean.

setProcessingUnit

public void setProcessingUnit(ProcessingUnit pu)
Specified by:
setProcessingUnit in interface ProcessingUnitAware

getProcessingUnit

protected org.openspaces.admin.internal.pu.InternalProcessingUnit getProcessingUnit()

getPollingIntervalSeconds

protected long getPollingIntervalSeconds()

setElasticProcessingUnitMachineIsolation

public void setElasticProcessingUnitMachineIsolation(ElasticProcessingUnitMachineIsolation isolation)
Specified by:
setElasticProcessingUnitMachineIsolation in interface ElasticProcessingUnitMachineIsolationAware

getIsolation

protected ElasticProcessingUnitMachineIsolation getIsolation()

setProcessingUnitSchema

public void setProcessingUnitSchema(org.openspaces.admin.internal.pu.elastic.ProcessingUnitSchemaConfig schemaConfig)
Specified by:
setProcessingUnitSchema in interface ProcessingUnitAware

getSchemaConfig

protected org.openspaces.admin.internal.pu.elastic.ProcessingUnitSchemaConfig getSchemaConfig()

setAdmin

public void setAdmin(Admin admin)
Description copied from interface: Bean
Set the Admin instance to be used by this Bean.

Specified by:
setAdmin in interface Bean
Parameters:
admin - an Admin instance.

setElasticMachineProvisioning

public void setElasticMachineProvisioning(NonBlockingElasticMachineProvisioning machineProvisioning)
Specified by:
setElasticMachineProvisioning in interface ElasticMachineProvisioningAware

setMachinesStateBackup

public void setMachinesStateBackup(MachinesStateBackup stateBackup)
Specified by:
setMachinesStateBackup in interface MachinesStateBackupAware

getMachineProvisioning

protected NonBlockingElasticMachineProvisioning getMachineProvisioning()

setElasticScaleStrategyEventStorage

public void setElasticScaleStrategyEventStorage(org.jini.rio.monitor.event.EventsStore eventQueue)
Specified by:
setElasticScaleStrategyEventStorage in interface ElasticScaleStrategyEventStorageAware

setMachineDiscoveryQuiteMode

protected void setMachineDiscoveryQuiteMode(boolean discoveryQuiteMode)

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
See Also:
BeanConfigurationException, BeanInitializationException

destroy

public void destroy()
Description copied from interface: Bean
Invoked by a bean factory on destruction of a singleton.

Specified by:
destroy in interface Bean
See Also:
BeanConfigException

setProperties

public void setProperties(Map<String,String> properties)
Description copied from interface: Bean
The bean properties supplied using a client side bean configuration object, or by plain String key-value pairs.

Specified by:
setProperties in interface Bean
Parameters:
properties - properties to configure this bean.

getDiscoveredMachinesCache

protected DiscoveredMachinesCache getDiscoveredMachinesCache()

getMaximumNumberOfInstances

protected int getMaximumNumberOfInstances()

getContainerNumberOfCpuCores

public org.openspaces.core.internal.commons.math.fraction.Fraction getContainerNumberOfCpuCores(ManualCapacityScaleConfig slaConfig)

run

public void run()
Specified by:
run in interface Runnable

getRecoveredStateOnEsmStart

protected abstract MachinesSlaEnforcementState.RecoveryState getRecoveredStateOnEsmStart(ProcessingUnit otherPu)

recoverStateOnEsmStart

protected abstract void recoverStateOnEsmStart()
                                        throws MachinesSlaEnforcementInProgressException,
                                               SomeProcessingUnitsHaveNotCompletedStateRecoveryException,
                                               NeedToWaitUntilAllGridServiceAgentsDiscoveredException,
                                               UndeployInProgressException
Throws:
MachinesSlaEnforcementInProgressException
SomeProcessingUnitsHaveNotCompletedStateRecoveryException
NeedToWaitUntilAllGridServiceAgentsDiscoveredException
UndeployInProgressException

validateAllProcessingUnitsRecoveredStateOnEsmStart

protected void validateAllProcessingUnitsRecoveredStateOnEsmStart()
                                                           throws SomeProcessingUnitsHaveNotCompletedStateRecoveryException
Make sure the other PUs have updated their state, so their won't be race condition on allocating discovered agents when enforcing sla.

Throws:
SomeProcessingUnitsHaveNotCompletedStateRecoveryException

enforceSla

protected abstract void enforceSla()
                            throws SlaEnforcementInProgressException
Throws:
SlaEnforcementInProgressException

isUndeploying

protected abstract boolean isUndeploying()
Returns:
true if this is an undeployment strategy (pu is undeploying)

isScaleInProgress

public boolean isScaleInProgress()
Specified by:
isScaleInProgress in interface ScaleStrategyBean
Returns:
true if the SLA is breached and corrective actions are in progress.

agentProvisioningCompletedEvent

protected void agentProvisioningCompletedEvent(ZonesConfig zones)

agentProvisioningInProgressEvent

protected void agentProvisioningInProgressEvent(GridServiceAgentSlaEnforcementInProgressException e,
                                                ZonesConfig zones)

machineProvisioningCompletedEvent

protected void machineProvisioningCompletedEvent(ZonesConfig zones)

machineProvisioningInProgressEvent

protected void machineProvisioningInProgressEvent(MachinesSlaEnforcementInProgressException e,
                                                  ZonesConfig zones)

containerProvisioningCompletedEvent

protected void containerProvisioningCompletedEvent()

containerProvisioningInProgressEvent

protected void containerProvisioningInProgressEvent(ContainersSlaEnforcementInProgressException e)

puInstanceProvisioningCompletedEvent

protected void puInstanceProvisioningCompletedEvent()

puInstanceProvisioningInProgressEvent

protected void puInstanceProvisioningInProgressEvent(RebalancingSlaEnforcementInProgressException e)

capacityPlanningCompletedEvent

protected void capacityPlanningCompletedEvent()

capacityPlanningCompletedEvent

protected void capacityPlanningCompletedEvent(ZonesConfig zones)

capacityPlanningInProgressEvent

protected void capacityPlanningInProgressEvent(AutoScalingSlaEnforcementInProgressException e,
                                               ZonesConfig zones)

capacityPlanningInProgressEvent

public void capacityPlanningInProgressEvent(ElasticStatelessProcessingUnitPlannedNumberOfInstancesChangedEvent event)

getElasticMachineProvisioningOrNull

public ElasticMachineProvisioning getElasticMachineProvisioningOrNull()

getRemoteApi

public Remote getRemoteApi(String apiName)
                    throws Exception
Throws:
Exception

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.