public interface ProcessingUnit extends Iterable<ProcessingUnitInstance>, AdminAware, StatisticsMonitor
ProcessingUnitInstance
s.DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener)
|
boolean |
canDecrementInstance() |
boolean |
canIncrementInstance() |
void |
decrementInstance()
Removes a randomly chosen instance from the processing unit, and decrements the number of instances.
|
Application |
getApplication() |
GridServiceManager |
getBackupGridServiceManager(String gridServiceManagerUID) |
BackupGridServiceManagerChangedEventManager |
getBackupGridServiceManagerChanged() |
GridServiceManager[] |
getBackupGridServiceManagers() |
BeanLevelProperties |
getBeanLevelProperties() |
ProcessingUnitDependencies<ProcessingUnitDependency> |
getDependencies() |
ProcessingUnitInstance[] |
getInstances() |
GridServiceManager |
getManagingGridServiceManager() |
ManagingGridServiceManagerChangedEventManager |
getManagingGridServiceManagerChanged() |
int |
getMaxInstancesPerMachine() |
int |
getMaxInstancesPerVM() |
Map<String,Integer> |
getMaxInstancesPerZone() |
String |
getName() |
int |
getNumberOfBackups() |
int |
getNumberOfInstances()
Deprecated.
- since 9.5.0 - please use the following alternatives:
For retrieving planned number of partitions use
getPlannedNumberOfPartitions() .
Otherwise use getPlannedNumberOfInstances() for retrieving planned number of
stateful (primary+backup Space instances) -or- stateless pu instances.
Note that this method does not count the number of running instances, but rather the number of planned
instances for the processing unit. To count the number of currently discovered running processing unit
instances use the method getInstances() . |
ProcessingUnitPartition |
getPartition(int partitionId) |
ProcessingUnitPartition[] |
getPartitions() |
int |
getPlannedNumberOfInstances()
For stateful processing unit (primary+backup Space) will return the current planned number of instances (including backups).
|
int |
getPlannedNumberOfPartitions()
For stateful processing unit (primary+backup Space) will return the planned partition count - i.e. the number of planned primary
instances (excluding backups).
|
ProcessingUnitInstanceAddedEventManager |
getProcessingUnitInstanceAdded() |
ProcessingUnitInstanceMemberAliveIndicatorStatusChangedEventManager |
getProcessingUnitInstanceMemberAliveIndicatorStatusChanged() |
ProcessingUnitInstanceProvisionStatusChangedEventManager |
getProcessingUnitInstanceProvisionStatusChanged() |
ProcessingUnitInstanceRemovedEventManager |
getProcessingUnitInstanceRemoved() |
ProcessingUnitInstanceStatisticsChangedEventManager |
getProcessingUnitInstanceStatisticsChanged() |
ProcessingUnits |
getProcessingUnits() |
ProcessingUnitStatusChangedEventManager |
getProcessingUnitStatusChanged() |
QuiesceDetails |
getQuiesceDetails() |
RequiredZonesConfig |
getRequiredContainerZones() |
String[] |
getRequiredZones()
Deprecated.
This method is deprecated in favor of
getRequiredContainerZones() |
Space |
getSpace() |
ProcessingUnitSpaceCorrelatedEventManager |
getSpaceCorrelated() |
Space[] |
getSpaces() |
DeploymentStatus |
getStatus() |
int |
getTotalNumberOfInstances()
Deprecated.
- since 9.6.0 - please use
getPlannedNumberOfInstances()
Note that this method does not count the number of running instances, but rather the total number of planned
instances for the processing unit. To count the number of active processing unit instances please use the method
getInstances() . |
ProcessingUnitType |
getType() |
void |
incrementInstance()
Increments the number of processing unit instances.
|
boolean |
isManaged() |
boolean |
isRequiresIsolation() |
QuiesceResult |
quiesce(QuiesceRequest request)
Requests a quiesce request from the GSM.
|
void |
removeLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener)
Removes a
ProcessingUnitInstanceLifecycleEventListener . |
void |
scale(ScaleStrategyConfig strategyConfig)
Modifies the processing unit scalability strategy.
|
void |
scaleAndWait(ScaleStrategyConfig strategyConfig)
Modifies the processing unit scalability strategy and waits until scale is complete
This method is only available if the processing unit deployment is elastic
|
boolean |
scaleAndWait(ScaleStrategyConfig strategyConfig,
long timeout,
TimeUnit timeUnit)
Modifies the processing unit scalability strategy and waits until scale is complete
This method is only available if the processing unit deployment is elastic
|
void |
undeploy() |
void |
undeployAndWait()
Un-deploys the processing unit and waits until all instances have been undeployed.
|
boolean |
undeployAndWait(long timeout,
TimeUnit timeunit)
Undeploy the processing unit and wait until all instances have been undeployed.
|
void |
unquiesce(QuiesceRequest request)
Requests a unquiesce request from the GSM.
|
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.
|
boolean |
waitFor(com.gigaspaces.admin.quiesce.QuiesceState desiredState)
Same as
waitFor(com.gigaspaces.admin.quiesce.QuiesceState, long, java.util.concurrent.TimeUnit) but with endless timeout |
boolean |
waitFor(com.gigaspaces.admin.quiesce.QuiesceState desiredState,
long timeout,
TimeUnit timeUnit) |
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.
|
forEach, iterator, spliterator
getAdmin
isMonitoring, setStatisticsHistorySize, setStatisticsInterval, startStatisticsMonitor, stopStatisticsMonitor
ProcessingUnits getProcessingUnits()
String getName()
@Deprecated int getNumberOfInstances()
getPlannedNumberOfPartitions()
.
Otherwise use getPlannedNumberOfInstances()
for retrieving planned number of
stateful (primary+backup Space instances) -or- stateless pu instances.
Note that this method does not count the number of running instances, but rather the number of planned
instances for the processing unit. To count the number of currently discovered running processing unit
instances use the method getInstances()
.int getPlannedNumberOfPartitions()
getPartitions()
.int getPlannedNumberOfInstances()
getInstances()
.int getNumberOfBackups()
@Deprecated int getTotalNumberOfInstances()
getPlannedNumberOfInstances()
Note that this method does not count the number of running instances, but rather the total number of planned
instances for the processing unit. To count the number of active processing unit instances please use the method
getInstances()
.getNumberOfInstances()
. If there are backups,
will return getNumberOfInstances()
* (getNumberOfBackups()
+ 1)int getMaxInstancesPerVM()
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).
int getMaxInstancesPerMachine()
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).
boolean isRequiresIsolation()
Map<String,Integer> getMaxInstancesPerZone()
@Deprecated String[] getRequiredZones()
getRequiredContainerZones()
RequiredZonesConfig getRequiredContainerZones()
DeploymentStatus getStatus()
BeanLevelProperties getBeanLevelProperties()
ProcessingUnitType getType()
boolean waitFor(int numberOfProcessingUnitInstances)
true
if discovered the required number of instances within the default timeout and false
if the waiting time elapsed before the discovery took placeboolean waitFor(int numberOfProcessingUnitInstances, long timeout, TimeUnit timeUnit)
true
if discovered the required number of instances within the specified timeout and false
if the waiting time elapsed before the discovery took placeSpace waitForSpace()
true
if Space was correlated within the default timeout and false
if the waiting time elapsed before correlation took placeSpace waitForSpace(long timeout, TimeUnit timeUnit)
true
if Space was correlated within the specified timeout and false
if the waiting time elapsed before correlation took placeGridServiceManager waitForManaged()
GridServiceManager
for the processing unit.true
if GSM was discovered within the default timeout and false
if the waiting time elapsed before discovery took placeGridServiceManager waitForManaged(long timeout, TimeUnit timeUnit)
GridServiceManager
for the processing unit
for the specified timeout.true
if GSM was discovered within the specified timeout and false
if the waiting time elapsed before discovery took placeboolean canIncrementInstance()
true
if this processing unit allows to increment instances on it.boolean canDecrementInstance()
true
if this processing unit allows to decrement instances on it.void incrementInstance()
void decrementInstance()
ProcessingUnitInstance.decrement()
instead.
Does not apply for partitioned nor replicated topologies.boolean isManaged()
true
if there is a managing GSM for it.GridServiceManager getManagingGridServiceManager()
GridServiceManager[] getBackupGridServiceManagers()
GridServiceManager getBackupGridServiceManager(String gridServiceManagerUID)
void undeploy()
undeployAndWait()
,
undeployAndWait(long, TimeUnit)
void undeployAndWait()
The undeployment process will wait indefinitely and return when all processing units have undeployed.
undeployAndWait(long, TimeUnit)
,
undeploy()
boolean undeployAndWait(long timeout, TimeUnit timeunit)
The undeployment process will wait for the given timeout and return when all processing units have undeployed or timeout expired.
undeployAndWait()
,
undeploy()
Space getSpace()
null
if
no embedded space is defined within the processing unit or if no processing unit instance
has been added to the processing unit.Space[] getSpaces()
ProcessingUnitInstance[] getInstances()
ProcessingUnitPartition[] getPartitions()
ProcessingUnitPartition getPartition(int partitionId)
ProcessingUnitInstanceAddedEventManager getProcessingUnitInstanceAdded()
ProcessingUnitInstanceAddedEventListener
s.ProcessingUnitInstanceRemovedEventManager getProcessingUnitInstanceRemoved()
ProcessingUnitInstanceRemovedEventListener
s.void addLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener)
void removeLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener)
ProcessingUnitInstanceLifecycleEventListener
.ManagingGridServiceManagerChangedEventManager getManagingGridServiceManagerChanged()
ManagingGridServiceManagerChangedEvent
s.BackupGridServiceManagerChangedEventManager getBackupGridServiceManagerChanged()
BackupGridServiceManagerChangedEvent
s.ProcessingUnitStatusChangedEventManager getProcessingUnitStatusChanged()
ProcessingUnitStatusChangedEvent
s.ProcessingUnitSpaceCorrelatedEventManager getSpaceCorrelated()
ProcessingUnitSpaceCorrelatedEvent
s.ProcessingUnitInstanceStatisticsChangedEventManager getProcessingUnitInstanceStatisticsChanged()
ProcessingUnitInstanceStatisticsChangedEvent
.
Note, in order to receive events, the virtual machines need to be in a "statistics" monitored state.
ProcessingUnitInstanceProvisionStatusChangedEventManager getProcessingUnitInstanceProvisionStatusChanged()
ProcessingUnitInstanceProvisionStatusChangedEventListener
s.ProcessingUnitInstanceMemberAliveIndicatorStatusChangedEventManager getProcessingUnitInstanceMemberAliveIndicatorStatusChanged()
ProcessingUnitInstanceMemberAliveIndicatorStatusChangedEventListener
s.void scale(ScaleStrategyConfig strategyConfig)
scaleAndWait(ScaleStrategyConfig)
,
scaleAndWait(ScaleStrategyConfig, long, TimeUnit)
void scaleAndWait(ScaleStrategyConfig strategyConfig)
scale(ScaleStrategyConfig)
boolean scaleAndWait(ScaleStrategyConfig strategyConfig, long timeout, TimeUnit timeUnit)
false
if timeout occurred before scale operation has completed.scale(ScaleStrategyConfig)
Application getApplication()
ProcessingUnitDependencies<ProcessingUnitDependency> getDependencies()
QuiesceResult quiesce(QuiesceRequest request)
waitFor(com.gigaspaces.admin.quiesce.QuiesceState)
returned true)
all space instances and listeners will switch to quiesced mode.
If the GSM rejects the request an exception with the rejection failure will be thrown.
(precondition: the processing unit is intact)request
- with the quiesce descriptionQuiesceRequest
if the request was approved by the servervoid unquiesce(QuiesceRequest request)
waitFor(com.gigaspaces.admin.quiesce.QuiesceState)
returned true)
all space instances and listeners will switch to unquiesced mode.
If the GSM rejects the request an exception with the rejection failure will be thrown.
(precondition: the processing unit is intact)request
- with the quiesce descriptionboolean waitFor(com.gigaspaces.admin.quiesce.QuiesceState desiredState, long timeout, TimeUnit timeUnit)
desiredState
- timeout
- timeUnit
- true
if the processing unit reached to desired as well as all instances in the requested timeout, false
otherwise.boolean waitFor(com.gigaspaces.admin.quiesce.QuiesceState desiredState)
waitFor(com.gigaspaces.admin.quiesce.QuiesceState, long, java.util.concurrent.TimeUnit)
but with endless timeoutQuiesceDetails getQuiesceDetails()
QuiesceDetails
Copyright © GigaSpaces.