Package org.apache.hadoop.hbase.master
Class MetricsMasterQuotaSourceImpl
java.lang.Object
org.apache.hadoop.hbase.metrics.BaseSourceImpl
org.apache.hadoop.hbase.master.MetricsMasterQuotaSourceImpl
- All Implemented Interfaces:
MetricsMasterQuotaSource,BaseSource,org.apache.hadoop.metrics2.MetricsSource
@Private
public class MetricsMasterQuotaSourceImpl
extends BaseSourceImpl
implements MetricsMasterQuotaSource
Implementation of
MetricsMasterQuotaSource which writes the values passed in via the
interface to the metrics backend.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hadoop.metrics2.lib.MutableGaugeLongprivate final MetricHistogramprivate final org.apache.hadoop.metrics2.lib.MutableGaugeLongprivate final MetricHistogramprivate final MetricHistogramprivate final MetricHistogramprivate final org.apache.hadoop.metrics2.lib.MutableGaugeLongprivate final org.apache.hadoop.metrics2.lib.MutableGaugeLongprivate final MetricsMasterWrapperFields inherited from class org.apache.hadoop.hbase.metrics.BaseSourceImpl
metricsAdapter, metricsContext, metricsDescription, metricsJmxContext, metricsName, metricsRegistry, registryFields inherited from interface org.apache.hadoop.hbase.metrics.BaseSource
HBASE_METRICS_SYSTEM_NAMEFields inherited from interface org.apache.hadoop.hbase.master.MetricsMasterQuotaSource
METRICS_CONTEXT, METRICS_DESCRIPTION, METRICS_JMX_CONTEXT, METRICS_NAME, NS_QUOTA_USAGE_DESC, NS_QUOTA_USAGE_NAME, NUM_NS_QUOTA_VIOLATIONS_DESC, NUM_NS_QUOTA_VIOLATIONS_NAME, NUM_REGION_SIZE_REPORTS_DESC, NUM_REGION_SIZE_REPORTS_NAME, NUM_SPACE_QUOTAS_DESC, NUM_SPACE_QUOTAS_NAME, NUM_TABLES_QUOTA_VIOLATIONS_DESC, NUM_TABLES_QUOTA_VIOLATIONS_NAME, QUOTA_OBSERVER_CHORE_TIME_DESC, QUOTA_OBSERVER_CHORE_TIME_NAME, SNAPSHOT_OBSERVER_CHORE_TIME_DESC, SNAPSHOT_OBSERVER_CHORE_TIME_NAME, SNAPSHOT_OBSERVER_FETCH_TIME_DESC, SNAPSHOT_OBSERVER_FETCH_TIME_NAME, SNAPSHOT_OBSERVER_SIZE_COMPUTATION_TIME_DESC, SNAPSHOT_OBSERVER_SIZE_COMPUTATION_TIME_NAME, TABLE_QUOTA_USAGE_DESC, TABLE_QUOTA_USAGE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionMetricsMasterQuotaSourceImpl(String metricsName, String metricsDescription, String metricsContext, String metricsJmxContext, MetricsMasterWrapper wrapper) -
Method Summary
Modifier and TypeMethodDescriptionprivate StringSummarizes the usage and limit for many targets (table or namespace) into JSON.voidgetMetrics(org.apache.hadoop.metrics2.MetricsCollector metricsCollector, boolean all) voidincrementSnapshotObserverChoreTime(long time) Updates the metric tracking the amount of time taken by theSnapshotQuotaObserverChorewhich runs periodically.voidUpdates the metric tracking the amount of time taken by theSnapshotQuotaObserverChoreto compute the size of one snapshot, relative to the files referenced by the originating table.voidincrementSnapshotObserverSnapshotFetchTime(long time) Updates the metric tracking the amount of time taken by theSnapshotQuotaObserverChoreto fetch all snapshots.voidincrementSpaceQuotaObserverChoreTime(long time) Updates the metric tracking the amount of time taken by theQuotaObserverChorewhich runs periodically.voidupdateNumCurrentSpaceQuotaRegionSizeReports(long numCurrentRegionSizeReports) Updates the metric tracking the number of region size reports the master is currently retaining in memory.voidupdateNumNamespacesInSpaceQuotaViolation(long numNamespacesInViolation) Updates the metric tracking the number of namespaces the master has computed to be in violation of their space quota.voidupdateNumSpaceQuotas(long numSpaceQuotas) Updates the metric tracking the number of space quotas defined in the system.voidupdateNumTablesInSpaceQuotaViolation(long numTablesInViolation) Updates the metric tracking the number of tables the master has computed to be in violation of their space quota.Methods inherited from class org.apache.hadoop.hbase.metrics.BaseSourceImpl
decGauge, getMetricsContext, getMetricsDescription, getMetricsJmxContext, getMetricsName, getMetricsRegistry, incCounters, incGauge, init, removeMetric, setGauge, updateHistogramMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.metrics.BaseSource
decGauge, getMetricRegistryInfo, getMetricsContext, getMetricsDescription, getMetricsJmxContext, getMetricsName, incCounters, incGauge, init, removeMetric, setGauge, updateHistogram
-
Field Details
-
wrapper
-
spaceQuotasGauge
-
tablesViolatingQuotasGauge
-
namespacesViolatingQuotasGauge
-
regionSpaceReportsGauge
-
quotaObserverTimeHisto
-
snapshotObserverTimeHisto
-
snapshotObserverSizeComputationTimeHisto
-
snapshotObserverSnapshotFetchTimeHisto
-
-
Constructor Details
-
MetricsMasterQuotaSourceImpl
-
MetricsMasterQuotaSourceImpl
public MetricsMasterQuotaSourceImpl(String metricsName, String metricsDescription, String metricsContext, String metricsJmxContext, MetricsMasterWrapper wrapper)
-
-
Method Details
-
updateNumSpaceQuotas
Description copied from interface:MetricsMasterQuotaSourceUpdates the metric tracking the number of space quotas defined in the system.- Specified by:
updateNumSpaceQuotasin interfaceMetricsMasterQuotaSource- Parameters:
numSpaceQuotas- The number of space quotas defined
-
updateNumTablesInSpaceQuotaViolation
Description copied from interface:MetricsMasterQuotaSourceUpdates the metric tracking the number of tables the master has computed to be in violation of their space quota.- Specified by:
updateNumTablesInSpaceQuotaViolationin interfaceMetricsMasterQuotaSource- Parameters:
numTablesInViolation- The number of tables violating a space quota
-
updateNumNamespacesInSpaceQuotaViolation
Description copied from interface:MetricsMasterQuotaSourceUpdates the metric tracking the number of namespaces the master has computed to be in violation of their space quota.- Specified by:
updateNumNamespacesInSpaceQuotaViolationin interfaceMetricsMasterQuotaSource- Parameters:
numNamespacesInViolation- The number of namespaces violating a space quota
-
updateNumCurrentSpaceQuotaRegionSizeReports
Description copied from interface:MetricsMasterQuotaSourceUpdates the metric tracking the number of region size reports the master is currently retaining in memory.- Specified by:
updateNumCurrentSpaceQuotaRegionSizeReportsin interfaceMetricsMasterQuotaSource- Parameters:
numCurrentRegionSizeReports- The number of region size reports the master is holding in memory
-
incrementSpaceQuotaObserverChoreTime
Description copied from interface:MetricsMasterQuotaSourceUpdates the metric tracking the amount of time taken by theQuotaObserverChorewhich runs periodically.- Specified by:
incrementSpaceQuotaObserverChoreTimein interfaceMetricsMasterQuotaSource- Parameters:
time- The execution time of the chore in milliseconds
-
incrementSnapshotObserverChoreTime
Description copied from interface:MetricsMasterQuotaSourceUpdates the metric tracking the amount of time taken by theSnapshotQuotaObserverChorewhich runs periodically.- Specified by:
incrementSnapshotObserverChoreTimein interfaceMetricsMasterQuotaSource
-
getMetrics
- Specified by:
getMetricsin interfaceorg.apache.hadoop.metrics2.MetricsSource- Overrides:
getMetricsin classBaseSourceImpl
-
generateJsonQuotaSummary
private String generateJsonQuotaSummary(Iterable<Map.Entry<String, Map.Entry<Long, Long>>> data, String target) Summarizes the usage and limit for many targets (table or namespace) into JSON. -
incrementSnapshotObserverSnapshotComputationTime
Description copied from interface:MetricsMasterQuotaSourceUpdates the metric tracking the amount of time taken by theSnapshotQuotaObserverChoreto compute the size of one snapshot, relative to the files referenced by the originating table.- Specified by:
incrementSnapshotObserverSnapshotComputationTimein interfaceMetricsMasterQuotaSource
-
incrementSnapshotObserverSnapshotFetchTime
Description copied from interface:MetricsMasterQuotaSourceUpdates the metric tracking the amount of time taken by theSnapshotQuotaObserverChoreto fetch all snapshots.- Specified by:
incrementSnapshotObserverSnapshotFetchTimein interfaceMetricsMasterQuotaSource
-