Interface SpacePartition

All Superinterfaces:
Iterable<SpaceInstance>
All Known Subinterfaces:
InternalSpacePartition
All Known Implementing Classes:
DefaultSpacePartition

public interface SpacePartition extends Iterable<SpaceInstance>
A Space partition mainly make sense with partitioned topologies and holds all the SpaceInstances that form the partition.
Author:
kimchy
  • Method Details

    • getPartitionId

      int getPartitionId()
      Returns the partition id (starting from 0). Note, SpaceInstance.getInstanceId() starts from 1.
    • getInstances

      SpaceInstance[] getInstances()
      Returns all the space instances that form the partition.
    • getSpace

      Space getSpace()
      Returns the Space this Space Partition is part of.
    • getPrimary

      SpaceInstance getPrimary()
      Returns the primary space instance, null if currently there is no primary.
    • getBackup

      SpaceInstance getBackup()
      Returns the (first) backup space instance, null if currently there is no backup.
    • waitFor

      boolean waitFor(SpaceMode spaceMode)
      Waits (default timeout) till one of the Space partition instances has the provided space mode.
      Parameters:
      spaceMode - the requested space mode (PRIMARY / BACKUP)
      Returns:
      returns true if a space instance was found in the default timeout, false otherwise.
      Since:
      14.5
    • waitFor

      boolean waitFor(SpaceMode spaceMode, long timeout, TimeUnit timeUnit)
      Waits (given timeout) till one of the Space partition instances has the provided space mode.
      Parameters:
      spaceMode - the requested space mode (PRIMARY / BACKUP)
      timeout - the time to wait based on the time unit
      timeUnit - the time unit to use for the timeout parameter
      Returns:
      returns true if a space instance was found in the specified timeout, false otherwise.
      Since:
      14.5
    • getSpaceModeChanged

      SpaceModeChangedEventManager getSpaceModeChanged()
      Returns an event manager allowing to globally register for SpaceModeChangedEventListeners that happen on any Space partition currently discovered.