Github user ctubbsii commented on a diff in the pull request:
https://github.com/apache/accumulo/pull/225#discussion_r103785551
--- Diff:
server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java
---
@@ -148,46 +148,35 @@ public Configuration getMetricsConfiguration() {
}
private void loadConfiguration() {
- String accumuloConfDir =
getEnvironmentConfiguration().getString("ACCUMULO_CONF_DIR");
- if (null != accumuloConfDir) {
- // Try to load the metrics properties file
- File mFile = new File(accumuloConfDir, metricsFileName);
- if (mFile.exists()) {
- if (log.isDebugEnabled())
- log.debug("Loading config file: " + mFile.getAbsolutePath());
- try {
- xConfig = new XMLConfiguration(mFile);
- xConfig.append(getEnvironmentConfiguration());
- xConfig.addConfigurationListener(new MetricsConfigListener());
- xConfig.setReloadingStrategy(new FileChangedReloadingStrategy());
-
- // Start a background Thread that checks a property from the
XMLConfiguration
- // every so often to force the FileChangedReloadingStrategy to
fire.
- if (null == watcher || !watcher.isAlive()) {
- watcher = new MetricsConfigWatcher();
- watcher.start();
- }
- notFound = false;
- alreadyWarned = false;
- } catch (ConfigurationException ce) {
- log.error("Error reading accumulo-metrics.xml file.");
- notFound = true;
- return;
- }
- } else {
- if (!alreadyWarned)
- log.warn("Unable to find metrics file: " +
mFile.getAbsolutePath());
- alreadyWarned = true;
- notFound = true;
- return;
- }
- } else {
+ URL metricsUrl =
MetricsConfiguration.class.getClassLoader().getResource("accumulo-metrics.xml");
--- End diff --
So many +1s to this simplification.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---