Class StateStoreMetrics

java.lang.Object
org.apache.hadoop.hdfs.server.federation.metrics.StateStoreMetrics
All Implemented Interfaces:
StateStoreMBean
Direct Known Subclasses:
NullStateStoreMetrics

@Metrics(name="StateStoreActivity", about="Router metrics", context="dfs") public class StateStoreMetrics extends Object implements StateStoreMBean
Implementations of the JMX interface for the State Store metrics.
  • Constructor Details

    • StateStoreMetrics

      protected StateStoreMetrics()
  • Method Details

    • create

      public static StateStoreMetrics create(org.apache.hadoop.conf.Configuration conf)
    • shutdown

      public void shutdown()
    • addRead

      public void addRead(long latency)
    • getReadOps

      public long getReadOps()
      Specified by:
      getReadOps in interface StateStoreMBean
    • getReadAvg

      public double getReadAvg()
      Specified by:
      getReadAvg in interface StateStoreMBean
    • addWrite

      public void addWrite(long latency)
    • getWriteOps

      public long getWriteOps()
      Specified by:
      getWriteOps in interface StateStoreMBean
    • getWriteAvg

      public double getWriteAvg()
      Specified by:
      getWriteAvg in interface StateStoreMBean
    • addFailure

      public void addFailure(long latency)
    • getFailureOps

      public long getFailureOps()
      Specified by:
      getFailureOps in interface StateStoreMBean
    • getFailureAvg

      public double getFailureAvg()
      Specified by:
      getFailureAvg in interface StateStoreMBean
    • addRemove

      public void addRemove(long latency)
    • getRemoveOps

      public long getRemoveOps()
      Specified by:
      getRemoveOps in interface StateStoreMBean
    • getRemoveAvg

      public double getRemoveAvg()
      Specified by:
      getRemoveAvg in interface StateStoreMBean
    • setCacheSize

      public void setCacheSize(String name, int size)
      Set the size of the cache for a State Store interface.
      Parameters:
      name - Name of the record to cache.
      size - Number of records.
    • setLocationCache

      public void setLocationCache(String name, long count)
      set the count of the location cache access information.
      Parameters:
      name - Name of the record.
      count - count of the record.
    • setCacheLoading

      public void setCacheLoading(String name, long value)
      Set the cache loading metrics for the state store interface.
      Parameters:
      name - Name of the record of the cache.
      value - The time duration interval as the cache value.
    • getCacheLoadMetrics

      @VisibleForTesting public Map<String,org.apache.hadoop.metrics2.lib.MutableRate> getCacheLoadMetrics()
      Retrieve unmodifiable map of cache loading metrics.
      Returns:
      unmodifiable map of cache loading metrics.
    • reset

      @VisibleForTesting public void reset()