Package org.apache.cassandra.diag.store
Class DiagnosticEventMemoryStore
- java.lang.Object
-
- org.apache.cassandra.diag.store.DiagnosticEventMemoryStore
-
- All Implemented Interfaces:
DiagnosticEventStore<java.lang.Long>
public final class DiagnosticEventMemoryStore extends java.lang.Object implements DiagnosticEventStore<java.lang.Long>
Simple on-heap memory store that allows to buffer and retrieve a fixed number of events.
-
-
Constructor Summary
Constructors Constructor Description DiagnosticEventMemoryStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Long
getLastEventId()
Returns the greatest event ID that can be used to fetch events viaDiagnosticEventStore.scan(Comparable, int)
.void
load()
Initializes the store.java.util.NavigableMap<java.lang.Long,DiagnosticEvent>
scan(java.lang.Long id, int limit)
Returns a view on all events with a key greater than the provided value (inclusive) up to the specified number of results.void
store(DiagnosticEvent event)
Stores provided event and returns the new associated store key for it.
-
-
-
Method Detail
-
load
public void load()
Description copied from interface:DiagnosticEventStore
Initializes the store.- Specified by:
load
in interfaceDiagnosticEventStore<java.lang.Long>
-
store
public void store(DiagnosticEvent event)
Description copied from interface:DiagnosticEventStore
Stores provided event and returns the new associated store key for it.- Specified by:
store
in interfaceDiagnosticEventStore<java.lang.Long>
-
scan
public java.util.NavigableMap<java.lang.Long,DiagnosticEvent> scan(java.lang.Long id, int limit)
Description copied from interface:DiagnosticEventStore
Returns a view on all events with a key greater than the provided value (inclusive) up to the specified number of results. Events may be added or become unavailable over time. Keys must be unique, sortable and monotonically incrementing. Returns an empty map in case no events could be found.- Specified by:
scan
in interfaceDiagnosticEventStore<java.lang.Long>
-
getLastEventId
public java.lang.Long getLastEventId()
Description copied from interface:DiagnosticEventStore
Returns the greatest event ID that can be used to fetch events viaDiagnosticEventStore.scan(Comparable, int)
.- Specified by:
getLastEventId
in interfaceDiagnosticEventStore<java.lang.Long>
-
-