public class ReadWriteLockMetrics extends Object implements ReadWriteLock
ReadWriteLock
implementation.| Modifier and Type | Class and Description |
|---|---|
static class |
ReadWriteLockMetrics.LockMetricInfo |
static class |
ReadWriteLockMetrics.MetricsComparator
Helper class to compare two
LockMetricSource instances. |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.hadoop.metrics2.MetricsSource |
createLockMetricsSource(String label)
Factory method for new metric collections.
|
static List<org.apache.hadoop.metrics2.MetricsSource> |
getAllMetricsSources()
Returns a list with all created
MetricsSource instances for
the R/W lock metrics. |
Lock |
readLock() |
static ReadWriteLock |
wrap(org.apache.hadoop.conf.Configuration conf,
ReadWriteLock lock,
org.apache.hadoop.metrics2.MetricsSource metrics)
Wraps a
ReadWriteLock into a monitored lock if required by
configuration. |
Lock |
writeLock() |
public static ReadWriteLock wrap(org.apache.hadoop.conf.Configuration conf, ReadWriteLock lock, org.apache.hadoop.metrics2.MetricsSource metrics)
ReadWriteLock into a monitored lock if required by
configuration. This helper is checking the
hive.llap.lockmetrics.collect configuration option and wraps the
passed in ReadWriteLock into a monitoring container if the
option is set to true. Otherwise, the original (passed in)
lock instance is returned unmodified.conf - Configuration instance to check for LLAP conf optionslock - The ReadWriteLock to wrap for monitoringmetrics - The target container for locking metricscreateLockMetricsSource(java.lang.String)public static org.apache.hadoop.metrics2.MetricsSource createLockMetricsSource(String label)
MetricsSource collection for
multiple R/W locks. This makes sense if several locks belong to a single
group and you're then interested in the accumulated values for the whole
group, rather than the single lock instance. The passed in label is
supposed to identify the group uniquely.label - The group identifier for lock statisticspublic static List<org.apache.hadoop.metrics2.MetricsSource> getAllMetricsSources()
MetricsSource instances for
the R/W lock metrics. The returned list contains the instances that were
previously created via the createLockMetricsSource function.public Lock readLock()
readLock in interface ReadWriteLockpublic Lock writeLock()
writeLock in interface ReadWriteLockCopyright © 2022 The Apache Software Foundation. All rights reserved.