Class DefaultSpace
java.lang.Object
org.openspaces.admin.internal.space.DefaultSpace
- All Implemented Interfaces:
Iterable<SpaceInstance>,InternalSpace,InternalSpaceInstancesAware,Space,StatisticsMonitor
- Author:
- kimchy
-
Field Summary
Fields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSpace(InternalSpaces spaces, String uid, String name, boolean isSecured) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInstance(SpaceInstance spaceInstance) voidaddLifecycleListener(SpaceInstanceLifecycleEventListener eventListener) Allows to addSpaceInstanceLifecycleEventListener.getAdmin()Returns an aggregated view of all the statistics of the backup instances.In the case of single space null will be returned This call can might invoke remote callReturns the clustered view of the space to operate on.Returns all the space instances that are currently discovered that are part of this Space topology.Allows to register for space instance level statisticsSpaceInstanceStatisticsChangedEvents.getName()Returns the name of the Space.intReturns the number of backups per Space Instance.intReturns the number of instances as per the Space topology.getPartition(int partitionId) Returns a partition for a specific partition id.Returns all the partitions that form this Space topology.Returns an aggregated view of all the statistics of the primary instances.Returns a replication manager for this space.Allows to globally register for eachSpaceInstanceReplicationStatusChangedEvent.Returns an aggregated view of all the Space runtime details of all primary instances.intgetSize()Returns the number of currently discovered space instances.Allows to registeredSpaceInstanceAddedEventListenerto be notified when space instances are added.returns the Space instance based on its uid (seeGridComponent.getUid())Allows to registeredSpaceInstanceRemovedEventListenerto be notified when space instances are removed.Allows to globally register for eachSpaceInstanceSpaceModeChangedEvent.Returns the spaces this space is one of.Allows to globally register for eachSpaceInstanceSpaceSuspendTypeChangedEventReturns an aggregated view of all the statistics of all the instances.Allows to register for aggregated Space level statisticsSpaceStatisticsChangedEvent.intReturns the total number of instances.getUid()Returns the uid of the Space.booleanisEmpty()Returnstrueif there are currently no space instances discovered.booleanReturnstrueif statistics are now being monitored.booleanIndication if space is securediterator()voidremoveInstance(String uid) voidremoveLifecycleListener(SpaceInstanceLifecycleEventListener eventListener) Allows to removeSpaceInstanceLifecycleEventListener.voidreset IJSpace and Gigaspaces to null.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.voidStarts the statistics monitor, starting a scheduled monitor that polls for statistics.voidStops the statistics monitor.booleanwaitFor(int numberOfSpaceInstances) Waits till at least the provided number of Space Instances are up.booleanWaits till at least the provided number of Space Instances are up for the specified timeout.booleanWaits till at least the provided number of Space Instances that are of the space mode type are up.booleanWaits till at least the provided number of Space Instances are of the space mode type are up for the specified timeout.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultSpace
-
-
Method Details
-
getSpaces
Description copied from interface:SpaceReturns the spaces this space is one of. -
getUid
Description copied from interface:SpaceReturns the uid of the Space. -
getName
Description copied from interface:SpaceReturns the name of the Space. -
isSecured
public boolean isSecured()Description copied from interface:InternalSpaceIndication if space is secured- Specified by:
isSecuredin interfaceInternalSpace- Returns:
- instance of ClusterPolicy
-
getLastStatistics
- Specified by:
getLastStatisticsin interfaceInternalSpace
-
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
-
getNumberOfInstances
public int getNumberOfInstances()Description copied from interface:SpaceReturns the number of instances as per the Space topology. Will return 4 if we have a replicated topology, and 2 if we have a 2 partitions each with one backup topology.- Specified by:
getNumberOfInstancesin interfaceSpace
-
getNumberOfBackups
public int getNumberOfBackups()Description copied from interface:SpaceReturns the number of backups per Space Instance. Returns 1 when we deploy a 2 partitions each with one backup topology.- Specified by:
getNumberOfBackupsin interfaceSpace
-
getTotalNumberOfInstances
public int getTotalNumberOfInstances()Description copied from interface:SpaceReturns the total number of instances. If there are no backups, will returnSpace.getNumberOfInstances(). If there are backups, will returnSpace.getNumberOfInstances()* (Space.getNumberOfBackups()+ 1)- Specified by:
getTotalNumberOfInstancesin interfaceSpace
-
getInstances
Description copied from interface:SpaceReturns all the space instances that are currently discovered that are part of this Space topology.- Specified by:
getInstancesin interfaceSpace
-
iterator
- Specified by:
iteratorin interfaceIterable<SpaceInstance>
-
getPartitions
Description copied from interface:SpaceReturns all the partitions that form this Space topology.- Specified by:
getPartitionsin interfaceSpace
-
getPartition
Description copied from interface:SpaceReturns a partition for a specific partition id.- Specified by:
getPartitionin interfaceSpace
-
getSpaceModeChanged
Description copied from interface:SpaceAllows to globally register for eachSpaceInstanceSpaceModeChangedEvent.- Specified by:
getSpaceModeChangedin interfaceSpace
-
getSpaceSuspendTypeChanged
Description copied from interface:SpaceAllows to globally register for eachSpaceInstanceSpaceSuspendTypeChangedEvent- Specified by:
getSpaceSuspendTypeChangedin interfaceSpace
-
getReplicationStatusChanged
Description copied from interface:SpaceAllows to globally register for eachSpaceInstanceReplicationStatusChangedEvent.- Specified by:
getReplicationStatusChangedin interfaceSpace
-
getStatisticsChanged
Description copied from interface:SpaceAllows to register for aggregated Space level statisticsSpaceStatisticsChangedEvent.Note, statistics monitoring must be started using
StatisticsMonitor.startStatisticsMonitor()in order to receive events.- Specified by:
getStatisticsChangedin interfaceSpace
-
getInstanceStatisticsChanged
Description copied from interface:SpaceAllows to register for space instance level statisticsSpaceInstanceStatisticsChangedEvents.Note, statistics monitoring must be started using
StatisticsMonitor.startStatisticsMonitor()in order to receive events.- Specified by:
getInstanceStatisticsChangedin interfaceSpace
-
getStatistics
Description copied from interface:SpaceReturns an aggregated view of all the statistics of all the instances.- Specified by:
getStatisticsin interfaceSpace
-
getPrimariesStatistics
Description copied from interface:SpaceReturns an aggregated view of all the statistics of the primary instances.- Specified by:
getPrimariesStatisticsin interfaceSpace
-
getBackupsStatistics
Description copied from interface:SpaceReturns an aggregated view of all the statistics of the backup instances.- Specified by:
getBackupsStatisticsin interfaceSpace
-
getRuntimeDetails
Description copied from interface:SpaceReturns an aggregated view of all the Space runtime details of all primary instances.- Specified by:
getRuntimeDetailsin interfaceSpace
-
getReplicationManager
Description copied from interface:SpaceReturns a replication manager for this space.- Specified by:
getReplicationManagerin interfaceSpace
-
addInstance
- Specified by:
addInstancein interfaceInternalSpace
-
removeInstance
- Specified by:
removeInstancein interfaceInternalSpace
-
refreshScheduledSpaceMonitors
public void refreshScheduledSpaceMonitors()- Specified by:
refreshScheduledSpaceMonitorsin interfaceInternalSpace
-
getSize
public int getSize()Description copied from interface:SpaceReturns the number of currently discovered space instances. -
isEmpty
public boolean isEmpty()Description copied from interface:SpaceReturnstrueif there are currently no space instances discovered. -
getIJSpace
-
resetSpace
public void resetSpace()Description copied from interface:InternalSpacereset IJSpace and Gigaspaces to null.- Specified by:
resetSpacein interfaceInternalSpace
-
getGigaSpace
Description copied from interface:SpaceReturns the clustered view of the space to operate on.- Specified by:
getGigaSpacein interfaceSpace
-
waitFor
public boolean waitFor(int numberOfSpaceInstances) Description copied from interface:SpaceWaits till at least the provided number of Space Instances are up. -
waitFor
Description copied from interface:SpaceWaits till at least the provided number of Space Instances are up for the specified timeout. -
waitFor
Description copied from interface:SpaceWaits till at least the provided number of Space Instances that are of the space mode type are up. -
waitFor
public boolean waitFor(int numberOfSpaceInstances, SpaceMode spaceMode, long timeout, TimeUnit timeUnit) Description copied from interface:SpaceWaits till at least the provided number of Space Instances are of the space mode type are up for the specified timeout. -
getSpaceInstances
- Specified by:
getSpaceInstancesin interfaceInternalSpaceInstancesAware
-
getSpaceInstanceAdded
Description copied from interface:SpaceAllows to registeredSpaceInstanceAddedEventListenerto be notified when space instances are added.- Specified by:
getSpaceInstanceAddedin interfaceSpace
-
getSpaceInstanceRemoved
Description copied from interface:SpaceAllows to registeredSpaceInstanceRemovedEventListenerto be notified when space instances are removed.- Specified by:
getSpaceInstanceRemovedin interfaceSpace
-
addLifecycleListener
Description copied from interface:SpaceAllows to addSpaceInstanceLifecycleEventListener.- Specified by:
addLifecycleListenerin interfaceSpace
-
removeLifecycleListener
Description copied from interface:SpaceAllows to removeSpaceInstanceLifecycleEventListener.- Specified by:
removeLifecycleListenerin interfaceSpace
-
getAdmin
- Specified by:
getAdminin interfaceInternalSpace
-
getSpaceInstanceByUid
Description copied from interface:InternalSpacereturns the Space instance based on its uid (seeGridComponent.getUid())- Specified by:
getSpaceInstanceByUidin interfaceInternalSpace- Parameters:
uid- the unique id of the Space instance- Returns:
- the Space instance or null
-
getClusterPolicy
Description copied from interface:InternalSpaceIn the case of single space null will be returned This call can might invoke remote call- Specified by:
getClusterPolicyin interfaceInternalSpace- Returns:
- instance of ClusterPolicy
-