GigaSpaces XAP 9.0 API

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

All Superinterfaces:
ElasticProcessingUnitMachineIsolationAware

public interface ElasticMachineProvisioning
extends ElasticProcessingUnitMachineIsolationAware

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
 CapacityRequirements getCapacityOfSingleMachine()
           
 ElasticMachineProvisioningConfig getConfig()
           
 GridServiceAgent[] getDiscoveredMachines(long duration, TimeUnit unit)
           
 boolean isStartMachineSupported()
           
 GridServiceAgent startMachine(long duration, TimeUnit unit)
          Starts a new machine with a new grid service agent.
 boolean stopMachine(GridServiceAgent 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
 

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,
                                                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
InterruptedException
TimeoutException
Since:
8.0.1

startMachine

GridServiceAgent startMachine(long duration,
                              TimeUnit unit)
                              throws ElasticMachineProvisioningException,
                                     InterruptedException,
                                     TimeoutException
Starts a new machine with a new grid service agent. This method is blocking on the current thread, or raises a TimeOutException if the timeout expired.

Parameters:
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
Since:
8.0

getCapacityOfSingleMachine

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

stopMachine

boolean stopMachine(GridServiceAgent agent,
                    long duration,
                    TimeUnit unit)
                    throws ElasticMachineProvisioningException,
                           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
Returns:
true if grid service agent was shutdown (and depending on the implementation also the machine was terminated) false if no action was taken.
Throws:
TimeoutException - - terminating the machine took too long
InterruptedException
ElasticMachineProvisioningException - - terminating the machine encountered a problem.
Since:
8.0

getConfig

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

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.