Class DefaultSpaceInstance
java.lang.Object
org.openspaces.admin.internal.support.AbstractGridComponent
org.openspaces.admin.internal.space.DefaultSpaceInstance
- All Implemented Interfaces:
AdminAware,DiscoverableComponent,GridComponent,InternalMachineAware,InternalOperatingSystemAware,InternalOperatingSystemInfoProvider,InternalSpaceInstance,InternalDiscoverableComponent,InternalGridComponent,InternalTransportAware,InternalTransportInfoProvider,InternalVirtualMachineAware,InternalVirtualMachineInfoProvider,InternalZoneAware,MachineAware,OperatingSystemAware,SpaceInstance,StatisticsMonitor,TransportAware,VirtualMachineAware,ZoneAware
public class DefaultSpaceInstance
extends AbstractGridComponent
implements InternalSpaceInstance, StatisticsMonitor
- Author:
- kimchy
-
Field Summary
Fields inherited from class org.openspaces.admin.internal.support.AbstractGridComponent
adminFields inherited from interface org.openspaces.admin.StatisticsMonitor
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSpaceInstance(ServiceID serviceID, IJSpace directSpace, IInternalRemoteJSpaceAdmin spaceAdmin, InternalAdmin admin, JVMDetails jvmDetails) DefaultSpaceInstance(PUServiceBean puService, SpaceServiceDetails spaceServiceDetails, InternalAdmin admin, JVMDetails jvmDetails) -
Method Summary
Modifier and TypeMethodDescriptionFuture<?>Demote a primary space instance to backupFuture<?>demote(long maxSuspendTime, TimeUnit timeUnit, CredentialsProvider credentialsProvider) Demote a primary space instance to backup with provided security credentialsvoidvoidintReturns the backup id (if it is a topology with backups) of the space instance.Returns the space cluster information.longReturns the direct proxy to the actual space instance.getId()Returns the Space instance IdentifierintReturns the instance id of the space (starting from 1).getMode()Returns the space mode, indicating if the space is primary or backup.intintReturns the partition this instance is part of.Allows to register forReplicationStatusChangedEvents.Returns the replication targets this space instance is replicating to.Returns the space runtime information.getSpace()Returns the space this instance is part of.Get this Space instance String representation.
If the Space is part of a highly-available partition (i.e.Returns information about the space class loadersAllows to register forSpaceModeChangedEvents.Allows to register forSpaceSuspendTypeChangedEvents.Returns the space instance statistics.Allows to register forSpaceInstanceStatisticsChangedEvents.getUid()Returns the unique id of the grid component.booleanReturnstrueif statistics are now being monitored.booleanvoidrunGc()protected voidsetIJSpace(ISpaceProxy spaceProxy) voidvoidsetPartition(SpacePartition spacePartition) voidsetReplicationTargets(ReplicationTarget[] replicationTargets) voidvoidsetStatisticsHistorySize(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.voidsetSuspendInfo(SuspendInfo suspendInfo) voidStarts the statistics monitor, starting a scheduled monitor that polls for statistics.voidStops the statistics monitor.toString()booleanwaitForMode(SpaceMode requiredMode, long timeout, TimeUnit timeUnit) Waits for the space instance to move to the provided space mode.Methods inherited from class org.openspaces.admin.internal.support.AbstractGridComponent
addZone, assertStateChangesPermitted, getAdmin, getJVMDetails, getMachine, getOperatingSystem, getTransport, getVirtualMachine, getZones, isDiscovered, setDiscovered, setMachine, setOperatingSystem, setTransport, setVirtualMachineMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openspaces.admin.AdminAware
getAdminMethods inherited from interface org.openspaces.admin.DiscoverableComponent
isDiscoveredMethods inherited from interface org.openspaces.admin.internal.support.InternalDiscoverableComponent
setDiscoveredMethods inherited from interface org.openspaces.admin.internal.machine.InternalMachineAware
setMachineMethods inherited from interface org.openspaces.admin.internal.os.InternalOperatingSystemAware
setOperatingSystemMethods inherited from interface org.openspaces.admin.internal.transport.InternalTransportAware
setTransportMethods inherited from interface org.openspaces.admin.internal.vm.InternalVirtualMachineAware
setVirtualMachineMethods inherited from interface org.openspaces.admin.internal.vm.InternalVirtualMachineInfoProvider
getJVMDetailsMethods inherited from interface org.openspaces.admin.internal.zone.InternalZoneAware
addZoneMethods inherited from interface org.openspaces.admin.machine.MachineAware
getMachineMethods inherited from interface org.openspaces.admin.os.OperatingSystemAware
getOperatingSystemMethods inherited from interface org.openspaces.admin.transport.TransportAware
getTransportMethods inherited from interface org.openspaces.admin.vm.VirtualMachineAware
getVirtualMachine
-
Constructor Details
-
DefaultSpaceInstance
public DefaultSpaceInstance(ServiceID serviceID, IJSpace directSpace, IInternalRemoteJSpaceAdmin spaceAdmin, InternalAdmin admin, JVMDetails jvmDetails) -
DefaultSpaceInstance
public DefaultSpaceInstance(PUServiceBean puService, SpaceServiceDetails spaceServiceDetails, InternalAdmin admin, JVMDetails jvmDetails)
-
-
Method Details
-
getId
Description copied from interface:SpaceInstanceReturns the Space instance Identifier- Specified by:
getIdin interfaceSpaceInstance
-
getUid
Description copied from interface:GridComponentReturns the unique id of the grid component.- Specified by:
getUidin interfaceGridComponent- Specified by:
getUidin interfaceInternalVirtualMachineInfoProvider
-
getServiceID
- Specified by:
getServiceIDin interfaceInternalSpaceInstance
-
getGigaSpace
Description copied from interface:SpaceInstanceReturns the direct proxy to the actual space instance.- Specified by:
getGigaSpacein interfaceSpaceInstance
-
getClusterInfo
Description copied from interface:SpaceInstanceReturns the space cluster information.- Specified by:
getClusterInfoin interfaceSpaceInstance
-
getClusterSchema
- Specified by:
getClusterSchemain interfaceInternalSpaceInstance
-
getNumberOfInstances
public int getNumberOfInstances()- Specified by:
getNumberOfInstancesin interfaceInternalSpaceInstance
-
getNumberOfBackups
public int getNumberOfBackups()- Specified by:
getNumberOfBackupsin interfaceInternalSpaceInstance
-
getSpaceUrl
- Specified by:
getSpaceUrlin interfaceSpaceInstance
-
getSpaceName
- Specified by:
getSpaceNamein interfaceInternalSpaceInstance
-
getSpaceModeChanged
Description copied from interface:SpaceInstanceAllows to register forSpaceModeChangedEvents.- Specified by:
getSpaceModeChangedin interfaceSpaceInstance
-
getSpaceSuspendTypeChanged
Description copied from interface:SpaceInstanceAllows to register forSpaceSuspendTypeChangedEvents.- Specified by:
getSpaceSuspendTypeChangedin interfaceSpaceInstance
-
getReplicationStatusChanged
Description copied from interface:SpaceInstanceAllows to register forReplicationStatusChangedEvents.- Specified by:
getReplicationStatusChangedin interfaceSpaceInstance
-
getStatisticsChanged
Description copied from interface:SpaceInstanceAllows to register forSpaceInstanceStatisticsChangedEvents.Note, monitoring must be started using
StatisticsMonitor.startStatisticsMonitor()for events to occur.- Specified by:
getStatisticsChangedin interfaceSpaceInstance
-
getSpaceInstanceName
Description copied from interface:SpaceInstanceGet this Space instance String representation.
If the Space is part of a highly-available partition (i.e. with backups), returns: {Space name}.{instance/partition id} [backup id] - for example, MySpace.3 [1]
Otherwise, when there are no backups (i.e. only partitioned), returns: {Space name} [instance/partition id] - for example, MySpace [3]- Specified by:
getSpaceInstanceNamein interfaceSpaceInstance- Returns:
- this Space instance String representation.
-
getInstanceId
public int getInstanceId()Description copied from interface:SpaceInstanceReturns the instance id of the space (starting from 1).- Specified by:
getInstanceIdin interfaceSpaceInstance
-
getBackupId
public int getBackupId()Description copied from interface:SpaceInstanceReturns the backup id (if it is a topology with backups) of the space instance.- Specified by:
getBackupIdin interfaceSpaceInstance
-
getIJSpace
- Specified by:
getIJSpacein interfaceInternalSpaceInstance
-
setIJSpace
-
getSpaceAdmin
- Specified by:
getSpaceAdminin interfaceInternalSpaceInstance
-
getRuntimeHolder
- Specified by:
getRuntimeHolderin interfaceInternalSpaceInstance- Throws:
RemoteException
-
setMode
- Specified by:
setModein interfaceInternalSpaceInstance
-
getMode
Description copied from interface:SpaceInstanceReturns the space mode, indicating if the space is primary or backup.- Specified by:
getModein interfaceSpaceInstance
-
waitForMode
Description copied from interface:SpaceInstanceWaits for the space instance to move to the provided space mode. Returnstrueif the mode was changed to the required one withing the timeout, orfalseotherwise.- Specified by:
waitForModein interfaceSpaceInstance
-
getStatistics
Description copied from interface:SpaceInstanceReturns the space instance statistics.- Specified by:
getStatisticsin interfaceSpaceInstance
-
getLastStatistics
- Specified by:
getLastStatisticsin interfaceInternalSpaceInstance
-
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
-
getRuntimeDetails
Description copied from interface:SpaceInstanceReturns the space runtime information.- Specified by:
getRuntimeDetailsin interfaceSpaceInstance
-
getSpaceInstanceRemoteClassLoaderInfo
Description copied from interface:SpaceInstanceReturns information about the space class loaders- Specified by:
getSpaceInstanceRemoteClassLoaderInfoin interfaceSpaceInstance
-
getReplicationTargets
Description copied from interface:SpaceInstanceReturns the replication targets this space instance is replicating to.- Specified by:
getReplicationTargetsin interfaceSpaceInstance
-
setReplicationTargets
- Specified by:
setReplicationTargetsin interfaceInternalSpaceInstance
-
getSpace
Description copied from interface:SpaceInstanceReturns the space this instance is part of.- Specified by:
getSpacein interfaceSpaceInstance
-
setSpace
- Specified by:
setSpacein interfaceInternalSpaceInstance
-
setPartition
- Specified by:
setPartitionin interfaceInternalSpaceInstance
-
getPartition
Description copied from interface:SpaceInstanceReturns the partition this instance is part of.- Specified by:
getPartitionin interfaceSpaceInstance
-
getNIODetails
- Specified by:
getNIODetailsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
getNIOStatistics
- Specified by:
getNIOStatisticsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
enableLRMIMonitoring
- Specified by:
enableLRMIMonitoringin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
disableLRMIMonitoring
- Specified by:
disableLRMIMonitoringin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
fetchLRMIMonitoringDetails
- Specified by:
fetchLRMIMonitoringDetailsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
getCurrentTimeInMillis
- Specified by:
getCurrentTimeInMillisin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getOSDetails
- Specified by:
getOSDetailsin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getOSStatistics
- Specified by:
getOSStatisticsin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getJVMStatistics
- Specified by:
getJVMStatisticsin interfaceInternalVirtualMachineInfoProvider- Throws:
RemoteException
-
runGc
- Specified by:
runGcin interfaceInternalVirtualMachineInfoProvider- Throws:
RemoteException
-
toString
-
getStatisticsHolder
- Specified by:
getStatisticsHolderin interfaceInternalSpaceInstance- Throws:
RemoteException
-
getPlatformLogicalVersion
- Specified by:
getPlatformLogicalVersionin interfaceInternalSpaceInstance
-
getSpaceConfig
- Specified by:
getSpaceConfigin interfaceInternalSpaceInstance
-
demote
Description copied from interface:SpaceInstanceDemote a primary space instance to backup- Specified by:
demotein interfaceSpaceInstance
-
demote
public Future<?> demote(long maxSuspendTime, TimeUnit timeUnit, CredentialsProvider credentialsProvider) Description copied from interface:InternalSpaceInstanceDemote a primary space instance to backup with provided security credentials- Specified by:
demotein interfaceInternalSpaceInstance- See Also:
-
isSecured
public boolean isSecured()- Specified by:
isSecuredin interfaceSpaceInstance
-
setSuspendInfo
- Specified by:
setSuspendInfoin interfaceInternalSpaceInstance
-
getSuspendInfo
- Specified by:
getSuspendInfoin interfaceSpaceInstance
-