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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailure(long latency) voidaddRead(long latency) voidaddRemove(long latency) voidaddWrite(long latency) static StateStoreMetricscreate(org.apache.hadoop.conf.Configuration conf) Retrieve unmodifiable map of cache loading metrics.doublelongdoublelongdoublelongdoublelongvoidreset()voidsetCacheLoading(String name, long value) Set the cache loading metrics for the state store interface.voidsetCacheSize(String name, int size) Set the size of the cache for a State Store interface.voidsetLocationCache(String name, long count) set the count of the location cache access information.voidshutdown()
-
Constructor Details
-
StateStoreMetrics
protected StateStoreMetrics()
-
-
Method Details
-
create
-
shutdown
public void shutdown() -
addRead
public void addRead(long latency) -
getReadOps
public long getReadOps()- Specified by:
getReadOpsin interfaceStateStoreMBean
-
getReadAvg
public double getReadAvg()- Specified by:
getReadAvgin interfaceStateStoreMBean
-
addWrite
public void addWrite(long latency) -
getWriteOps
public long getWriteOps()- Specified by:
getWriteOpsin interfaceStateStoreMBean
-
getWriteAvg
public double getWriteAvg()- Specified by:
getWriteAvgin interfaceStateStoreMBean
-
addFailure
public void addFailure(long latency) -
getFailureOps
public long getFailureOps()- Specified by:
getFailureOpsin interfaceStateStoreMBean
-
getFailureAvg
public double getFailureAvg()- Specified by:
getFailureAvgin interfaceStateStoreMBean
-
addRemove
public void addRemove(long latency) -
getRemoveOps
public long getRemoveOps()- Specified by:
getRemoveOpsin interfaceStateStoreMBean
-
getRemoveAvg
public double getRemoveAvg()- Specified by:
getRemoveAvgin interfaceStateStoreMBean
-
setCacheSize
Set the size of the cache for a State Store interface.- Parameters:
name- Name of the record to cache.size- Number of records.
-
setLocationCache
set the count of the location cache access information.- Parameters:
name- Name of the record.count- count of the record.
-
setCacheLoading
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()
-