gr.jkl.uid

Scheme

final case class Scheme(timestampBits: Long, nodeBits: Long, sequenceBits: Long, epoch: Long) extends Product with Serializable

Specification of an Id implementation.

An Id encodes its generation time and the node which created it. Ids also include an incremental number in order to differentiate Ids produced on the same time unit. The timestamp, node and the sequence data are packed into 64-bits and the Scheme specifies the number of bits of each parameter. Additionally, a Scheme specifies the beginning of time of the Id implementation, a.k.a. its epoch.

A Scheme is required by various parts of this library so it's suggested to define it implicitly.

timestampBits

The number of bits devoted to the Id timestamp.

nodeBits

The number of bits devoted to the Id node.

sequenceBits

The number of bits devoted to the Id sequence.

epoch

The beginning of time, in the Unix timeline, for this Scheme in milliseconds (milliseconds since Unix epoch).

Annotations
@throws( classOf[IllegalArgumentException] ) @SerialVersionUID( 0L )
Exceptions thrown
IllegalArgumentException

If timestamp, node and sequence bits aren't greater than 0, their sum isn't 64 or epoch is negative.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Scheme
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Scheme(timestampBits: Long, nodeBits: Long, sequenceBits: Long, epoch: Long)

    timestampBits

    The number of bits devoted to the Id timestamp.

    nodeBits

    The number of bits devoted to the Id node.

    sequenceBits

    The number of bits devoted to the Id sequence.

    epoch

    The beginning of time, in the Unix timeline, for this Scheme in milliseconds (milliseconds since Unix epoch).

    Exceptions thrown
    IllegalArgumentException

    If timestamp, node and sequence bits aren't greater than 0, their sum isn't 64 or epoch is negative.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. val epoch: Long

    The beginning of time, in the Unix timeline, for this Scheme in milliseconds (milliseconds since Unix epoch).

  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. def isValidNode(node: Long): Boolean

    Checks if a node is valid for this Scheme.

  14. def isValidSequence(sequence: Long): Boolean

    Checks if a sequence is valid for this Scheme.

  15. def isValidTimestamp(timestamp: Long): Boolean

    Checks if a timestamp is valid for this Scheme.

  16. val maxNode: Long

    The max node of this Id Scheme.

  17. val maxSequence: Long

    The max sequence of this Id Scheme.

  18. val maxTimestamp: Long

    The max timestamp, in the Unix timeline, of this Id Scheme.

  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. val nodeBits: Long

    The number of bits devoted to the Id node.

  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. val sequenceBits: Long

    The number of bits devoted to the Id sequence.

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. val timestampBits: Long

    The number of bits devoted to the Id timestamp.

  26. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  28. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped