@Override public Config loadConfig() throws ConfigurationException { if (storageConfigURL == null) storageConfigURL = getStorageConfigURL(); return loadConfig(storageConfigURL); }
config = new YamlConfigurationLoader().loadConfig(configFile.toURI().toURL());
@VisibleForTesting public static Config loadConfig() throws ConfigurationException { String loaderClass = System.getProperty(Config.PROPERTY_PREFIX + "config.loader"); ConfigurationLoader loader = loaderClass == null ? new YamlConfigurationLoader() : FBUtilities.<ConfigurationLoader>construct(loaderClass, "configuration loading"); Config config = loader.loadConfig(); if (!hasLoggedConfig) { hasLoggedConfig = true; Config.log(config); } return config; }
public Config loadConfig(URL url) throws ConfigurationException { try { logger.debug("Loading settings from {}", url); byte[] configBytes; try (InputStream is = url.openStream()) { configBytes = ByteStreams.toByteArray(is); } catch (IOException e) { // getStorageConfigURL should have ruled this out throw new AssertionError(e); } Constructor constructor = new CustomConstructor(Config.class); PropertiesChecker propertiesChecker = new PropertiesChecker(); constructor.setPropertyUtils(propertiesChecker); Yaml yaml = new Yaml(constructor); Config result = loadConfig(yaml, configBytes); propertiesChecker.check(); return result; } catch (YAMLException e) { throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR + " Error: " + e.getMessage(), false); } }
config = new YamlConfigurationLoader().loadConfig(configFile.toURI().toURL());
@VisibleForTesting public static Config loadConfig() throws ConfigurationException { String loaderClass = System.getProperty("cassandra.config.loader"); ConfigurationLoader loader = loaderClass == null ? new YamlConfigurationLoader() : FBUtilities.<ConfigurationLoader>construct(loaderClass, "configuration loading"); return loader.loadConfig(); }
public Config loadConfig(URL url) throws ConfigurationException { try { logger.debug("Loading settings from {}", url); byte[] configBytes; try (InputStream is = url.openStream()) { configBytes = ByteStreams.toByteArray(is); } catch (IOException e) { // getStorageConfigURL should have ruled this out throw new AssertionError(e); } Constructor constructor = new CustomConstructor(Config.class); PropertiesChecker propertiesChecker = new PropertiesChecker(); constructor.setPropertyUtils(propertiesChecker); Yaml yaml = new Yaml(constructor); Config result = loadConfig(yaml, configBytes); propertiesChecker.check(); return result; } catch (YAMLException e) { throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR + " Error: " + e.getMessage(), false); } }
public Config loadConfig() throws ConfigurationException { return loadConfig(getStorageConfigURL()); }
config = new YamlConfigurationLoader().loadConfig(configFile.toURI().toURL());
@VisibleForTesting public static Config loadConfig() throws ConfigurationException { String loaderClass = System.getProperty(Config.PROPERTY_PREFIX + "config.loader"); ConfigurationLoader loader = loaderClass == null ? new YamlConfigurationLoader() : FBUtilities.<ConfigurationLoader>construct(loaderClass, "configuration loading"); Config config = loader.loadConfig(); if (!hasLoggedConfig) { hasLoggedConfig = true; Config.log(config); } return config; }
public Config loadConfig(URL url) throws ConfigurationException { try { logger.debug("Loading settings from {}", url); byte[] configBytes; try (InputStream is = url.openStream()) { configBytes = ByteStreams.toByteArray(is); } catch (IOException e) { // getStorageConfigURL should have ruled this out throw new AssertionError(e); } Constructor constructor = new CustomConstructor(Config.class); PropertiesChecker propertiesChecker = new PropertiesChecker(); constructor.setPropertyUtils(propertiesChecker); Yaml yaml = new Yaml(constructor); Config result = loadConfig(yaml, configBytes); propertiesChecker.check(); return result; } catch (YAMLException e) { throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR + " Error: " + e.getMessage(), false); } }
@Override public Config loadConfig() throws ConfigurationException { if (storageConfigURL == null) storageConfigURL = getStorageConfigURL(); return loadConfig(storageConfigURL); }
config = new YamlConfigurationLoader().loadConfig(configFile.toURI().toURL());
@VisibleForTesting public static Config loadConfig() throws ConfigurationException { String loaderClass = System.getProperty(Config.PROPERTY_PREFIX + "config.loader"); ConfigurationLoader loader = loaderClass == null ? new YamlConfigurationLoader() : FBUtilities.<ConfigurationLoader>construct(loaderClass, "configuration loading"); Config config = loader.loadConfig(); if (!hasLoggedConfig) { hasLoggedConfig = true; Config.log(config); } return config; }
public Config loadConfig(URL url) throws ConfigurationException { try { logger.debug("Loading settings from {}", url); byte[] configBytes; try (InputStream is = url.openStream()) { configBytes = ByteStreams.toByteArray(is); } catch (IOException e) { // getStorageConfigURL should have ruled this out throw new AssertionError(e); } Constructor constructor = new CustomConstructor(Config.class); PropertiesChecker propertiesChecker = new PropertiesChecker(); constructor.setPropertyUtils(propertiesChecker); Yaml yaml = new Yaml(constructor); Config result = loadConfig(yaml, configBytes); propertiesChecker.check(); return result; } catch (YAMLException e) { throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR + " Error: " + e.getMessage(), false); } }
@Override public Config loadConfig() throws ConfigurationException { if (storageConfigURL == null) storageConfigURL = getStorageConfigURL(); return loadConfig(storageConfigURL); }
@VisibleForTesting public static Config loadConfig() throws ConfigurationException { String loaderClass = System.getProperty(Config.PROPERTY_PREFIX + "config.loader"); ConfigurationLoader loader = loaderClass == null ? new YamlConfigurationLoader() : FBUtilities.<ConfigurationLoader>construct(loaderClass, "configuration loading"); Config config = loader.loadConfig(); if (!hasLoggedConfig) { hasLoggedConfig = true; Config.log(config); } return config; }
@Override public Config loadConfig() throws ConfigurationException { if (storageConfigURL == null) storageConfigURL = getStorageConfigURL(); return loadConfig(storageConfigURL); }