SOLR-8095: Allow disabling HDFS Locality Metrics and disable by default as it may have performance implications on rapidly changing indexes.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1706302 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2015-10-01 18:16:45 +00:00
parent c0bb4b8b35
commit 3749a573b5
3 changed files with 9 additions and 3 deletions

View File

@ -219,6 +219,8 @@ Bug Fixes
* SOLR-8104: Config API does not work for spellchecker (noble)
* SOLR-8095: Allow disabling HDFS Locality Metrics and disable by default as it may have performance
implications on rapidly changing indexes. (Mike Drob via Mark Miller)
Optimizations
----------------------

View File

@ -81,7 +81,9 @@ public class HdfsDirectoryFactory extends CachingDirectoryFactory implements Sol
public static final String NRTCACHINGDIRECTORY_MAXMERGESIZEMB = "solr.hdfs.nrtcachingdirectory.maxmergesizemb";
public static final String NRTCACHINGDIRECTORY_MAXCACHEMB = "solr.hdfs.nrtcachingdirectory.maxcachedmb";
public static final String NUMBEROFBLOCKSPERBANK = "solr.hdfs.blockcache.blocksperbank";
public static final String LOCALITYMETRICS_ENABLED = "solr.hdfs.locality.metrics.enabled";
public static final String KERBEROS_ENABLED = "solr.hdfs.security.kerberos.enabled";
public static final String KERBEROS_KEYTAB = "solr.hdfs.security.kerberos.keytabfile";
public static final String KERBEROS_PRINCIPAL = "solr.hdfs.security.kerberos.principal";
@ -219,8 +221,9 @@ public class HdfsDirectoryFactory extends CachingDirectoryFactory implements Sol
hdfsDir = new HdfsDirectory(new Path(path), lockFactory, conf);
dir = hdfsDir;
}
LocalityHolder.reporter.registerDirectory(hdfsDir);
if (params.getBool(LOCALITYMETRICS_ENABLED, false)) {
LocalityHolder.reporter.registerDirectory(hdfsDir);
}
boolean nrtCachingDirectory = getConfig(NRTCACHINGDIRECTORY_ENABLE, true);
if (nrtCachingDirectory) {

View File

@ -187,6 +187,7 @@ public class HdfsDirectoryFactoryTest extends SolrTestCaseJ4 {
props.put(HdfsDirectoryFactory.HDFS_HOME, HdfsTestUtil.getURI(dfsCluster) + "/solr");
props.put(HdfsDirectoryFactory.BLOCKCACHE_ENABLED, "false");
props.put(HdfsDirectoryFactory.NRTCACHINGDIRECTORY_ENABLE, "false");
props.put(HdfsDirectoryFactory.LOCALITYMETRICS_ENABLED, "true");
factory.init(new NamedList<>(props));
Iterator<SolrInfoMBean> it = factory.offerMBeans().iterator();