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() |
String |
getArchiveName() |
GridServiceManager |
getBackupGridServiceManager(String gridServiceManagerUID) |
BackupGridServiceManagerChangedEventManager |
getBackupGridServiceManagerChanged() |
GridServiceManager[] |
getBackupGridServiceManagers() |
BeanLevelProperties |
getBeanLevelProperties() |
ProcessingUnitDependencies<ProcessingUnitDependency> |
getDependencies() |
GridServiceContainer[] |
getGridServiceContainers() |
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.
|
Set<String> |
getPrimaryZones() |
ProcessingUnitInstance |
getProcessingUnitInstance(int instanceId,
int backupId) |
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() |
boolean |
hasSpace()
Returns true if there are any embedded spaces, false otherwise.
|
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 |
setLogLevel(String loggerName,
String level) |
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.
|
CompletableFuture<?> |
undeployAsync() |
CompletableFuture<?> |
undeployAsync(UndeployOptions options) |
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(QuiesceState desiredState)
Same as
waitFor(com.gigaspaces.admin.quiesce.QuiesceState, long,
java.util.concurrent.TimeUnit) but with endless timeout |
boolean |
waitFor(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()
Set<String> getPrimaryZones()
RequiredZonesConfig getRequiredContainerZones()
GridServiceContainer[] getGridServiceContainers()
DeploymentStatus getStatus()
BeanLevelProperties getBeanLevelProperties()
ProcessingUnitType getType()
void setLogLevel(String loggerName, String level) throws AdminException
AdminException
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()
null
if the waiting time elapsed before
correlation took place.Space waitForSpace(long timeout, TimeUnit timeUnit)
null
if the waiting time elapsed before
correlation took place.GridServiceManager waitForManaged()
GridServiceManager
for the
processing unit.null
if the waiting time elapsed before
discovery took place.GridServiceManager waitForManaged(long timeout, TimeUnit timeUnit)
GridServiceManager
for the
processing unit for the specified timeout.null
if the waiting time elapsed before
discovery took place.boolean 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)
CompletableFuture<?> undeployAsync()
CompletableFuture<?> undeployAsync(UndeployOptions options)
options
- determine the wanted drain behaviour before undeployUndeployOptions
void undeployAndWait()
The undeployment process will wait indefinitely and return when all processing units have undeployed.
undeployAsync()
,
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.
undeployAsync()
,
undeployAndWait()
,
undeploy()
boolean hasSpace()
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.ProcessingUnitInstance getProcessingUnitInstance(int instanceId, int backupId)
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.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(QuiesceState desiredState, long timeout, TimeUnit timeUnit)
true
if the processing unit reached to desired as well as all instances in
the requested timeout, false
otherwise.boolean waitFor(QuiesceState desiredState)
waitFor(com.gigaspaces.admin.quiesce.QuiesceState, long,
java.util.concurrent.TimeUnit)
but with endless timeoutQuiesceDetails getQuiesceDetails()
QuiesceDetails
String getArchiveName()
Copyright © GigaSpaces.