GigaSpaces XAP 9.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
 CapacityRequirements getCapacityOfSingleMachine()
           
 ElasticMachineProvisioningConfig getConfig()
           
 GridServiceAgent[] getDiscoveredMachines(long duration, TimeUnit unit)
           
 boolean isStartMachineSupported()
           
 GridServiceAgent startMachine(ExactZonesConfig zones, GSAReservationId reservationId, long duration, TimeUnit unit)
          Starts a new machine with a new grid service agent and injects specific zones into it.
 GridServiceAgent startMachine(long duration, TimeUnit unit)
          Deprecated. 
 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
 
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

GridServiceAgent startMachine(ExactZonesConfig zones,
                              GSAReservationId reservationId,
                              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:
duration - - the maximum duration after which a TimeoutException is raised.
unit - - the time unit for the duration
zones - - the zones to start the machine on. these zones will be injected into the GSA that is started on this machine.
Returns:
the grid service agent
Throws:
ElasticMachineProvisioningException
InterruptedException
TimeoutException
ElasticGridServiceAgentProvisioningException
Since:
8.0

startMachine

@Deprecated
GridServiceAgent startMachine(long duration,
                                         TimeUnit unit)
                              throws ElasticMachineProvisioningException,
                                     ElasticGridServiceAgentProvisioningException,
                                     InterruptedException,
                                     TimeoutException
Deprecated. 

Starts a new machine with a new grid service agent without specifying zones. the GSA will be assigned only the default zones. 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
ElasticGridServiceAgentProvisioningException
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,
                           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
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.
ElasticGridServiceAgentProvisioningException
Since:
8.0

getConfig

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

GigaSpaces XAP 9.1 API

Copyright © GigaSpaces.