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.LonggetLastEventId()Returns the greatest event ID that can be used to fetch events viaDiagnosticEventStore.scan(Comparable, int).voidload()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.voidstore(DiagnosticEvent event)Stores provided event and returns the new associated store key for it.
-
-
-
Method Detail
-
load
public void load()
Description copied from interface:DiagnosticEventStoreInitializes the store.- Specified by:
loadin interfaceDiagnosticEventStore<java.lang.Long>
-
store
public void store(DiagnosticEvent event)
Description copied from interface:DiagnosticEventStoreStores provided event and returns the new associated store key for it.- Specified by:
storein interfaceDiagnosticEventStore<java.lang.Long>
-
scan
public java.util.NavigableMap<java.lang.Long,DiagnosticEvent> scan(java.lang.Long id, int limit)
Description copied from interface:DiagnosticEventStoreReturns 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:
scanin interfaceDiagnosticEventStore<java.lang.Long>
-
getLastEventId
public java.lang.Long getLastEventId()
Description copied from interface:DiagnosticEventStoreReturns the greatest event ID that can be used to fetch events viaDiagnosticEventStore.scan(Comparable, int).- Specified by:
getLastEventIdin interfaceDiagnosticEventStore<java.lang.Long>
-
-