Interface StoreTimer.Aggregate
-
- All Superinterfaces:
StoreTimer.Event
- All Known Implementing Classes:
FDBStoreTimer.CountAggregates
- Enclosing class:
- StoreTimer
public static interface StoreTimer.Aggregate extends StoreTimer.Event
An aggregate event is an event whose value is computed over the value of another set of events.
-
-
Field Summary
-
Fields inherited from interface com.apple.foundationdb.record.provider.common.StoreTimer.Event
LOG_KEY_SUFFIX_CACHE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description StoreTimer.Counter
compute(StoreTimer storeTimer)
Compute the value for this aggregate.default StoreTimer.Counter
compute(StoreTimer storeTimer, StoreTimer.Event... events)
Deprecated.usecompute(StoreTimer, Set)
insteaddefault StoreTimer.Counter
compute(StoreTimer storeTimer, Set<? extends StoreTimer.Event> events)
Compute the value for this aggregate.Set<? extends StoreTimer.Event>
getComponentEvents()
Returns the set of events that make up the aggregate.default <T extends StoreTimer.Event>
T[]validate(BiConsumer<T,T> extraCheck, T... events)
Helper for implementations to validate that all of the events in the aggregate conform to some basic expectations.default <T extends StoreTimer.Event>
T[]validate(T... events)
Helper for implementations to validate that all of the events in the aggregate conform to some basic expectations.-
Methods inherited from interface com.apple.foundationdb.record.provider.common.StoreTimer.Event
logKey, logKeyWithSuffix, name, title
-
-
-
-
Method Detail
-
getComponentEvents
Set<? extends StoreTimer.Event> getComponentEvents()
Returns the set of events that make up the aggregate. Note that theoretically an aggregate could be defined in a manner such that some events contributed to the aggregate in different fashions (for example,eventA + eventB - eventC
), in which case this method would return the fact that the three events comprise the aggregate but with no indication of in which manner they contribute to its value.- Returns:
- the events that comprise the aggregate
-
validate
default <T extends StoreTimer.Event> T[] validate(@Nonnull T... events)
Helper for implementations to validate that all of the events in the aggregate conform to some basic expectations.- Type Parameters:
T
- the type of event- Parameters:
events
- the events too validate- Returns:
- the validated events
- Throws:
RecordCoreArgumentException
- if the validation assumptions are violated
-
validate
default <T extends StoreTimer.Event> T[] validate(@Nonnull BiConsumer<T,T> extraCheck, @Nonnull T... events)
Helper for implementations to validate that all of the events in the aggregate conform to some basic expectations.- Type Parameters:
T
- the type of event- Parameters:
extraCheck
- a validation that takes the first event in the set of events and another event in the set of events and ensures that they are sufficiently compatible to aggregateeevents
- the events too validate- Returns:
- the validated events
- Throws:
RecordCoreArgumentException
- if the validation assumptions are violated
-
compute
@Nullable StoreTimer.Counter compute(@Nonnull StoreTimer storeTimer)
Compute the value for this aggregate.- Parameters:
storeTimer
- the time from which to draw the values that are necessary to compute this aggregate- Returns:
- the computed result or null if none of the value that comprise this aggregate were available
-
compute
@Nullable @Deprecated @API(DEPRECATED) default StoreTimer.Counter compute(@Nonnull StoreTimer storeTimer, @Nonnull StoreTimer.Event... events)
Deprecated.usecompute(StoreTimer, Set)
insteadCompute the value for this aggregate.- Parameters:
storeTimer
- the time from which to draw the values that are necessary to compute this aggregateevents
- the events that are to be aggregated into the resultingCounteer
- Returns:
- the computed result or null if none of the value that comprise this aggregate were available
-
compute
@Nullable default StoreTimer.Counter compute(@Nonnull StoreTimer storeTimer, @Nonnull Set<? extends StoreTimer.Event> events)
Compute the value for this aggregate.- Parameters:
storeTimer
- the time from which to draw the values that are necessary to compute this aggregateevents
- the events that are to be aggregated into the resultingCounteer
- Returns:
- the computed result or null if none of the value that comprise this aggregate were available
-
-