Class

io.keen.client.scala

RamEventStore

Related Doc: package scala

Permalink

class RamEventStore extends EventStore

RamEventStore implements the EventStore interface with an in-memory backing cache that is concurrency-safe.

It is the default EventStore implementation supporting batched write flushing functionality of BatchWriterClient.

Source
RamEventStore.scala
To do

We're really getting nothing out of TrieMap's lock-free nature, every operation is wrapped in (coarse) synchronized blocks for sake of ListBuffer safety. The Java implementation doesn't use concurrent data structures at all, presumably for that reason. Use a simpler Map type, or even better, find ways to safely slim down the synchronized blocks.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RamEventStore
  2. EventStore
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RamEventStore()

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clear(): Unit

    Permalink

    Resets the store to an empty state, discarding all data.

    Resets the store to an empty state, discarding all data.

    To do

    Technically ought to reset attempts too, but I hope that is gone for now anyway… https://github.com/keenlabs/KeenClient-Scala/pull/46

    ,

    This is currently unused. Any use case beyond possibly tests? Axe it?

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def get(handle: Long): String

    Permalink

    Retrieves an event from the store.

    Retrieves an event from the store.

    handle

    The cache key of the event to retrieve.

    returns

    The event string.

    Definition Classes
    RamEventStoreEventStore
    To do

    Non-Option instance apply() version could be added for idiomatic Scala.

    ,

    Should return an Option[String] in Scala land.

  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getHandles(projectId: String): TrieMap[String, ListBuffer[Long]]

    Permalink

    Retrieves all handles for a specific project from the store.

    Retrieves all handles for a specific project from the store.

    projectId

    The ID of the project.

    returns

    A map of collection names to their event handles.

    Definition Classes
    RamEventStoreEventStore
  13. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  15. var maxEventsPerCollection: Integer

    Permalink

    Sets a maximum number of events that should be stored per-collection.

    Sets a maximum number of events that should be stored per-collection. Eviction strategy may vary by implementation.

    Definition Classes
    EventStore
    To do

    This could be moved to RamEventStore instead of being a formal part of the interface.

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

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def remove(handle: Long): Unit

    Permalink

    Removes an event from the store.

    Removes an event from the store.

    handle

    The handle of the event.

    Definition Classes
    RamEventStoreEventStore
  20. var size: Integer

    Permalink

    The number of events currently in the store.

    The number of events currently in the store.

    Definition Classes
    EventStore
    To do

    Long? The implementation in RamEventStore uses Longs for key/handle/ID, so…

    ,

    This should be an accessor method with private field, not public var.

  21. def store(projectId: String, eventCollection: String, event: String): Long

    Permalink

    Stores an event in the store.

    Stores an event in the store.

    projectId

    The ID of the project to which the collection belongs.

    eventCollection

    The collection to which the event will be added.

    event

    The event.

    returns

    A handle which can be used to retrieve or remove the event from the store (a cache key).

    Definition Classes
    RamEventStoreEventStore
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from EventStore

Inherited from AnyRef

Inherited from Any

Ungrouped