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 java.lang.Object implements StoreDataChangedListener
-
-
Field Summary
Fields Modifier and Type Field Description protected ReadOnlyStoreRepository
metadataRepository
-
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 int
getCurrentVersion(java.lang.String storeName)
returnStore.NON_EXISTING_VERSION
if current version doesn't exist.protected int
getFutureVersion(java.lang.String storeName)
returnStore.NON_EXISTING_VERSION
if future version doesn't exist.protected STATS
getStats(java.lang.String storeName, int version)
protected STATS
getTotalStats(java.lang.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(java.lang.String storeName)
boolean
isFutureVersion(java.lang.String storeName, int version)
void
loadAllStats()
protected void
recordVersionedAndTotalStat(java.lang.String storeName, int version, java.util.function.Consumer<STATS> function)
protected void
registerConditionalStats(java.lang.String storeName)
protected void
updateStatsVersionInfo(java.lang.String storeName, java.util.List<Version> existingVersions, int newCurrentVersion)
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.-
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: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
public void handleStoreDeleted(java.lang.String storeName)
- Specified by:
handleStoreDeleted
in interfaceStoreDataChangedListener
-
handleStoreChanged
public void handleStoreChanged(Store store)
- Specified by:
handleStoreChanged
in interfaceStoreDataChangedListener
-
isFutureVersion
public boolean isFutureVersion(java.lang.String storeName, int version)
-
getFutureVersion
protected int getFutureVersion(java.lang.String storeName)
returnStore.NON_EXISTING_VERSION
if future version doesn't exist.
-
getCurrentVersion
protected int getCurrentVersion(java.lang.String storeName)
returnStore.NON_EXISTING_VERSION
if 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.
-
-