gpt4 book ai didi

org.apache.cassandra.config.YamlConfigurationLoader类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 02:42:49 30 4
gpt4 key购买 nike

本文整理了Java中org.apache.cassandra.config.YamlConfigurationLoader类的一些代码示例,展示了YamlConfigurationLoader类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlConfigurationLoader类的具体详情如下:
包路径:org.apache.cassandra.config.YamlConfigurationLoader
类名称:YamlConfigurationLoader

YamlConfigurationLoader介绍

暂无

代码示例

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

@Override
public Config loadConfig() throws ConfigurationException
{
  if (storageConfigURL == null)
    storageConfigURL = getStorageConfigURL();
  return loadConfig(storageConfigURL);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

config = new YamlConfigurationLoader().loadConfig(configFile.toURI().toURL());

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

@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;
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

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);
  }
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

logConfig(configBytes);

代码示例来源:origin: jsevellec/cassandra-unit

config = new YamlConfigurationLoader().loadConfig(configFile.toURI().toURL());

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

@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();
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

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);
  }
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public Config loadConfig() throws ConfigurationException
{
  return loadConfig(getStorageConfigURL());
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

config = new YamlConfigurationLoader().loadConfig(configFile.toURI().toURL());

代码示例来源:origin: org.apache.cassandra/cassandra-all

@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;
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

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);
  }
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Override
public Config loadConfig() throws ConfigurationException
{
  if (storageConfigURL == null)
    storageConfigURL = getStorageConfigURL();
  return loadConfig(storageConfigURL);
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

config = new YamlConfigurationLoader().loadConfig(configFile.toURI().toURL());

代码示例来源:origin: jsevellec/cassandra-unit

@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;
}

代码示例来源:origin: jsevellec/cassandra-unit

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);
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

@Override
public Config loadConfig() throws ConfigurationException
{
  if (storageConfigURL == null)
    storageConfigURL = getStorageConfigURL();
  return loadConfig(storageConfigURL);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@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;
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Override
public Config loadConfig() throws ConfigurationException
{
  if (storageConfigURL == null)
    storageConfigURL = getStorageConfigURL();
  return loadConfig(storageConfigURL);
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com