public class DefaultSpace extends Object implements InternalSpace
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL| Constructor and Description |
|---|
DefaultSpace(InternalSpaces spaces,
String uid,
String name,
boolean isSecured) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInstance(SpaceInstance spaceInstance) |
void |
addLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
Allows to add
SpaceInstanceLifecycleEventListener. |
Admin |
getAdmin() |
SpaceStatistics |
getBackupsStatistics()
Returns an aggregated view of all the statistics of the backup instances.
|
ClusterPolicy |
getClusterPolicy()
In the case of single space null will be returned
This call can might invoke remote call
|
GigaSpace |
getGigaSpace()
Returns the clustered view of the space to operate on.
|
IJSpace |
getIJSpace() |
SpaceInstance[] |
getInstances()
Returns all the space instances that are currently discovered that are part of this Space
topology.
|
SpaceInstanceStatisticsChangedEventManager |
getInstanceStatisticsChanged()
Allows to register for space instance level statistics
SpaceInstanceStatisticsChangedEvents. |
SpaceStatistics |
getLastStatistics() |
String |
getName()
Returns the name of the Space.
|
int |
getNumberOfBackups()
Returns the number of backups per Space Instance.
|
int |
getNumberOfInstances()
Returns the number of instances as per the Space topology.
|
SpacePartition |
getPartition(int partitionId)
Returns a partition for a specific partition id.
|
SpacePartition[] |
getPartitions()
Returns all the partitions that form this Space topology.
|
SpaceStatistics |
getPrimariesStatistics()
Returns an aggregated view of all the statistics of the primary instances.
|
SpaceReplicationManager |
getReplicationManager()
Returns a replication manager for this space.
|
ReplicationStatusChangedEventManager |
getReplicationStatusChanged()
Allows to globally register for each
SpaceInstance ReplicationStatusChangedEvent. |
SpaceRuntimeDetails |
getRuntimeDetails()
Returns an aggregated view of all the Space runtime details of all primary instances.
|
int |
getSize()
Returns the number of currently discovered space instances.
|
SpaceInstanceAddedEventManager |
getSpaceInstanceAdded()
Allows to registered
SpaceInstanceAddedEventListener
to be notified when space instances are added. |
SpaceInstance |
getSpaceInstanceByUid(String uid)
returns the Space instance based on its uid (see
GridComponent.getUid()) |
SpaceInstanceRemovedEventManager |
getSpaceInstanceRemoved()
Allows to registered
SpaceInstanceRemovedEventListener
to be notified when space instances are removed. |
SpaceInstance[] |
getSpaceInstances() |
SpaceModeChangedEventManager |
getSpaceModeChanged()
Allows to globally register for each
SpaceInstance
SpaceModeChangedEvent. |
Spaces |
getSpaces()
Returns the spaces this space is one of.
|
SpaceSuspendTypeChangedEventManager |
getSpaceSuspendTypeChanged()
Allows to globally register for each
SpaceInstance
SpaceSuspendTypeChangedEvent |
SpaceStatistics |
getStatistics()
Returns an aggregated view of all the statistics of all the instances.
|
SpaceStatisticsChangedEventManager |
getStatisticsChanged()
Allows to register for aggregated Space level statistics
SpaceStatisticsChangedEvent. |
int |
getTotalNumberOfInstances()
Returns the total number of instances.
|
String |
getUid()
Returns the uid of the Space.
|
boolean |
isEmpty()
Returns
true if there are currently no space instances discovered. |
boolean |
isMonitoring()
Returns
true if statistics are now being monitored. |
boolean |
isSecured()
Indication if space is secured
|
Iterator<SpaceInstance> |
iterator() |
void |
refreshScheduledSpaceMonitors() |
InternalSpaceInstance |
removeInstance(String uid) |
void |
removeLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
Allows to remove
SpaceInstanceLifecycleEventListener. |
void |
resetSpace()
reset IJSpace and Gigaspaces to null.
|
void |
setStatisticsHistorySize(int historySize)
Sets the history size of number of statistics stored.
|
void |
setStatisticsInterval(long interval,
TimeUnit timeUnit)
Sets the statistics interval, automatically updating the monitoring scheduled tasks if
monitoring is enabled.
|
void |
startStatisticsMonitor()
Starts the statistics monitor, starting a scheduled monitor that polls for statistics.
|
void |
stopStatisticsMonitor()
Stops the statistics monitor.
|
boolean |
waitFor(int numberOfSpaceInstances)
Waits till at least the provided number of Space Instances are up.
|
boolean |
waitFor(int numberOfSpaceInstances,
long timeout,
TimeUnit timeUnit)
Waits till at least the provided number of Space Instances are up for the specified timeout.
|
boolean |
waitFor(int numberOfSpaceInstances,
SpaceMode spaceMode)
Waits till at least the provided number of Space Instances that are of the space mode type
are up.
|
boolean |
waitFor(int numberOfSpaceInstances,
SpaceMode spaceMode,
long timeout,
TimeUnit timeUnit)
Waits till at least the provided number of Space Instances are of the space mode type are up
for the specified timeout.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic DefaultSpace(InternalSpaces spaces, String uid, String name, boolean isSecured)
public Spaces getSpaces()
Spacepublic String getUid()
Spacepublic String getName()
Spacepublic boolean isSecured()
InternalSpaceisSecured in interface InternalSpacepublic SpaceStatistics getLastStatistics()
getLastStatistics in interface InternalSpacepublic void setStatisticsInterval(long interval,
TimeUnit timeUnit)
StatisticsMonitorsetStatisticsInterval in interface StatisticsMonitorpublic void setStatisticsHistorySize(int historySize)
StatisticsMonitorsetStatisticsHistorySize in interface StatisticsMonitorpublic void startStatisticsMonitor()
StatisticsMonitorstartStatisticsMonitor in interface StatisticsMonitorpublic void stopStatisticsMonitor()
StatisticsMonitorstopStatisticsMonitor in interface StatisticsMonitorpublic boolean isMonitoring()
StatisticsMonitortrue if statistics are now being monitored.isMonitoring in interface StatisticsMonitorpublic int getNumberOfInstances()
SpacegetNumberOfInstances in interface Spacepublic int getNumberOfBackups()
SpacegetNumberOfBackups in interface Spacepublic int getTotalNumberOfInstances()
SpaceSpace.getNumberOfInstances(). If there are backups, will return Space.getNumberOfInstances() *
(Space.getNumberOfBackups() + 1)getTotalNumberOfInstances in interface Spacepublic SpaceInstance[] getInstances()
SpacegetInstances in interface Spacepublic Iterator<SpaceInstance> iterator()
iterator in interface Iterable<SpaceInstance>public SpacePartition[] getPartitions()
SpacegetPartitions in interface Spacepublic SpacePartition getPartition(int partitionId)
SpacegetPartition in interface Spacepublic SpaceModeChangedEventManager getSpaceModeChanged()
SpaceSpaceInstance
SpaceModeChangedEvent.getSpaceModeChanged in interface Spacepublic SpaceSuspendTypeChangedEventManager getSpaceSuspendTypeChanged()
SpaceSpaceInstance
SpaceSuspendTypeChangedEventgetSpaceSuspendTypeChanged in interface Spacepublic ReplicationStatusChangedEventManager getReplicationStatusChanged()
SpaceSpaceInstance ReplicationStatusChangedEvent.getReplicationStatusChanged in interface Spacepublic SpaceStatisticsChangedEventManager getStatisticsChanged()
SpaceSpaceStatisticsChangedEvent.
Note, statistics monitoring must be started using StatisticsMonitor.startStatisticsMonitor() in
order to receive events.
getStatisticsChanged in interface Spacepublic SpaceInstanceStatisticsChangedEventManager getInstanceStatisticsChanged()
SpaceSpaceInstanceStatisticsChangedEvents.
Note, statistics monitoring must be started using StatisticsMonitor.startStatisticsMonitor() in
order to receive events.
getInstanceStatisticsChanged in interface Spacepublic SpaceStatistics getStatistics()
SpacegetStatistics in interface Spacepublic SpaceStatistics getPrimariesStatistics()
SpacegetPrimariesStatistics in interface Spacepublic SpaceStatistics getBackupsStatistics()
SpacegetBackupsStatistics in interface Spacepublic SpaceRuntimeDetails getRuntimeDetails()
SpacegetRuntimeDetails in interface Spacepublic SpaceReplicationManager getReplicationManager()
SpacegetReplicationManager in interface Spacepublic void addInstance(SpaceInstance spaceInstance)
addInstance in interface InternalSpacepublic InternalSpaceInstance removeInstance(String uid)
removeInstance in interface InternalSpacepublic void refreshScheduledSpaceMonitors()
refreshScheduledSpaceMonitors in interface InternalSpacepublic int getSize()
Spacepublic boolean isEmpty()
Spacetrue if there are currently no space instances discovered.public IJSpace getIJSpace()
public void resetSpace()
InternalSpaceresetSpace in interface InternalSpacepublic GigaSpace getGigaSpace()
SpacegetGigaSpace in interface Spacepublic boolean waitFor(int numberOfSpaceInstances)
Spacepublic boolean waitFor(int numberOfSpaceInstances,
long timeout,
TimeUnit timeUnit)
Spacepublic boolean waitFor(int numberOfSpaceInstances,
SpaceMode spaceMode)
Spacepublic boolean waitFor(int numberOfSpaceInstances,
SpaceMode spaceMode,
long timeout,
TimeUnit timeUnit)
Spacepublic SpaceInstance[] getSpaceInstances()
getSpaceInstances in interface InternalSpaceInstancesAwarepublic SpaceInstanceAddedEventManager getSpaceInstanceAdded()
SpaceSpaceInstanceAddedEventListener
to be notified when space instances are added.getSpaceInstanceAdded in interface Spacepublic SpaceInstanceRemovedEventManager getSpaceInstanceRemoved()
SpaceSpaceInstanceRemovedEventListener
to be notified when space instances are removed.getSpaceInstanceRemoved in interface Spacepublic void addLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
SpaceSpaceInstanceLifecycleEventListener.addLifecycleListener in interface Spacepublic void removeLifecycleListener(SpaceInstanceLifecycleEventListener eventListener)
SpaceSpaceInstanceLifecycleEventListener.removeLifecycleListener in interface Spacepublic Admin getAdmin()
getAdmin in interface InternalSpacepublic SpaceInstance getSpaceInstanceByUid(String uid)
InternalSpaceGridComponent.getUid())getSpaceInstanceByUid in interface InternalSpaceuid - the unique id of the Space instancepublic ClusterPolicy getClusterPolicy()
InternalSpacegetClusterPolicy in interface InternalSpaceCopyright © GigaSpaces.