Interface Space
- All Superinterfaces:
Iterable<SpaceInstance>,StatisticsMonitor
- All Known Subinterfaces:
InternalSpace
- All Known Implementing Classes:
DefaultSpace
SpaceInstances the form a
topology.
There are two main logical of topologies, one that has backups to each space instance, and one
that is without backups. For example, a partitioned topology of 2 partitions, each with one
backup will return 2 for getNumberOfInstances() and 1 for getNumberOfBackups().
A replicated topology of 4 will return 4 for getNumberOfInstances() and 0 for getNumberOfBackups().
A Space will be discovered once one of its SpaceInstance
have been discovered. It will be removed once there are no SpaceInstances running.
Provides the ability to start a statistics monitor on all current SpaceInstances using StatisticsMonitor.startStatisticsMonitor(). Newly
discovered space instances will automatically use the statistics monitor as well.
- Author:
- kimchy
-
Field Summary
Fields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLifecycleListener(SpaceInstanceLifecycleEventListener eventListener) Allows to addSpaceInstanceLifecycleEventListener.Returns an aggregated view of all the statistics of the backup instances.Returns 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.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.voidremoveLifecycleListener(SpaceInstanceLifecycleEventListener eventListener) Allows to removeSpaceInstanceLifecycleEventListener.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 interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.openspaces.admin.StatisticsMonitor
isMonitoring, setStatisticsHistorySize, setStatisticsInterval, startStatisticsMonitor, stopStatisticsMonitor
-
Method Details
-
getSpaces
Spaces getSpaces()Returns the spaces this space is one of. -
getUid
String getUid()Returns the uid of the Space. -
getName
String getName()Returns the name of the Space. -
getNumberOfInstances
int getNumberOfInstances()Returns 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. -
getNumberOfBackups
int getNumberOfBackups()Returns the number of backups per Space Instance. Returns 1 when we deploy a 2 partitions each with one backup topology. -
getTotalNumberOfInstances
int getTotalNumberOfInstances()Returns the total number of instances. If there are no backups, will returngetNumberOfInstances(). If there are backups, will returngetNumberOfInstances()* (getNumberOfBackups()+ 1) -
getInstances
SpaceInstance[] getInstances()Returns all the space instances that are currently discovered that are part of this Space topology. -
getPartitions
SpacePartition[] getPartitions()Returns all the partitions that form this Space topology. -
getPartition
Returns a partition for a specific partition id. -
getSize
int getSize()Returns the number of currently discovered space instances. -
isEmpty
boolean isEmpty()Returnstrueif there are currently no space instances discovered. -
getGigaSpace
GigaSpace getGigaSpace()Returns the clustered view of the space to operate on. -
waitFor
boolean waitFor(int numberOfSpaceInstances) Waits till at least the provided number of Space Instances are up. -
waitFor
Waits till at least the provided number of Space Instances are up for the specified timeout. -
waitFor
Waits till at least the provided number of Space Instances that are of the space mode type are up. -
waitFor
Waits till at least the provided number of Space Instances are of the space mode type are up for the specified timeout. -
getStatistics
SpaceStatistics getStatistics()Returns an aggregated view of all the statistics of all the instances. -
getPrimariesStatistics
SpaceStatistics getPrimariesStatistics()Returns an aggregated view of all the statistics of the primary instances. -
getBackupsStatistics
SpaceStatistics getBackupsStatistics()Returns an aggregated view of all the statistics of the backup instances. -
getRuntimeDetails
SpaceRuntimeDetails getRuntimeDetails()Returns an aggregated view of all the Space runtime details of all primary instances. -
getReplicationManager
SpaceReplicationManager getReplicationManager()Returns a replication manager for this space.- Since:
- 9.0
-
getSpaceInstanceAdded
SpaceInstanceAddedEventManager getSpaceInstanceAdded()Allows to registeredSpaceInstanceAddedEventListenerto be notified when space instances are added. -
getSpaceInstanceRemoved
SpaceInstanceRemovedEventManager getSpaceInstanceRemoved()Allows to registeredSpaceInstanceRemovedEventListenerto be notified when space instances are removed. -
addLifecycleListener
Allows to addSpaceInstanceLifecycleEventListener. -
removeLifecycleListener
Allows to removeSpaceInstanceLifecycleEventListener. -
getSpaceModeChanged
SpaceModeChangedEventManager getSpaceModeChanged()Allows to globally register for eachSpaceInstanceSpaceModeChangedEvent. -
getSpaceSuspendTypeChanged
SpaceSuspendTypeChangedEventManager getSpaceSuspendTypeChanged()Allows to globally register for eachSpaceInstanceSpaceSuspendTypeChangedEvent -
getReplicationStatusChanged
ReplicationStatusChangedEventManager getReplicationStatusChanged()Allows to globally register for eachSpaceInstanceReplicationStatusChangedEvent. -
getStatisticsChanged
SpaceStatisticsChangedEventManager getStatisticsChanged()Allows to register for aggregated Space level statisticsSpaceStatisticsChangedEvent.Note, statistics monitoring must be started using
StatisticsMonitor.startStatisticsMonitor()in order to receive events. -
getInstanceStatisticsChanged
SpaceInstanceStatisticsChangedEventManager getInstanceStatisticsChanged()Allows to register for space instance level statisticsSpaceInstanceStatisticsChangedEvents.Note, statistics monitoring must be started using
StatisticsMonitor.startStatisticsMonitor()in order to receive events.
-