Package

unicorn

oid

Permalink

package oid

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. oid
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. class BsonObjectId extends ObjectId

    Permalink

    BSON's 12-byte ObjectId type, constructed using: a 4-byte value representing the seconds since the Unix epoch, a 3-byte machine identifier, a 2-byte process id, and a 3-byte counter, starting with a random value.

    BSON's 12-byte ObjectId type, constructed using: a 4-byte value representing the seconds since the Unix epoch, a 3-byte machine identifier, a 2-byte process id, and a 3-byte counter, starting with a random value.

    The implementation is adopt from ReactiveMongo.

  2. trait LongIdGenerator extends AnyRef

    Permalink

    64-bit ID generator.

  3. class ObjectId extends Comparable[ObjectId]

    Permalink

    Abstract Object Id type.

  4. class Snowflake extends LongIdGenerator with Logging

    Permalink

    64 bit ID generator based on Twitter Snowflake.

    64 bit ID generator based on Twitter Snowflake. An id is composed of: time - 41 bits (millisecond precision with a custom epoch gives us 69 years) configured worker id - 10 bits - up to 1024 workers/threads/machines sequence number - 12 bits - rolls over every 4096 per worker (with protection to avoid rollover in the same ms)

    You should use NTP to keep your system clock accurate. Snowflake protects from non-monotonic clocks, i.e. clocks that run backwards. If your clock is running fast and NTP tells it to repeat a few milliseconds, snowflake will refuse to generate ids until a time that is after the last time we generated an id. Even better, run in a mode where NTP won't move the clock backwards.

Value Members

  1. object BsonObjectId

    Permalink
  2. object ObjectId

    Permalink
  3. object Snowflake extends Logging

    Permalink
  4. implicit def bytes2ObjectId(x: Array[Byte]): ObjectId

    Permalink
  5. implicit def date2ObjectId(x: Date): ObjectId

    Permalink
  6. implicit def int2ObjectId(x: Int): ObjectId

    Permalink
  7. implicit def long2ObjectId(x: Long): ObjectId

    Permalink
  8. implicit def string2ObjectId(x: String): ObjectId

    Permalink
  9. implicit def uuid2ObjectId(x: UUID): ObjectId

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped