HBASE-20396 Remove redundant metrics from thrift metrics
This commit is contained in:
parent
3bca01854a
commit
6df7f2346c
|
@ -30,25 +30,31 @@ public class MetricsThriftServerSourceFactoryImpl implements MetricsThriftServer
|
|||
* A singleton used to make sure that only one thrift metrics source per server type is ever
|
||||
* created.
|
||||
*/
|
||||
private static enum FactoryStorage {
|
||||
private enum FactoryStorage {
|
||||
INSTANCE;
|
||||
MetricsThriftServerSourceImpl thriftOne = new MetricsThriftServerSourceImpl(METRICS_NAME,
|
||||
METRICS_DESCRIPTION,
|
||||
THRIFT_ONE_METRICS_CONTEXT,
|
||||
THRIFT_ONE_JMX_CONTEXT);
|
||||
MetricsThriftServerSourceImpl thriftTwo = new MetricsThriftServerSourceImpl(METRICS_NAME,
|
||||
METRICS_DESCRIPTION,
|
||||
THRIFT_TWO_METRICS_CONTEXT,
|
||||
THRIFT_TWO_JMX_CONTEXT);
|
||||
MetricsThriftServerSourceImpl thriftOne;
|
||||
MetricsThriftServerSourceImpl thriftTwo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MetricsThriftServerSource createThriftOneSource() {
|
||||
if (FactoryStorage.INSTANCE.thriftOne == null) {
|
||||
FactoryStorage.INSTANCE.thriftOne = new MetricsThriftServerSourceImpl(METRICS_NAME,
|
||||
METRICS_DESCRIPTION,
|
||||
THRIFT_ONE_METRICS_CONTEXT,
|
||||
THRIFT_ONE_JMX_CONTEXT);
|
||||
}
|
||||
return FactoryStorage.INSTANCE.thriftOne;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MetricsThriftServerSource createThriftTwoSource() {
|
||||
if (FactoryStorage.INSTANCE.thriftTwo == null) {
|
||||
FactoryStorage.INSTANCE.thriftTwo = new MetricsThriftServerSourceImpl(METRICS_NAME,
|
||||
METRICS_DESCRIPTION,
|
||||
THRIFT_TWO_METRICS_CONTEXT,
|
||||
THRIFT_TWO_JMX_CONTEXT);
|
||||
}
|
||||
return FactoryStorage.INSTANCE.thriftTwo;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue