Class DefaultProcessingUnit
- All Implemented Interfaces:
Iterable<ProcessingUnitInstance>,AdminAware,InternalApplicationAware,InternalProcessingUnit,InternalProcessingUnitInstancesAware,ProcessingUnit,StatisticsMonitor
- Author:
- kimchy
-
Field Summary
Fields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL -
Constructor Summary
ConstructorsConstructorDescriptionDefaultProcessingUnit(InternalAdmin admin, InternalProcessingUnits processingUnits, com.gigaspaces.grid.gsm.PUDetails details, BeanLevelProperties beanLevelProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBackupGridServiceManager(GridServiceManager backupGridServiceManager) voidaddEmbeddedSpace(Space space) voidaddLifecycleListener(ProcessingUnitInstanceLifecycleEventListener eventListener) voidaddManagingGridServiceManager(GridServiceManager gridServiceManager) voidaddProcessingUnitInstance(ProcessingUnitInstance processingUnitInstance) voidaddStatisticsCalculation(ProcessingUnitStatisticsId statisticsId) Adds the specified statistics calculationvoidbooleanbooleanvoidRemoves a randomly chosen instance from the processing unit, and decrements the number of instances.booleanDecrements a planned instance if the number of planned instances is less then the actual instances to maintain.booleangetAdmin()Returns theAdminassociated with this element.This method is used by the webui.getBackupGridServiceManager(String gridServiceManagerUID) getHostingGridServiceAgentZones(ProcessingUnitInstance processingUnitInstance) return the exact zones of the agent that belongs to processing unit instanceintintgetName()intintDeprecated.getPartition(int partitionId) intFor stateful processing unit (primary+backup Space) will return the current planned number of instances (including backups).intFor stateful processing unit (primary+backup Space) will return the planned partition count - i.e.getProcessingUnitInstance(int instanceId, int backupId) returns the processing unit instance based on its uid (seeGridComponent.getUid())String[]In the case of application name prefix just processing unit name will be returned.getSpace()Space[]intDeprecated.getType()inthashCode()booleanhasSpace()Returns true if there are any embedded spaces, false otherwise.voidIncrements the number of processing unit instances.booleanbooleanbooleanReturnstrueif statistics are now being monitored.booleanbooleanbooleanisStub()iterator()lock()voidprocessProvisionEvent(org.jini.rio.monitor.ProvisionLifeCycleEvent provisionLifeCycleEvent) quiesce(QuiesceRequest request) Requests a quiesce request from the GSM.quiesceUnsafe(QuiesceRequest request) Performs quiesce - should always be called after acquiring pu lockvoidremoveBackupGridServiceManager(String gsmUID) booleanremoveEmbeddedSpace(Space space) voidRemoves aProcessingUnitInstanceLifecycleEventListener.voidvoidremoveStatisticsCalculation(ProcessingUnitStatisticsId statisticsId) Removes the specified statistics calculationvoidscaleHorizontal(int target, String memory, String cpu, String requestId) voidscaleVertical(String memory, String cpu, Long timeout, PuScaleVStatusChangedEventListener listener) voidsetApplication(Application application) voidsetBackupGsmInSync(boolean backupGsmIsInSync) voidsetLogLevel(String loggerName, String level) voidsetManagingGridServiceManager(GridServiceManager gridServiceManager) voidsetNumberOfBackups(int numberOfBackups) voidsetNumberOfInstances(int numberOfInstances) voidsetStatisticsHistorySize(int historySize) Sets the history size of number of statistics stored.voidsetStatisticsInterval(long interval, TimeUnit timeUnit) Sets the statistics interval, automatically updating the monitoring scheduled tasks if monitoring is enabled.booleansetStatus(int statusCode) voidsetStub(boolean stub) voidStarts the statistics monitor, starting a scheduled monitor that polls for statistics.voidStops the statistics monitor.voidundeploy()voidUn-deploys the processing unit and waits until all instances have been undeployed.booleanundeployAndWait(long timeout, TimeUnit timeUnit) Undeploy the processing unit and wait until all instances have been undeployed.undeployAsync(UndeployOptions options) voidunquiesce(QuiesceRequest request) Requests a unquiesce request from the GSM.voidupdateStub(ProcessingUnitInstance processingUnitInstance) booleanwaitFor(int numberOfProcessingUnitInstances) Waits till at least the provided number of Processing Unit Instances are up.booleanWaits till at least the provided number of Processing Unit Instances are up for the specified timeout.booleanwaitFor(QuiesceState desiredState) Same asProcessingUnit.waitFor(com.gigaspaces.admin.quiesce.QuiesceState, long, java.util.concurrent.TimeUnit)but with endless timeoutbooleanwaitFor(QuiesceState desiredState, long timeout, TimeUnit timeUnit) Waits till there is a managingGridServiceManagerfor the processing unit.waitForManaged(long timeout, TimeUnit timeUnit) Waits till there is a managingGridServiceManagerfor the processing unit for the specified timeout.Waits till an embedded Space is correlated with the processing unit.waitForSpace(long timeout, TimeUnit timeUnit) Waits till an embedded Space is correlated with the processing unit for the specified timeout.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultProcessingUnit
public DefaultProcessingUnit(InternalAdmin admin, InternalProcessingUnits processingUnits, com.gigaspaces.grid.gsm.PUDetails details, BeanLevelProperties beanLevelProperties)
-
-
Method Details
-
getProcessingUnits
- Specified by:
getProcessingUnitsin interfaceProcessingUnit- Returns:
- Returns the handle to all the different processing units.
-
getAdmin
Description copied from interface:AdminAwareReturns theAdminassociated with this element.- Specified by:
getAdminin interfaceAdminAware
-
getName
- Specified by:
getNamein interfaceProcessingUnit- Returns:
- Returns the name of the processing unit.
-
getBeanLevelProperties
- Specified by:
getBeanLevelPropertiesin interfaceProcessingUnit- Returns:
- Return the deploy time properties of the processing unit.
-
getType
- Specified by:
getTypein interfaceProcessingUnit- Returns:
- Returns the type of processing unit: stateless, stateful, mirror, web.
-
getManagingGridServiceManagerChanged
- Specified by:
getManagingGridServiceManagerChangedin interfaceProcessingUnit- Returns:
- Returns an event manger allowing to listen for
ManagingGridServiceManagerChangedEvents.
-
setLogLevel
- Specified by:
setLogLevelin interfaceProcessingUnit- Throws:
AdminException
-
getBackupGridServiceManagerChanged
- Specified by:
getBackupGridServiceManagerChangedin interfaceProcessingUnit- Returns:
- Returns an event manager allowing to listen for
BackupGridServiceManagerChangedEvents.
-
hasSpace
public boolean hasSpace()Description copied from interface:ProcessingUnitReturns true if there are any embedded spaces, false otherwise.- Specified by:
hasSpacein interfaceProcessingUnit
-
getSpace
- Specified by:
getSpacein interfaceProcessingUnit- Returns:
- Returns the (first) embedded space within a processing unit. Returns
nullif no embedded space is defined within the processing unit or if no processing unit instance has been added to the processing unit.
-
getSpaces
- Specified by:
getSpacesin interfaceProcessingUnit- Returns:
- 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.
-
addEmbeddedSpace
- Specified by:
addEmbeddedSpacein interfaceInternalProcessingUnit
-
removeEmbeddedSpace
- Specified by:
removeEmbeddedSpacein interfaceInternalProcessingUnit
-
getProcessingUnitStatusChanged
- Specified by:
getProcessingUnitStatusChangedin interfaceProcessingUnit- Returns:
- Returns an event manager allowing to listen for
ProcessingUnitStatusChangedEvents.
-
getProcessingUnitInstanceAdded
- Specified by:
getProcessingUnitInstanceAddedin interfaceProcessingUnit- Returns:
- Returns an event manager allowing to register
ProcessingUnitInstanceAddedEventListeners.
-
getProcessingUnitInstanceRemoved
- Specified by:
getProcessingUnitInstanceRemovedin interfaceProcessingUnit- Returns:
- Returns an event manager allowing to register
ProcessingUnitInstanceRemovedEventListeners.
-
getProcessingUnitInstance
- Specified by:
getProcessingUnitInstancein interfaceProcessingUnit- Returns:
- Returns a processing unit instance based on the specified instance id and backup id
-
addLifecycleListener
Description copied from interface:ProcessingUnit- Specified by:
addLifecycleListenerin interfaceProcessingUnit
-
removeLifecycleListener
Description copied from interface:ProcessingUnitRemoves aProcessingUnitInstanceLifecycleEventListener.- Specified by:
removeLifecycleListenerin interfaceProcessingUnit
-
getNumberOfInstances
Deprecated.- Specified by:
getNumberOfInstancesin interfaceProcessingUnit- Returns:
- Returns the number of required instances as defined in the processing unit's SLA. If there are backups, it will only return the number of primary instances and not the number of backup.
-
getPlannedNumberOfPartitions
public int getPlannedNumberOfPartitions()Description copied from interface:ProcessingUnitFor stateful processing unit (primary+backup Space) will return the planned partition count - i.e. the number of planned primary instances (excluding backups). If called for a stateless processing unit, will return the planned number of instances. Note that this method does not count the number of running instances, but rather the number of planned primary instances for the processing unit. To count the number of currently discovered running processing unit partitions use the methodProcessingUnit.getPartitions().- Specified by:
getPlannedNumberOfPartitionsin interfaceProcessingUnit- Returns:
- Returns the number of planned primary instances excluding backup instances.
-
getPlannedNumberOfInstances
public int getPlannedNumberOfInstances()Description copied from interface:ProcessingUnitFor stateful processing unit (primary+backup Space) will return the current planned number of instances (including backups). For stateless processing unit will return the number of current planned instances. The plan denoted by the initial SLA may change due to increments/decrements performed manually. Note that this method does not count the number of running instances, but rather the number of planned number of instances for the processing unit. To count the number of currently discovered running processing unit instances use the methodProcessingUnit.getInstances().- Specified by:
getPlannedNumberOfInstancesin interfaceProcessingUnit- Returns:
- Returns the number of required instances as defined in the processing unit's current SLA.
-
setNumberOfInstances
public void setNumberOfInstances(int numberOfInstances) - Specified by:
setNumberOfInstancesin interfaceInternalProcessingUnit
-
getNumberOfBackups
public int getNumberOfBackups()- Specified by:
getNumberOfBackupsin interfaceProcessingUnit- Returns:
- Returns the number of backups (if the topology is a backup one) per instance, as defined in the processing unit's SLA. Note that this method does not return he number of running backup instances, but rather the number of planned backup instances per primary as defined by the initial SLA.
-
setNumberOfBackups
public void setNumberOfBackups(int numberOfBackups) - Specified by:
setNumberOfBackupsin interfaceInternalProcessingUnit
-
getTotalNumberOfInstances
Deprecated.- Specified by:
getTotalNumberOfInstancesin interfaceProcessingUnit- Returns:
- Returns the total required number of instances as defined in the processing SLA. If
there are no backups, will return
ProcessingUnit.getNumberOfInstances(). If there are backups, will returnProcessingUnit.getNumberOfInstances()* (ProcessingUnit.getNumberOfBackups()+ 1)
-
getMaxInstancesPerVM
public int getMaxInstancesPerVM()- Specified by:
getMaxInstancesPerVMin interfaceProcessingUnit- Returns:
- Returns the number of instances 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).
-
isRequiresIsolation
public boolean isRequiresIsolation()- Specified by:
isRequiresIsolationin interfaceProcessingUnit- Returns:
- true if isolation is required per virtual machine. No processing unit instances can run on the same virtual machine. Default false.
-
getMaxInstancesPerMachine
public int getMaxInstancesPerMachine()- Specified by:
getMaxInstancesPerMachinein interfaceProcessingUnit- Returns:
- Returns the number of instances 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).
-
getClusterSchema
- Specified by:
getClusterSchemain interfaceInternalProcessingUnit
-
getMaxInstancesPerZone
- Specified by:
getMaxInstancesPerZonein interfaceProcessingUnit- Returns:
- Returns a map containing the zone name and the maximum number of instances for that zone.
-
getRequiredZones
- Specified by:
getRequiredZonesin interfaceProcessingUnit- Returns:
- 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.
-
getPrimaryZones
- Specified by:
getPrimaryZonesin interfaceProcessingUnit- Returns:
- Returns the preferred zones for primary instances.
-
getStatus
- Specified by:
getStatusin interfaceProcessingUnit- Returns:
- Returns the deployment status of the processing unit.
-
waitFor
public boolean waitFor(int numberOfProcessingUnitInstances) Description copied from interface:ProcessingUnitWaits till at least the provided number of Processing Unit Instances are up.- Specified by:
waitForin interfaceProcessingUnit- Returns:
trueif discovered the required number of instances within the default timeout andfalseif the waiting time elapsed before the discovery took place
-
waitFor
Description copied from interface:ProcessingUnitWaits till at least the provided number of Processing Unit Instances are up for the specified timeout.- Specified by:
waitForin interfaceProcessingUnit- Returns:
trueif discovered the required number of instances within the specified timeout andfalseif the waiting time elapsed before the discovery took place
-
waitForSpace
Description copied from interface:ProcessingUnitWaits till an embedded Space is correlated with the processing unit.- Specified by:
waitForSpacein interfaceProcessingUnit- Returns:
- Returns the embedded Space within a processing unit if the Space was correlated
within the default timeout; Otherwise
nullif the waiting time elapsed before correlation took place.
-
waitForSpace
Description copied from interface:ProcessingUnitWaits till an embedded Space is correlated with the processing unit for the specified timeout.- Specified by:
waitForSpacein interfaceProcessingUnit- Returns:
- Returns the embedded Space within a processing unit if the Space was correlated
within the specified timeout; Otherwise
nullif the waiting time elapsed before correlation took place.
-
waitForManaged
Description copied from interface:ProcessingUnitWaits till there is a managingGridServiceManagerfor the processing unit.- Specified by:
waitForManagedin interfaceProcessingUnit- Returns:
- Returns the managing (primary) GSM for the processing unit if GSM was discovered
within the default timeout; Otherwise
nullif the waiting time elapsed before discovery took place.
-
waitForManaged
Description copied from interface:ProcessingUnitWaits till there is a managingGridServiceManagerfor the processing unit for the specified timeout.- Specified by:
waitForManagedin interfaceProcessingUnit- Returns:
- Returns the managing (primary) GSM for the processing unit if GSM was discovered
within the specified timeout; Otherwise
nullif the waiting time elapsed before discovery took place.
-
canIncrementInstance
public boolean canIncrementInstance()- Specified by:
canIncrementInstancein interfaceProcessingUnit- Returns:
- Returns
trueif this processing unit allows to increment instances on it.
-
canDecrementInstance
public boolean canDecrementInstance()- Specified by:
canDecrementInstancein interfaceProcessingUnit- Returns:
- Returns
trueif this processing unit allows to decrement instances on it.
-
incrementInstance
public void incrementInstance()Description copied from interface:ProcessingUnitIncrements the number of processing unit instances. Does not apply for partitioned nor replicated topologies.- Specified by:
incrementInstancein interfaceProcessingUnit
-
decrementInstance
public void decrementInstance()Description copied from interface:ProcessingUnitRemoves a randomly chosen instance from the processing unit, and decrements the number of instances. For finer control useProcessingUnitInstance.decrement()instead. Does not apply for partitioned nor replicated topologies.- Specified by:
decrementInstancein interfaceProcessingUnit
-
getManagingGridServiceManager
- Specified by:
getManagingGridServiceManagerin interfaceProcessingUnit- Returns:
- Returns the managing (primary) GSM for the processing unit.
-
getBackupGridServiceManagers
- Specified by:
getBackupGridServiceManagersin interfaceProcessingUnit- Returns:
- Returns the backup GSMs for the processing unit.
-
isManaged
public boolean isManaged()- Specified by:
isManagedin interfaceProcessingUnit- Returns:
- Returns
trueif there is a managing GSM for it.
-
getBackupGridServiceManager
- Specified by:
getBackupGridServiceManagerin interfaceProcessingUnit- Returns:
- Returns the backup GSM matching the provided UID.
-
undeployAsync
- Specified by:
undeployAsyncin interfaceProcessingUnit- Returns:
- A future which can be used to track completion
-
undeployAsync
- Specified by:
undeployAsyncin interfaceProcessingUnit- Parameters:
options- determine the wanted drain behaviour before undeploy- Returns:
- A future which can be used to track completion
- See Also:
-
undeployAndWait
Description copied from interface:ProcessingUnitUndeploy the processing unit and wait until all instances have been undeployed. In case of an Elastic processing unit, it waits until all containers have been removed.The undeployment process will wait for the given timeout and return when all processing units have undeployed or timeout expired.
- Specified by:
undeployAndWaitin interfaceProcessingUnit- Returns:
- True if un-deploy completed successfully within the specified timeout. False if undeploy is still in progress.
- See Also:
-
undeployAndWait
public void undeployAndWait()Description copied from interface:ProcessingUnitUn-deploys the processing unit and waits until all instances have been undeployed. In case of an Elastic processing unit, also waits for containers to shutdown.The undeployment process will wait indefinitely and return when all processing units have undeployed.
- Specified by:
undeployAndWaitin interfaceProcessingUnit- See Also:
-
undeploy
public void undeploy()- Specified by:
undeployin interfaceProcessingUnit- See Also:
-
setManagingGridServiceManager
- Specified by:
setManagingGridServiceManagerin interfaceInternalProcessingUnit
-
addManagingGridServiceManager
- Specified by:
addManagingGridServiceManagerin interfaceInternalProcessingUnit
-
addBackupGridServiceManager
- Specified by:
addBackupGridServiceManagerin interfaceInternalProcessingUnit
-
removeBackupGridServiceManager
- Specified by:
removeBackupGridServiceManagerin interfaceInternalProcessingUnit
-
setStatus
public boolean setStatus(int statusCode) - Specified by:
setStatusin interfaceInternalProcessingUnit
-
iterator
- Specified by:
iteratorin interfaceIterable<ProcessingUnitInstance>
-
getInstances
- Specified by:
getInstancesin interfaceProcessingUnit- Returns:
- Returns the processing unit instances currently discovered.
-
getProcessingUnitInstances
- Specified by:
getProcessingUnitInstancesin interfaceInternalProcessingUnitInstancesAware
-
getPartitions
- Specified by:
getPartitionsin interfaceProcessingUnit- Returns:
- Returns the processing unit partitions of this processing unit.
-
getPartition
- Specified by:
getPartitionin interfaceProcessingUnit- Returns:
- Returns a processing unit partition based on the specified partition id.
-
addProcessingUnitInstance
- Specified by:
addProcessingUnitInstancein interfaceInternalProcessingUnit
-
removeProcessingUnitInstance
- Specified by:
removeProcessingUnitInstancein interfaceInternalProcessingUnit
-
getProcessingUnitInstanceStatisticsChanged
public ProcessingUnitInstanceStatisticsChangedEventManager getProcessingUnitInstanceStatisticsChanged()- Specified by:
getProcessingUnitInstanceStatisticsChangedin interfaceProcessingUnit- Returns:
- 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.
-
setStatisticsInterval
Description copied from interface:StatisticsMonitorSets the statistics interval, automatically updating the monitoring scheduled tasks if monitoring is enabled.- Specified by:
setStatisticsIntervalin interfaceStatisticsMonitor
-
setStatisticsHistorySize
public void setStatisticsHistorySize(int historySize) Description copied from interface:StatisticsMonitorSets the history size of number of statistics stored.- Specified by:
setStatisticsHistorySizein interfaceStatisticsMonitor
-
startStatisticsMonitor
public void startStatisticsMonitor()Description copied from interface:StatisticsMonitorStarts the statistics monitor, starting a scheduled monitor that polls for statistics. Monitoring is required only when wanting to receive statistics change events.- Specified by:
startStatisticsMonitorin interfaceStatisticsMonitor
-
stopStatisticsMonitor
public void stopStatisticsMonitor()Description copied from interface:StatisticsMonitorStops the statistics monitor.- Specified by:
stopStatisticsMonitorin interfaceStatisticsMonitor
-
isMonitoring
public boolean isMonitoring()Description copied from interface:StatisticsMonitorReturnstrueif statistics are now being monitored.- Specified by:
isMonitoringin interfaceStatisticsMonitor
-
equals
-
hashCode
public int hashCode() -
getApplicationName
- Specified by:
getApplicationNamein interfaceInternalProcessingUnit
-
getApplication
- Specified by:
getApplicationin interfaceProcessingUnit- Returns:
- the application that this processing unit is associated with or null if this processing unit is not part of an application
-
setApplication
- Specified by:
setApplicationin interfaceInternalApplicationAware
-
decrementPlannedInstances
public boolean decrementPlannedInstances()Description copied from interface:InternalProcessingUnitDecrements a planned instance if the number of planned instances is less then the actual instances to maintain.- Specified by:
decrementPlannedInstancesin interfaceInternalProcessingUnit- Returns:
trueif a planned instance was successfully decremented;falseplanned instances hasn't changed.
-
getApplicationDependencies
This method is used by the webui. Need to use getDependencies once Cloudify is migrated to use the dependencies API- Specified by:
getApplicationDependenciesin interfaceInternalProcessingUnit- Returns:
- The property value, in a CSV format.
-
getDependencies
- Specified by:
getDependenciesin interfaceProcessingUnit- Returns:
- the dependencies this processing unit has on other processing units.
-
processProvisionEvent
public void processProvisionEvent(org.jini.rio.monitor.ProvisionLifeCycleEvent provisionLifeCycleEvent) - Specified by:
processProvisionEventin interfaceInternalProcessingUnit
-
getProvisionStatusPerInstance
- Specified by:
getProvisionStatusPerInstancein interfaceInternalProcessingUnit
-
getSimpleName
Description copied from interface:InternalProcessingUnitIn the case of application name prefix just processing unit name will be returned. Otherwise name will be returned.- Specified by:
getSimpleNamein interfaceInternalProcessingUnit
-
getProcessingUnitInstanceProvisionStatusChanged
public ProcessingUnitInstanceProvisionStatusChangedEventManager getProcessingUnitInstanceProvisionStatusChanged()- Specified by:
getProcessingUnitInstanceProvisionStatusChangedin interfaceProcessingUnit- Returns:
- Returns an event manager allowing to register
ProcessingUnitInstanceProvisionStatusChangedEventListeners.
-
getProcessingUnitInstanceMemberAliveIndicatorStatusChanged
public ProcessingUnitInstanceMemberAliveIndicatorStatusChangedEventManager getProcessingUnitInstanceMemberAliveIndicatorStatusChanged()- Specified by:
getProcessingUnitInstanceMemberAliveIndicatorStatusChangedin interfaceProcessingUnit- Returns:
- Returns an event manager allowing to register
ProcessingUnitInstanceMemberAliveIndicatorStatusChangedEventListeners.
-
getStatistics
- Specified by:
getStatisticsin interfaceInternalProcessingUnit- Returns:
- the processing unit (aggregated) statistics.
-
getHostingGridServiceAgentZones
public ExactZonesConfig getHostingGridServiceAgentZones(ProcessingUnitInstance processingUnitInstance) throws AdminException Description copied from interface:InternalProcessingUnitreturn the exact zones of the agent that belongs to processing unit instance- Specified by:
getHostingGridServiceAgentZonesin interfaceInternalProcessingUnit- Parameters:
processingUnitInstance-- Returns:
- Throws:
AdminException
-
addStatisticsCalculation
Description copied from interface:InternalProcessingUnitAdds the specified statistics calculation- Specified by:
addStatisticsCalculationin interfaceInternalProcessingUnit
-
removeStatisticsCalculation
Description copied from interface:InternalProcessingUnitRemoves the specified statistics calculation- Specified by:
removeStatisticsCalculationin interfaceInternalProcessingUnit
-
getStatisticsCalculations
- Specified by:
getStatisticsCalculationsin interfaceInternalProcessingUnit- Returns:
- the generated statistics identifiers.
-
getRequiredContainerZones
- Specified by:
getRequiredContainerZonesin interfaceProcessingUnit- Returns:
- the @{link GridServiceContainer} zones that can satisfy this processing unit. For example: boolean gscMatch = pu.getRequiredContainerZones().isSatisfiedBy(gsc.getExactZones());
-
getGridServiceContainers
- Specified by:
getGridServiceContainersin interfaceProcessingUnit- Returns:
- Returns the @{link GridServiceContainer}s this processing unit is deployed on.
-
isBackupGsmInSync
public boolean isBackupGsmInSync()- Specified by:
isBackupGsmInSyncin interfaceInternalProcessingUnit- Returns:
- true if backup GSM is in sync with primary GSM, false if out of sync or no backup gsm.
-
getProcessingUnitInstanceByUid
Description copied from interface:InternalProcessingUnitreturns the processing unit instance based on its uid (seeGridComponent.getUid())- Specified by:
getProcessingUnitInstanceByUidin interfaceInternalProcessingUnit- Parameters:
uid- the unique id of the processing unit instance- Returns:
- the processing unit instance or null
-
isStandaloneProcessingUnit
public boolean isStandaloneProcessingUnit()- Specified by:
isStandaloneProcessingUnitin interfaceInternalProcessingUnit- Returns:
- true if this processing unit is un-managed by the Service Grid.
-
setBackupGsmInSync
public void setBackupGsmInSync(boolean backupGsmIsInSync) - Specified by:
setBackupGsmInSyncin interfaceInternalProcessingUnit- Parameters:
backupGsmIsInSync- - true if backup GSM is in sync with primary GSM, false if out of sync.
-
quiesce
Description copied from interface:ProcessingUnitRequests a quiesce request from the GSM. If the request ended successfully (ProcessingUnit.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)- Specified by:
quiescein interfaceProcessingUnit- Parameters:
request- with the quiesce description- Returns:
QuiesceRequestif the request was approved by the server
-
quiesceUnsafe
public QuiesceResult quiesceUnsafe(QuiesceRequest request) throws IOException, QuiesceFailedException Performs quiesce - should always be called after acquiring pu lock- Parameters:
request-- Returns:
- QuiesceResult
- Throws:
IOExceptionQuiesceFailedException
-
unquiesce
Description copied from interface:ProcessingUnitRequests a unquiesce request from the GSM. If the request ended successfully (ProcessingUnit.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)- Specified by:
unquiescein interfaceProcessingUnit- Parameters:
request- with the quiesce description
-
waitFor
- Specified by:
waitForin interfaceProcessingUnit- Returns:
trueif the processing unit reached to desired as well as all instances in the requested timeout,falseotherwise.
-
waitFor
Description copied from interface:ProcessingUnitSame asProcessingUnit.waitFor(com.gigaspaces.admin.quiesce.QuiesceState, long, java.util.concurrent.TimeUnit)but with endless timeout- Specified by:
waitForin interfaceProcessingUnit
-
getQuiesceDetails
- Specified by:
getQuiesceDetailsin interfaceProcessingUnit- Returns:
- the quiesce details of the processing unit -
QuiesceDetails
-
getArchiveName
- Specified by:
getArchiveNamein interfaceProcessingUnit- Returns:
- the archive(jar/war etc') the pu is running with
-
scaleHorizontal
- Specified by:
scaleHorizontalin interfaceInternalProcessingUnit
-
cancelScaleOut
- Specified by:
cancelScaleOutin interfaceInternalProcessingUnit- Throws:
IOExceptionTimeoutExceptionInterruptedException
-
scaleVertical
public void scaleVertical(String memory, String cpu, Long timeout, PuScaleVStatusChangedEventListener listener) - Specified by:
scaleVerticalin interfaceInternalProcessingUnit
-
getClusterTopology
- Specified by:
getClusterTopologyin interfaceInternalProcessingUnit- Throws:
IOException
-
lock
- Specified by:
lockin interfaceInternalProcessingUnit- Throws:
Exception
-
lock
public SharedLock lock(long timeout, TimeUnit timeunit) throws IOException, TimeoutException, InterruptedException - Specified by:
lockin interfaceInternalProcessingUnit- Throws:
IOExceptionTimeoutExceptionInterruptedException
-
setStub
public void setStub(boolean stub) - Specified by:
setStubin interfaceInternalProcessingUnit- Parameters:
stub- - true if PU was created before any instance
-
isStub
public boolean isStub()- Specified by:
isStubin interfaceInternalProcessingUnit
-
updateStub
- Specified by:
updateStubin interfaceInternalProcessingUnit
-