Class DefaultSpacePartition
java.lang.Object
org.openspaces.admin.internal.space.DefaultSpacePartition
- All Implemented Interfaces:
Iterable<SpaceInstance>,InternalSpacePartition,SpacePartition
- Author:
- kimchy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpaceInstance(SpaceInstance spaceInstance) Returns the (first) backup space instance,nullif currently there is no backup.Returns all the space instances that form the partition.intReturns the partition id (starting from 0).Returns the primary space instance,nullif currently there is no primary.getSpace()Returns the Space this Space Partition is part of.Returns an event manager allowing to globally register forSpaceModeChangedEventListeners that happen on any Space partition currently discovered.iterator()voidbooleanWaits (default timeout) till one of the Space partition instances has the provided space mode.booleanWaits (given timeout) till one of the Space partition instances has the provided space mode.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
-
DefaultSpacePartition
-
-
Method Details
-
getSpace
Description copied from interface:SpacePartitionReturns the Space this Space Partition is part of.- Specified by:
getSpacein interfaceSpacePartition
-
getPrimary
Description copied from interface:SpacePartitionReturns the primary space instance,nullif currently there is no primary.- Specified by:
getPrimaryin interfaceSpacePartition
-
getBackup
Description copied from interface:SpacePartitionReturns the (first) backup space instance,nullif currently there is no backup.- Specified by:
getBackupin interfaceSpacePartition
-
waitFor
Description copied from interface:SpacePartitionWaits (default timeout) till one of the Space partition instances has the provided space mode.- Specified by:
waitForin interfaceSpacePartition- Parameters:
spaceMode- the requested space mode (PRIMARY / BACKUP)- Returns:
- returns
trueif a space instance was found in the default timeout,falseotherwise.
-
waitFor
Description copied from interface:SpacePartitionWaits (given timeout) till one of the Space partition instances has the provided space mode.- Specified by:
waitForin interfaceSpacePartition- Parameters:
spaceMode- the requested space mode (PRIMARY / BACKUP)timeout- the time to wait based on the time unittimeUnit- the time unit to use for the timeout parameter- Returns:
- returns
trueif a space instance was found in the specified timeout,falseotherwise.
-
iterator
- Specified by:
iteratorin interfaceIterable<SpaceInstance>
-
getInstances
Description copied from interface:SpacePartitionReturns all the space instances that form the partition.- Specified by:
getInstancesin interfaceSpacePartition
-
getPartitionId
public int getPartitionId()Description copied from interface:SpacePartitionReturns the partition id (starting from 0). Note,SpaceInstance.getInstanceId()starts from 1.- Specified by:
getPartitionIdin interfaceSpacePartition
-
addSpaceInstance
- Specified by:
addSpaceInstancein interfaceInternalSpacePartition
-
removeSpaceInstance
- Specified by:
removeSpaceInstancein interfaceInternalSpacePartition
-
getSpaceModeChanged
Description copied from interface:SpacePartitionReturns an event manager allowing to globally register forSpaceModeChangedEventListeners that happen on any Space partition currently discovered.- Specified by:
getSpaceModeChangedin interfaceSpacePartition
-