io.keen.client.scala

RamEventStore

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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RamEventStore()

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 clear(): Unit

    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?

  8. def clone(): AnyRef

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

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

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

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

    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.

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

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

    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
  15. def hashCode(): Int

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

    Definition Classes
    Any
  17. var maxEventsPerCollection: Integer

    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.

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

    Definition Classes
    AnyRef
  19. final def notify(): Unit

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

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

    Removes an event from the store.

    Removes an event from the store.

    handle

    The handle of the event.

    Definition Classes
    RamEventStoreEventStore
  22. var size: Integer

    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.

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

    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
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  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 EventStore

Inherited from AnyRef

Inherited from Any

Ungrouped