Package com.linkedin.davinci.stats
Class AbstractVeniceAggVersionedStats<STATS,STATS_REPORTER extends AbstractVeniceStatsReporter<STATS>>
java.lang.Object
com.linkedin.davinci.stats.AbstractVeniceAggVersionedStats<STATS,STATS_REPORTER>
- All Implemented Interfaces:
StoreDataChangedListener
- Direct Known Subclasses:
AggVersionedBlobTransferStats
,AggVersionedDIVStats
,AggVersionedIngestionStats
,AggVersionedStorageEngineStats
,HeartbeatVersionedStats
public abstract class AbstractVeniceAggVersionedStats<STATS,STATS_REPORTER extends AbstractVeniceStatsReporter<STATS>>
extends Object
implements StoreDataChangedListener
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractVeniceAggVersionedStats
(io.tehuti.metrics.MetricsRepository metricsRepository, ReadOnlyStoreRepository metadataRepository, Supplier<STATS> statsInitiator, StatsSupplier<STATS_REPORTER> reporterSupplier, boolean unregisterMetricForDeletedStoreEnabled) -
Method Summary
Modifier and TypeMethodDescriptionprotected VeniceVersionedStats<STATS,
STATS_REPORTER> protected int
getCurrentVersion
(String storeName) returnStore.NON_EXISTING_VERSION
if current version doesn't exist.protected int
getFutureVersion
(String storeName) returnStore.NON_EXISTING_VERSION
if future version doesn't exist.protected STATS
protected STATS
getTotalStats
(String storeName) void
handleStoreChanged
(Store store) void
handleStoreCreated
(Store store) Do NOT try to acquire the lock of store repository again in the implementation, otherwise a dead lock issue will happen.void
handleStoreDeleted
(String storeName) boolean
isFutureVersion
(String storeName, int version) void
protected void
recordVersionedAndTotalStat
(String storeName, int version, Consumer<STATS> function) protected void
registerConditionalStats
(String storeName) protected void
updateStatsVersionInfo
(String storeName, List<Version> existingVersions, int newCurrentVersion) protected void
updateTotalStats
(String storeName) Some versioned stats might always increasing; in this case, the value in the total stats should be updated with the aggregated values across the new version list.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linkedin.venice.meta.StoreDataChangedListener
handleStoreDeleted
-
Field Details
-
metadataRepository
-
-
Constructor Details
-
AbstractVeniceAggVersionedStats
public AbstractVeniceAggVersionedStats(io.tehuti.metrics.MetricsRepository metricsRepository, ReadOnlyStoreRepository metadataRepository, Supplier<STATS> statsInitiator, StatsSupplier<STATS_REPORTER> reporterSupplier, boolean unregisterMetricForDeletedStoreEnabled)
-
-
Method Details
-
loadAllStats
public void loadAllStats() -
recordVersionedAndTotalStat
-
getTotalStats
-
getStats
-
registerConditionalStats
-
addStore
-
updateStatsVersionInfo
-
handleStoreCreated
Description copied from interface:StoreDataChangedListener
Do NOT try to acquire the lock of store repository again in the implementation, otherwise a dead lock issue will happen.- Specified by:
handleStoreCreated
in interfaceStoreDataChangedListener
-
handleStoreDeleted
- Specified by:
handleStoreDeleted
in interfaceStoreDataChangedListener
-
handleStoreChanged
- Specified by:
handleStoreChanged
in interfaceStoreDataChangedListener
-
isFutureVersion
-
getFutureVersion
returnStore.NON_EXISTING_VERSION
if future version doesn't exist. -
getCurrentVersion
returnStore.NON_EXISTING_VERSION
if current version doesn't exist. -
updateTotalStats
Some versioned stats might always increasing; in this case, the value in the total stats should be updated with the aggregated values across the new version list.
-