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:
AggVersionedDIVStats,AggVersionedIngestionStats,AggVersionedStorageEngineStats,HeartbeatVersionedStats
public abstract class AbstractVeniceAggVersionedStats<STATS,STATS_REPORTER extends AbstractVeniceStatsReporter<STATS>> extends java.lang.Object implements StoreDataChangedListener
-
-
Field Summary
Fields Modifier and Type Field Description protected ReadOnlyStoreRepositorymetadataRepository
-
Constructor Summary
Constructors Constructor Description AbstractVeniceAggVersionedStats(io.tehuti.metrics.MetricsRepository metricsRepository, ReadOnlyStoreRepository metadataRepository, java.util.function.Supplier<STATS> statsInitiator, StatsSupplier<STATS_REPORTER> reporterSupplier, boolean unregisterMetricForDeletedStoreEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected VeniceVersionedStats<STATS,STATS_REPORTER>addStore(java.lang.String storeName)protected intgetCurrentVersion(java.lang.String storeName)returnStore.NON_EXISTING_VERSIONif current version doesn't exist.protected intgetFutureVersion(java.lang.String storeName)returnStore.NON_EXISTING_VERSIONif future version doesn't exist.protected STATSgetStats(java.lang.String storeName, int version)protected STATSgetTotalStats(java.lang.String storeName)voidhandleStoreChanged(Store store)voidhandleStoreCreated(Store store)Do NOT try to acquire the lock of store repository again in the implementation, otherwise a dead lock issue will happen.voidhandleStoreDeleted(java.lang.String storeName)booleanisFutureVersion(java.lang.String storeName, int version)voidloadAllStats()protected voidrecordVersionedAndTotalStat(java.lang.String storeName, int version, java.util.function.Consumer<STATS> function)protected voidregisterConditionalStats(java.lang.String storeName)protected voidupdateStatsVersionInfo(java.lang.String storeName, java.util.List<Version> existingVersions, int newCurrentVersion)protected voidupdateTotalStats(java.lang.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 Detail
-
metadataRepository
protected final ReadOnlyStoreRepository metadataRepository
-
-
Constructor Detail
-
AbstractVeniceAggVersionedStats
public AbstractVeniceAggVersionedStats(io.tehuti.metrics.MetricsRepository metricsRepository, ReadOnlyStoreRepository metadataRepository, java.util.function.Supplier<STATS> statsInitiator, StatsSupplier<STATS_REPORTER> reporterSupplier, boolean unregisterMetricForDeletedStoreEnabled)
-
-
Method Detail
-
loadAllStats
public void loadAllStats()
-
recordVersionedAndTotalStat
protected void recordVersionedAndTotalStat(java.lang.String storeName, int version, java.util.function.Consumer<STATS> function)
-
getTotalStats
protected STATS getTotalStats(java.lang.String storeName)
-
getStats
protected STATS getStats(java.lang.String storeName, int version)
-
registerConditionalStats
protected void registerConditionalStats(java.lang.String storeName)
-
addStore
protected VeniceVersionedStats<STATS,STATS_REPORTER> addStore(java.lang.String storeName)
-
updateStatsVersionInfo
protected void updateStatsVersionInfo(java.lang.String storeName, java.util.List<Version> existingVersions, int newCurrentVersion)
-
handleStoreCreated
public void handleStoreCreated(Store store)
Description copied from interface:StoreDataChangedListenerDo NOT try to acquire the lock of store repository again in the implementation, otherwise a dead lock issue will happen.- Specified by:
handleStoreCreatedin interfaceStoreDataChangedListener
-
handleStoreDeleted
public void handleStoreDeleted(java.lang.String storeName)
- Specified by:
handleStoreDeletedin interfaceStoreDataChangedListener
-
handleStoreChanged
public void handleStoreChanged(Store store)
- Specified by:
handleStoreChangedin interfaceStoreDataChangedListener
-
isFutureVersion
public boolean isFutureVersion(java.lang.String storeName, int version)
-
getFutureVersion
protected int getFutureVersion(java.lang.String storeName)
returnStore.NON_EXISTING_VERSIONif future version doesn't exist.
-
getCurrentVersion
protected int getCurrentVersion(java.lang.String storeName)
returnStore.NON_EXISTING_VERSIONif current version doesn't exist.
-
updateTotalStats
protected void updateTotalStats(java.lang.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.
-
-