GigaSpaces XAP 7.0 API

org.openspaces.admin.space
Interface SpaceInstance

All Superinterfaces:
AdminAware, DiscoverableComponent, GridComponent, MachineAware, OperatingSystemAware, StatisticsMonitor, TransportAware, VirtualMachineAware, ZoneAware

public interface SpaceInstance
extends GridComponent, StatisticsMonitor

A Space Instance is a single instance of a space running as a part of a Space. For example, when deploying a 2 partitions each with one backup topology, there will be 4 space instances running.

Author:
kimchy

Field Summary
 
Fields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL
 
Method Summary
 int getBackupId()
          Returns the backup id (if it is a topology with backups) of the space instance.
 GigaSpace getGigaSpace()
          Returns the direct proxy to the actual space instance.
 int getInstanceId()
          Returns the instance id of the space (starting from 1).
 com.gigaspaces.cluster.activeelection.SpaceMode getMode()
          Returns the space mode, indicating if the space is primary or backup.
 SpacePartition getPartition()
          Returns the partition this instance is part of.
 ReplicationStatusChangedEventManager getReplicationStatusChanged()
          Allows to register for ReplicationStatusChangedEvents.
 ReplicationTarget[] getReplicationTargets()
          Returns the replication targets this space instance is replicating to.
 Space getSpace()
          Returns the space this instance is part of.
 SpaceModeChangedEventManager getSpaceModeChanged()
          Allows to register for SpaceModeChangedEvents.
 SpaceInstanceStatistics getStatistics()
          Returns the space instance statistics.
 SpaceInstanceStatisticsChangedEventManager getStatisticsChanged()
          Allows to register for SpaceInstanceStatisticsChangedEvents.
 boolean waitForMode(com.gigaspaces.cluster.activeelection.SpaceMode requiredMode, long timeout, TimeUnit timeUnit)
          Waits for the space instance to move to the provided space mode.
 
Methods inherited from interface org.openspaces.admin.GridComponent
getUid
 
Methods inherited from interface org.openspaces.admin.DiscoverableComponent
isDiscovered
 
Methods inherited from interface org.openspaces.admin.AdminAware
getAdmin
 
Methods inherited from interface org.openspaces.admin.machine.MachineAware
getMachine
 
Methods inherited from interface org.openspaces.admin.transport.TransportAware
getTransport
 
Methods inherited from interface org.openspaces.admin.os.OperatingSystemAware
getOperatingSystem
 
Methods inherited from interface org.openspaces.admin.vm.VirtualMachineAware
getVirtualMachine
 
Methods inherited from interface org.openspaces.admin.zone.ZoneAware
getZones
 
Methods inherited from interface org.openspaces.admin.StatisticsMonitor
isMonitoring, setStatisticsHistorySize, setStatisticsInterval, startStatisticsMonitor, stopStatisticsMontior
 

Method Detail

getInstanceId

int getInstanceId()
Returns the instance id of the space (starting from 1).


getBackupId

int getBackupId()
Returns the backup id (if it is a topology with backups) of the space instance.


getMode

com.gigaspaces.cluster.activeelection.SpaceMode getMode()
Returns the space mode, indicating if the space is primary or backup.


waitForMode

boolean waitForMode(com.gigaspaces.cluster.activeelection.SpaceMode requiredMode,
                    long timeout,
                    TimeUnit timeUnit)
Waits for the space instance to move to the provided space mode. Returns true if the mode was changed to the required one withing the timeout, or false otherwise.


getGigaSpace

GigaSpace getGigaSpace()
Returns the direct proxy to the actual space instance.


getStatistics

SpaceInstanceStatistics getStatistics()
Returns the space instance statistics.


getSpace

Space getSpace()
Returns the space this instance is part of.


getPartition

SpacePartition getPartition()
Returns the partition this instance is part of.


getReplicationTargets

ReplicationTarget[] getReplicationTargets()
Returns the replication targets this space instance is replicating to.


getSpaceModeChanged

SpaceModeChangedEventManager getSpaceModeChanged()
Allows to register for SpaceModeChangedEvents.


getReplicationStatusChanged

ReplicationStatusChangedEventManager getReplicationStatusChanged()
Allows to register for ReplicationStatusChangedEvents.


getStatisticsChanged

SpaceInstanceStatisticsChangedEventManager getStatisticsChanged()
Allows to register for SpaceInstanceStatisticsChangedEvents.

Note, monitoring must be started using StatisticsMonitor.startStatisticsMonitor() for events to occur.


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.