Resets the store to an empty state, discarding all data.
Resets the store to an empty state, discarding all data.
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?
Retrieves an event from the store.
Retrieves an event from the store.
The cache key of the event to retrieve.
The event string.
Non-Option instance apply() version could be added for idiomatic Scala.
,Should return an Option[String] in Scala land.
Retrieves all handles for a specific project from the store.
Retrieves all handles for a specific project from the store.
The ID of the project.
A map of collection names to their event handles.
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.
This could be moved to RamEventStore instead of being a formal part of the interface.
Removes an event from the store.
Removes an event from the store.
The handle of the event.
The number of events currently in the store.
The number of events currently in the store.
Long? The implementation in RamEventStore uses Longs for key/handle/ID, so…
,This should be an accessor method with private field, not public var.
Stores an event in the store.
Stores an event in the store.
The ID of the project to which the collection belongs.
The collection to which the event will be added.
The event.
A handle which can be used to retrieve or remove the event from the store (a cache key).
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.We're really getting nothing out of
TrieMap
's lock-free nature, every operation is wrapped in (coarse)synchronized
blocks for sake ofListBuffer
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 thesynchronized
blocks.