com.thinkaurelius.titan.graphdb.database.idassigner.placement

## Class PartitionIDRange

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.database.idassigner.placement.PartitionIDRange

-     public class PartitionIDRange
      extends Object

  An instance of this class describes a range of partition ids. This range if defined by a lower id (inclusive) and upper id (exclusive). When lowerId < upperId this partition range is called a proper range since it describes the contiguous block of ids from lowerId until upperId. When lowerId >= upperID then the partition block "wraps around" the specified idUpperBound. In other words, it describes the ids from [lowerId,idUpperBound) AND [0,upperId). It is always true that lowerID and upperID are smaller or equal than idUpperBound.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PartitionIDRange(int lowerID, int upperID, int idUpperBound)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(int partitionId)` Returns true of the given partitionId lies within this partition id range, else false.
    `int[]` | `getAllContainedIDs()`
    `static List<PartitionIDRange>` | `getGlobalRange(int partitionBits)`
    `static List<PartitionIDRange>` | `getIDRanges(int partitionBits, List<KeyRange> locals)`
    `int` | `getIdUpperBound()`
    `int` | `getLowerID()`
    `int` | `getRandomID()` Returns a random partition id that lies within this partition id range.
    `int` | `getUpperID()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PartitionIDRange

          public PartitionIDRange(int lowerID,
                          int upperID,
                          int idUpperBound)

  - ### Method Detail

    - #### getLowerID

          public int getLowerID()

    - #### getUpperID

          public int getUpperID()

    - #### getIdUpperBound

          public int getIdUpperBound()

    - #### getAllContainedIDs

          public int[] getAllContainedIDs()

    - #### contains

          public boolean contains(int partitionId)

      Returns true of the given partitionId lies within this partition id range, else false.
      Parameters:
        `partitionId` -
      Returns:

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getRandomID

          public int getRandomID()

      Returns a random partition id that lies within this partition id range.
      Returns:

    - #### getGlobalRange

          public static List<PartitionIDRange> getGlobalRange(int partitionBits)

    - #### getIDRanges

          public static List<PartitionIDRange> getIDRanges(int partitionBits,
                                           List<KeyRange> locals)

Copyright © 2012–2014. All rights reserved.