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
Modifier and TypeFieldDescriptionprivate final org.apache.hadoop.metrics2.lib.MutableGaugeLong
private final MetricHistogram
private final org.apache.hadoop.metrics2.lib.MutableGaugeLong
private final MetricHistogram
private final MetricHistogram
private final MetricHistogram
private final org.apache.hadoop.metrics2.lib.MutableGaugeLong
private final org.apache.hadoop.metrics2.lib.MutableGaugeLong
private final MetricsMasterWrapper
Fields inherited from class org.apache.hadoop.hbase.metrics.BaseSourceImpl
metricsAdapter, metricsContext, metricsDescription, metricsJmxContext, metricsName, metricsRegistry, registry
Fields inherited from interface org.apache.hadoop.hbase.metrics.BaseSource
HBASE_METRICS_SYSTEM_NAME
Fields 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
ConstructorDescriptionMetricsMasterQuotaSourceImpl
(String metricsName, String metricsDescription, String metricsContext, String metricsJmxContext, MetricsMasterWrapper wrapper) -
Method Summary
Modifier and TypeMethodDescriptionprivate String
Summarizes the usage and limit for many targets (table or namespace) into JSON.void
getMetrics
(org.apache.hadoop.metrics2.MetricsCollector metricsCollector, boolean all) void
incrementSnapshotObserverChoreTime
(long time) Updates the metric tracking the amount of time taken by theSnapshotQuotaObserverChore
which runs periodically.void
Updates the metric tracking the amount of time taken by theSnapshotQuotaObserverChore
to compute the size of one snapshot, relative to the files referenced by the originating table.void
incrementSnapshotObserverSnapshotFetchTime
(long time) Updates the metric tracking the amount of time taken by theSnapshotQuotaObserverChore
to fetch all snapshots.void
incrementSpaceQuotaObserverChoreTime
(long time) Updates the metric tracking the amount of time taken by theQuotaObserverChore
which runs periodically.void
updateNumCurrentSpaceQuotaRegionSizeReports
(long numCurrentRegionSizeReports) Updates the metric tracking the number of region size reports the master is currently retaining in memory.void
updateNumNamespacesInSpaceQuotaViolation
(long numNamespacesInViolation) Updates the metric tracking the number of namespaces the master has computed to be in violation of their space quota.void
updateNumSpaceQuotas
(long numSpaceQuotas) Updates the metric tracking the number of space quotas defined in the system.void
updateNumTablesInSpaceQuotaViolation
(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, updateHistogram
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:MetricsMasterQuotaSource
Updates the metric tracking the number of space quotas defined in the system.- Specified by:
updateNumSpaceQuotas
in interfaceMetricsMasterQuotaSource
- Parameters:
numSpaceQuotas
- The number of space quotas defined
-
updateNumTablesInSpaceQuotaViolation
Description copied from interface:MetricsMasterQuotaSource
Updates the metric tracking the number of tables the master has computed to be in violation of their space quota.- Specified by:
updateNumTablesInSpaceQuotaViolation
in interfaceMetricsMasterQuotaSource
- Parameters:
numTablesInViolation
- The number of tables violating a space quota
-
updateNumNamespacesInSpaceQuotaViolation
Description copied from interface:MetricsMasterQuotaSource
Updates the metric tracking the number of namespaces the master has computed to be in violation of their space quota.- Specified by:
updateNumNamespacesInSpaceQuotaViolation
in interfaceMetricsMasterQuotaSource
- Parameters:
numNamespacesInViolation
- The number of namespaces violating a space quota
-
updateNumCurrentSpaceQuotaRegionSizeReports
Description copied from interface:MetricsMasterQuotaSource
Updates the metric tracking the number of region size reports the master is currently retaining in memory.- Specified by:
updateNumCurrentSpaceQuotaRegionSizeReports
in interfaceMetricsMasterQuotaSource
- Parameters:
numCurrentRegionSizeReports
- The number of region size reports the master is holding in memory
-
incrementSpaceQuotaObserverChoreTime
Description copied from interface:MetricsMasterQuotaSource
Updates the metric tracking the amount of time taken by theQuotaObserverChore
which runs periodically.- Specified by:
incrementSpaceQuotaObserverChoreTime
in interfaceMetricsMasterQuotaSource
- Parameters:
time
- The execution time of the chore in milliseconds
-
incrementSnapshotObserverChoreTime
Description copied from interface:MetricsMasterQuotaSource
Updates the metric tracking the amount of time taken by theSnapshotQuotaObserverChore
which runs periodically.- Specified by:
incrementSnapshotObserverChoreTime
in interfaceMetricsMasterQuotaSource
-
getMetrics
- Specified by:
getMetrics
in interfaceorg.apache.hadoop.metrics2.MetricsSource
- Overrides:
getMetrics
in 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:MetricsMasterQuotaSource
Updates the metric tracking the amount of time taken by theSnapshotQuotaObserverChore
to compute the size of one snapshot, relative to the files referenced by the originating table.- Specified by:
incrementSnapshotObserverSnapshotComputationTime
in interfaceMetricsMasterQuotaSource
-
incrementSnapshotObserverSnapshotFetchTime
Description copied from interface:MetricsMasterQuotaSource
Updates the metric tracking the amount of time taken by theSnapshotQuotaObserverChore
to fetch all snapshots.- Specified by:
incrementSnapshotObserverSnapshotFetchTime
in interfaceMetricsMasterQuotaSource
-