public class HdfsLocalityReporter extends Object implements SolrInfoBean, SolrMetricProducer
SolrInfoBean.Category, SolrInfoBean.Group
Modifier and Type | Field and Description |
---|---|
static String |
LOCALITY_BLOCKS_LOCAL |
static String |
LOCALITY_BLOCKS_RATIO |
static String |
LOCALITY_BLOCKS_TOTAL |
static String |
LOCALITY_BYTES_LOCAL |
static String |
LOCALITY_BYTES_RATIO |
static String |
LOCALITY_BYTES_TOTAL |
Constructor and Description |
---|
HdfsLocalityReporter() |
Modifier and Type | Method and Description |
---|---|
SolrInfoBean.Category |
getCategory()
Category of this component
|
String |
getDescription()
Simple one or two line description
|
Set<String> |
getMetricNames()
Modifiable set of metric names that this component reports (default is null,
which means none).
|
com.codahale.metrics.MetricRegistry |
getMetricRegistry()
An instance of
MetricRegistry that this component uses for metrics reporting
(default is null, which means no registry). |
String |
getName()
Simple common usage name, e.g.
|
void |
initializeMetrics(SolrMetricManager manager,
String registryName,
String scope)
Provide statistics on HDFS block locality, both in terms of bytes and block counts.
|
void |
registerDirectory(HdfsDirectory dir)
Add a directory for block locality reporting.
|
void |
setHost(String hostname)
Set the host name to use when determining locality
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetricsSnapshot, registerMetricName
public static final String LOCALITY_BYTES_TOTAL
public static final String LOCALITY_BYTES_LOCAL
public static final String LOCALITY_BYTES_RATIO
public static final String LOCALITY_BLOCKS_TOTAL
public static final String LOCALITY_BLOCKS_LOCAL
public static final String LOCALITY_BLOCKS_RATIO
public void setHost(String hostname)
hostname
- The name of this host; should correspond to what HDFS Data Nodes think this is.public String getName()
SolrInfoBean
getName
in interface SolrInfoBean
public String getDescription()
SolrInfoBean
getDescription
in interface SolrInfoBean
public SolrInfoBean.Category getCategory()
SolrInfoBean
getCategory
in interface SolrInfoBean
public Set<String> getMetricNames()
SolrInfoBean
SolrInfoBean.registerMetricName(String)
to capture what metrics names are reported from this component.
NOTE: this set has to allow iteration under modifications.
getMetricNames
in interface SolrInfoBean
public com.codahale.metrics.MetricRegistry getMetricRegistry()
SolrInfoBean
MetricRegistry
that this component uses for metrics reporting
(default is null, which means no registry).getMetricRegistry
in interface SolrInfoBean
public void initializeMetrics(SolrMetricManager manager, String registryName, String scope)
initializeMetrics
in interface SolrMetricProducer
manager
- an instance of SolrMetricManager
registryName
- registry name where metrics are registeredscope
- scope of the metrics (eg. handler name) to separate metrics of
instances of the same component executing in different contextspublic void registerDirectory(HdfsDirectory dir)
dir
- The directory to keep metrics on.Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.