Package org.apache.cassandra.config

Examples of org.apache.cassandra.config.Config


        ConfigEditor editor = new ConfigEditor(configFile);
        editor.load();
        editor.setSeeds("127.0.0.1", "127.0.0.2", "127.0.0.3");
        editor.save();

        Config config = loadConfig();

        assertEquals(config.seed_provider.parameters.get("seeds"), "127.0.0.1,127.0.0.2,127.0.0.3",
            "Failed to update seeds property.");
    }
View Full Code Here


        ConfigEditor editor = new ConfigEditor(configFile);
        editor.load();
        editor.setNativeTransportPort(9393);
        editor.save();

        Config config = loadConfig();

        assertEquals(config.native_transport_port, (Integer) 9393, "Failed to update native_transport_port");

        editor.load();
View Full Code Here

        ConfigEditor editor = new ConfigEditor(configFile);
        editor.load();
        editor.setStoragePort(6767);
        editor.save();

        Config config = loadConfig();

        assertEquals(config.storage_port, (Integer) 6767, "Failed to update storage_port");

        editor.load();
View Full Code Here

        ConfigEditor editor = new ConfigEditor(configFile);
        editor.load();
        editor.setDataFileDirectories(asList("/data/dir1", "/data/dir2", "data/dir3"));
        editor.save();

        Config config = loadConfig();

        assertEquals(config.data_file_directories, new String[] {"/data/dir1", "/data/dir2", "data/dir3"},
            "Failed to update data_file_directories");

        editor.load();
View Full Code Here

            assertThatInternodeAuthConfFileMatches("127.0.0.1", "127.0.0.2");

            File confDir = new File(basedir, "conf");
            File cassandraYamlFile = new File(confDir, "cassandra.yaml");
            Config config = loadConfig(cassandraYamlFile);

            assertEquals(config.seed_provider.parameters.get("seeds"), "127.0.0.1", "Failed to update seeds " +
                "property in " + cassandraYamlFile);
        } finally {
            shutdownStorageNodeIfNecessary(node2Basedir);
View Full Code Here

        return Collections.unmodifiableList(seeds);
    }

    private List<InetAddress> loadSeeds() throws IOException, ConfigurationException
    {
        Config conf = DatabaseDescriptor.loadConfig();
        String[] hosts = conf.seed_provider.parameters.get("seeds").split(",", -1);
        List<InetAddress> seeds = new ArrayList<InetAddress>(hosts.length);
        for (String host : hosts)
        {
            try
View Full Code Here

    public SimpleSeedProvider(Map<String, String> args) {}

    public List<InetAddress> getSeeds()
    {
        Config conf;
        try
        {
            conf = DatabaseDescriptor.loadConfig();
        }
        catch (Exception e)
View Full Code Here

        org.yaml.snakeyaml.constructor.Constructor constructor = new org.yaml.snakeyaml.constructor.Constructor(Config.class);
        TypeDescription seedDesc = new TypeDescription(SeedProviderDef.class);
        seedDesc.putMapPropertyType("parameters", String.class, String.class);
        constructor.addTypeDescription(seedDesc);
        Yaml yaml = new Yaml(new Loader(constructor));
        Config conf = (Config)yaml.load(input);
        String[] hosts = conf.seed_provider.parameters.get("seeds").split(",", -1);
        List<InetAddress> seeds = new ArrayList<InetAddress>(hosts.length);
        for (String host : hosts)
        {
            try
View Full Code Here

        return Collections.unmodifiableList(seeds);
    }

    private List<InetAddress> loadSeeds() throws IOException, ConfigurationException
    {
        Config conf = DatabaseDescriptor.loadConfig();
        String[] hosts = conf.seed_provider.parameters.get("seeds").split(",", -1);
        List<InetAddress> seeds = new ArrayList<InetAddress>(hosts.length);
        for (String host : hosts)
        {
            try
View Full Code Here

    }

    @Override
    public Config loadConfig() throws ConfigurationException
    {
        Config config = super.loadConfig();


        config.rpc_port += offset;
        config.native_transport_port += offset;
        config.storage_port += offset;
View Full Code Here

TOP

Related Classes of org.apache.cassandra.config.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.