GigaSpaces XAP 10.0.1 API

org.openspaces.grid.gsm.machines.plugins
Interface ElasticMachineProvisioning

All Superinterfaces:
ElasticGridServiceAgentProvisioningProgressEventListenerAware, ElasticMachineProvisioningProgressChangedEventListenerAware, ElasticProcessingUnitMachineIsolationAware

public interface ElasticMachineProvisioning
extends ElasticProcessingUnitMachineIsolationAware, ElasticMachineProvisioningProgressChangedEventListenerAware, ElasticGridServiceAgentProvisioningProgressEventListenerAware

An Elastic Service Manager plug-in that enables starting, stopping and discovering of virtual machines. All started machines must have Grid Service Agents with zones as defined by ElasticMachineProvisioningConfig.getGridServiceAgentZones() and ElasticMachineProvisioningConfig.isGridServiceAgentZoneMandatory() The plugin must be stateless, and is expected to delegate calls to a remove service (such as a cloud). Calls to this class can be concurrent from different threads, therefore implementation must be thread safe.

Since:
8.0
Author:
itaif
See Also:
NonBlockingElasticMachineProvisioning, ElasticMachineProvisioningConfig

Method Summary
 void blockingAfterPropertiesSet()
          performs blocking initialization of the external api components.
 void cleanupMachineResources(long duration, TimeUnit unit)
          Cleanup all cloud resources.
 CapacityRequirements getCapacityOfSingleMachine()
           
 ElasticMachineProvisioningConfig getConfig()
           
 GridServiceAgent[] getDiscoveredMachines(long duration, TimeUnit unit)
           
 Object getExternalApi(String apiName)
          Returns external API according to name.
 boolean isStartMachineSupported()
           
 StartedGridServiceAgent startMachine(ExactZonesConfig zones, GSAReservationId reservationId, FailedGridServiceAgent failedAgent, long duration, TimeUnit unit)
          Starts a new machine with a new grid service agent and injects specific zones into it.
 void stopMachine(StartedGridServiceAgent agent, long duration, TimeUnit unit)
          Shuts down the grid service agent and the machine.
 
Methods inherited from interface org.openspaces.grid.gsm.machines.isolation.ElasticProcessingUnitMachineIsolationAware
setElasticProcessingUnitMachineIsolation
 
Methods inherited from interface org.openspaces.grid.gsm.machines.plugins.events.ElasticMachineProvisioningProgressChangedEventListenerAware
setElasticMachineProvisioningProgressChangedEventListener
 
Methods inherited from interface org.openspaces.grid.gsm.machines.plugins.events.ElasticGridServiceAgentProvisioningProgressEventListenerAware
setElasticGridServiceAgentProvisioningProgressEventListener
 

Method Detail

isStartMachineSupported

boolean isStartMachineSupported()
Returns:
true if this object supports starting and stopping of machines. False indicates that #startMachine(long, TimeUnit) and #stopMachine(GridServiceAgent, long, TimeUnit) raise UnsupportedOperationException
Since:
8.0.1

getDiscoveredMachines

GridServiceAgent[] getDiscoveredMachines(long duration,
                                         TimeUnit unit)
                                         throws ElasticMachineProvisioningException,
                                                ElasticGridServiceAgentProvisioningException,
                                                InterruptedException,
                                                TimeoutException
Returns:
a list of grid service agents that reside in the data center (or cloud region) defined in ElasticMachineProvisioningConfig The caller then filters the result using the criteria defined in ElasticMachineProvisioningConfig.getGridServiceAgentZones() , ElasticMachineProvisioningConfig.isGridServiceAgentZoneMandatory() and ElasticMachineProvisioningConfig.isDedicatedManagementMachines() so it is not mandatory for the implementation to do so.
Throws:
ElasticMachineProvisioningException
ElasticGridServiceAgentProvisioningException
InterruptedException
TimeoutException
Since:
8.0.1

startMachine

StartedGridServiceAgent startMachine(ExactZonesConfig zones,
                                     GSAReservationId reservationId,
                                     FailedGridServiceAgent failedAgent,
                                     long duration,
                                     TimeUnit unit)
                                     throws ElasticMachineProvisioningException,
                                            ElasticGridServiceAgentProvisioningException,
                                            InterruptedException,
                                            TimeoutException
Starts a new machine with a new grid service agent and injects specific zones into it. This method is blocking on the current thread, or raises a TimeOutException if the timeout expired.

Parameters:
zones - - the zones to start the machine on. these zones will be injected into the GSA that is started on this machine.
failedAgent - - the failed agent for which this new machine is required in order to perform recovery. null if this machine is not related to a failed machine
failedAgentRecoveryAttempt - - 0 if this is not related to failed machine, 1 if first attempt to recover from machine failure, 2 if second attempt to recover, etc...
duration - - the maximum duration after which a TimeoutException is raised.
unit - - the time unit for the duration
Returns:
the grid service agent
Throws:
ElasticMachineProvisioningException
InterruptedException
TimeoutException
ElasticGridServiceAgentProvisioningException
Since:
8.0

getCapacityOfSingleMachine

CapacityRequirements getCapacityOfSingleMachine()
Returns:
the capacity requirements that represent a single machine

stopMachine

void stopMachine(StartedGridServiceAgent agent,
                 long duration,
                 TimeUnit unit)
                 throws ElasticMachineProvisioningException,
                        ElasticGridServiceAgentProvisioningException,
                        InterruptedException,
                        TimeoutException
Shuts down the grid service agent and the machine. This method is blocking on the current thread, or raises a TimeOutException if the timeout expired. The implementation should be able to close machines that it has not started, but rather an older instance of this object started perhaps with different configuration. The implementation should also keep an independent scheduled cleanup task to search and terminate orphan machines that do not have a grid service agent running, and that have been running for enough time not to suspect that they have just been started.

Parameters:
agent - - the agent to stop
duration - - timeout duration
unit - - timeout duration time unit
Throws:
TimeoutException - - terminating the machine took too long
InterruptedException
ElasticMachineProvisioningException - - terminating the machine encountered a problem.
ElasticGridServiceAgentProvisioningException
Since:
8.0

cleanupMachineResources

void cleanupMachineResources(long duration,
                             TimeUnit unit)
                             throws ElasticMachineProvisioningException,
                                    InterruptedException,
                                    TimeoutException
Cleanup all cloud resources. This method is called once after the processing unit has undeployed and all machines have been stopped.

Throws:
ElasticMachineProvisioningException
InterruptedException
TimeoutException
Since:
9.7.0

getConfig

ElasticMachineProvisioningConfig getConfig()
Returns:
the configuration used by this object
Since:
8.0.1

getExternalApi

Object getExternalApi(String apiName)
                      throws InterruptedException,
                             ElasticMachineProvisioningException
Returns external API according to name.

Parameters:
apiName - The name of the external API.
Returns:
The external API according to name ("Storage"/"Network")
Throws:
ElasticMachineProvisioningException
InterruptedException

blockingAfterPropertiesSet

void blockingAfterPropertiesSet()
                                throws Exception
performs blocking initialization of the external api components.

Throws:
Exception - . * @since 9.7.0

GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.