GigaSpaces XAP 7.0 API

org.openspaces.admin.pu
Interface ProcessingUnit

All Superinterfaces:
AdminAware, Iterable<ProcessingUnitInstance>, StatisticsMonitor

public interface ProcessingUnit
extends Iterable<ProcessingUnitInstance>, AdminAware, StatisticsMonitor

A processing unit holds one or more ProcessingUnitInstances.

Author:
kimchy

Field Summary
 
Fields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL
 
Method Summary
 void addLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener)
          Adds a ProcessingUnitInstanceLifecycleEventListener.
 boolean canDecrementInstance()
          Returns true if this processing unit allows to decrement instances on it.
 boolean canIncrementInstance()
          Returns true if this processing unit allows to increment instances on it.
 void decrementInstance()
          Will randomly decrement an instance from the processing units.
 GridServiceManager getBackupGridServiceManager(String gridServiceManagerUID)
          Returns the backup GSM matching the provided UID.
 BackupGridServiceManagerChangedEventManager getBackupGridServiceManagerChanged()
          Returns an event manager allowing to listen for BackupGridServiceManagerChangedEvents.
 GridServiceManager[] getBackupGridServiceManagers()
          Returns the backup GSMs for the processing unit.
 BeanLevelProperties getBeanLevelProperties()
          Return the deploy time properties of the processing unit.
 ProcessingUnitInstance[] getInstances()
          Returns the processing unit instances currently discovered.
 GridServiceManager getManagingGridServiceManager()
          Returns the managing (primary) GSM for the processing unit.
 ManagingGridServiceManagerChangedEventManager getManagingGridServiceManagerChanged()
          Returns an event manger allowing to listen for ManagingGridServiceManagerChangedEvents.
 int getMaxInstancesPerMachine()
          Returns the number of instnaces of this processing unit that can run within a Machine.
 int getMaxInstancesPerVM()
          Returns the number of instnaces of this processing unit that can run within a VM.
 Map<String,Integer> getMaxInstancesPerZone()
          Returns a map containing the zone name and the maximum number of instances for that zone.
 String getName()
          Returns the name of the processing unit.
 int getNumberOfBackups()
          Returns the number of backups (if the topology is a backup one) per instance.
 int getNumberOfInstances()
          Returns the number of instances of the processing unit.
 ProcessingUnitPartition getPartition(int partitionId)
          Returns a processing unit partition based on the specified partition id.
 ProcessingUnitPartition[] getPartitions()
          Returns the processing unit partitions of this processing unit.
 ProcessingUnitInstanceAddedEventManager getProcessingUnitInstanceAdded()
          Returns an event manager allowing to register ProcessingUnitInstanceAddedEventListeners.
 ProcessingUnitInstanceRemovedEventManager getProcessingUnitInstanceRemoved()
          Returns an event manager allowing to register ProcessingUnitInstanceRemovedEventListeners.
 ProcessingUnitInstanceStatisticsChangedEventManager getProcessingUnitInstanceStatisticsChange()
          Returns a processing unit instance statistics change event manger allowing to register for events of ProcessingUnitInstanceStatisticsChangedEvent.
 ProcessingUnits getProcessingUnits()
          Returns the handle to all the different processing units.
 ProcessingUnitStatusChangedEventManager getProcessingUnitStatusChanged()
          Returns an event manager allowing to listen for ProcessingUnitStatusChangedEvents.
 String[] getRequiredZones()
          Returns the list of zones this processing units are required to run on.
 Space getSpace()
          Returns the (first) embedded space within a processing unit.
 ProcessingUnitSpaceCorrelatedEventManager getSpaceCorrelated()
          Returns an event manager allowing to listen for ProcessingUnitSpaceCorrelatedEvents.
 Space[] getSpaces()
          Returns all the embedded spaces within a processing unit.
 DeploymentStatus getStatus()
          Returns the deployment status of the processing unit.
 int getTotalNumberOfInstances()
          Returns the total number of instances.
 void incrementInstance()
          Will increment a processing unit instance.
 boolean isManaged()
          Returns true if there is a managing GSM for it.
 void removeLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener)
          Removes a ProcessingUnitInstanceLifecycleEventListener.
 void undeploy()
          Undeploys the processing unit.
 boolean waitFor(int numberOfProcessingUnitInstances)
          Waits till at least the provided number of Processing Unit Instances are up.
 boolean waitFor(int numberOfProcessingUnitInstances, long timeout, TimeUnit timeUnit)
          Waits till at least the provided number of Processing Unit Instances are up for the specified timeout.
 GridServiceManager waitForManaged()
          Waits till there is a managing GridServiceManager for the processing unit.
 GridServiceManager waitForManaged(long timeout, TimeUnit timeUnit)
          Waits till there is a managing GridServiceManager for the processing unit for the specified timeout.
 Space waitForSpace()
          Waits till an embedded Space is correlated with the processing unit.
 Space waitForSpace(long timeout, TimeUnit timeUnit)
          Waits till an embedded Space is correlated with the processing unit for the specified timeout.
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.openspaces.admin.AdminAware
getAdmin
 
Methods inherited from interface org.openspaces.admin.StatisticsMonitor
isMonitoring, setStatisticsHistorySize, setStatisticsInterval, startStatisticsMonitor, stopStatisticsMontior
 

Method Detail

getProcessingUnits

ProcessingUnits getProcessingUnits()
Returns the handle to all the different processing units.


getName

String getName()
Returns the name of the processing unit.


getNumberOfInstances

int getNumberOfInstances()
Returns the number of instances of the processing unit.


getNumberOfBackups

int getNumberOfBackups()
Returns the number of backups (if the topology is a backup one) per instance.


getTotalNumberOfInstances

int getTotalNumberOfInstances()
Returns the total number of instances. If there are no backups, will return getNumberOfInstances(). If there are backups, will return getNumberOfInstances() * (getNumberOfBackups() + 1)


getMaxInstancesPerVM

int getMaxInstancesPerVM()
Returns the number of instnaces of this processing unit that can run within a VM.

In case of a partitioned with backup topology, it applies on a per partition level (meaning that a primary and backup will not run on the same VM).

In case of a non backup based topology, it applies on the number of instances of the whole processing unit that can run on the same VM).


getMaxInstancesPerMachine

int getMaxInstancesPerMachine()
Returns the number of instnaces of this processing unit that can run within a Machine.

In case of a partitioned with backup topology, it applies on a per partition level (meaning that a primary and backup will not run on the same Machine).

In case of a non backup based topology, it applies on the number of instances of the whole processing unit that can run on the same Machine).


getMaxInstancesPerZone

Map<String,Integer> getMaxInstancesPerZone()
Returns a map containing the zone name and the maximum number of instances for that zone.


getRequiredZones

String[] getRequiredZones()
Returns the list of zones this processing units are required to run on. If there is more than one zone, the processing unit can run on either of the zones.


getStatus

DeploymentStatus getStatus()
Returns the deployment status of the processing unit.


getBeanLevelProperties

BeanLevelProperties getBeanLevelProperties()
Return the deploy time properties of the processing unit.


waitFor

boolean waitFor(int numberOfProcessingUnitInstances)
Waits till at least the provided number of Processing Unit Instances are up.


waitFor

boolean waitFor(int numberOfProcessingUnitInstances,
                long timeout,
                TimeUnit timeUnit)
Waits till at least the provided number of Processing Unit Instances are up for the specified timeout.


waitForSpace

Space waitForSpace()
Waits till an embedded Space is correlated with the processing unit.


waitForSpace

Space waitForSpace(long timeout,
                   TimeUnit timeUnit)
Waits till an embedded Space is correlated with the processing unit for the specified timeout.


waitForManaged

GridServiceManager waitForManaged()
Waits till there is a managing GridServiceManager for the processing unit.


waitForManaged

GridServiceManager waitForManaged(long timeout,
                                  TimeUnit timeUnit)
Waits till there is a managing GridServiceManager for the processing unit for the specified timeout.


canIncrementInstance

boolean canIncrementInstance()
Returns true if this processing unit allows to increment instances on it.


canDecrementInstance

boolean canDecrementInstance()
Returns true if this processing unit allows to decrement instances on it.


incrementInstance

void incrementInstance()
Will increment a processing unit instance.


decrementInstance

void decrementInstance()
Will randomly decrement an instance from the processing units. For more fine grained control see ProcessingUnitInstance.decrement().


isManaged

boolean isManaged()
Returns true if there is a managing GSM for it.


getManagingGridServiceManager

GridServiceManager getManagingGridServiceManager()
Returns the managing (primary) GSM for the processing unit.


getBackupGridServiceManagers

GridServiceManager[] getBackupGridServiceManagers()
Returns the backup GSMs for the processing unit.


getBackupGridServiceManager

GridServiceManager getBackupGridServiceManager(String gridServiceManagerUID)
Returns the backup GSM matching the provided UID.


undeploy

void undeploy()
Undeploys the processing unit.


getSpace

Space getSpace()
Returns the (first) embedded space within a processing unit. Returns null if no embedded space is defined within the processing unit or if no processing unit instance has been added to the processing unit.


getSpaces

Space[] getSpaces()
Returns all the embedded spaces within a processing unit. Returns an empty array if there are no embedded spaces defined within the processing unit, or none has been associated with the processing unit yet.


getInstances

ProcessingUnitInstance[] getInstances()
Returns the processing unit instances currently discovered.


getPartitions

ProcessingUnitPartition[] getPartitions()
Returns the processing unit partitions of this processing unit.


getPartition

ProcessingUnitPartition getPartition(int partitionId)
Returns a processing unit partition based on the specified partition id.


getProcessingUnitInstanceAdded

ProcessingUnitInstanceAddedEventManager getProcessingUnitInstanceAdded()
Returns an event manager allowing to register ProcessingUnitInstanceAddedEventListeners.


getProcessingUnitInstanceRemoved

ProcessingUnitInstanceRemovedEventManager getProcessingUnitInstanceRemoved()
Returns an event manager allowing to register ProcessingUnitInstanceRemovedEventListeners.


addLifecycleListener

void addLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener)
Adds a ProcessingUnitInstanceLifecycleEventListener.


removeLifecycleListener

void removeLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener)
Removes a ProcessingUnitInstanceLifecycleEventListener.


getManagingGridServiceManagerChanged

ManagingGridServiceManagerChangedEventManager getManagingGridServiceManagerChanged()
Returns an event manger allowing to listen for ManagingGridServiceManagerChangedEvents.


getBackupGridServiceManagerChanged

BackupGridServiceManagerChangedEventManager getBackupGridServiceManagerChanged()
Returns an event manager allowing to listen for BackupGridServiceManagerChangedEvents.


getProcessingUnitStatusChanged

ProcessingUnitStatusChangedEventManager getProcessingUnitStatusChanged()
Returns an event manager allowing to listen for ProcessingUnitStatusChangedEvents.


getSpaceCorrelated

ProcessingUnitSpaceCorrelatedEventManager getSpaceCorrelated()
Returns an event manager allowing to listen for ProcessingUnitSpaceCorrelatedEvents.


getProcessingUnitInstanceStatisticsChange

ProcessingUnitInstanceStatisticsChangedEventManager getProcessingUnitInstanceStatisticsChange()
Returns a processing unit instance statistics change event manger allowing to register for events of ProcessingUnitInstanceStatisticsChangedEvent.

Note, in order to receive events, the virtual machines need to be in a "statistics" monitored state.


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.