Examples of SimpleSnitch


Examples of org.apache.cassandra.locator.SimpleSnitch

            Map<String, String> currentStrategyOptions = ksDef.getStrategy_options();

            // adding default data center from SimpleSnitch
            if (currentStrategyOptions == null || currentStrategyOptions.isEmpty())
            {
                SimpleSnitch snitch = new SimpleSnitch();
                Map<String, String> options = new HashMap<String, String>();

                try
                {
                    options.put(snitch.getDatacenter(InetAddress.getLocalHost()), "1");
                }
                catch (UnknownHostException e)
                {
                    throw new RuntimeException(e.getMessage());
                }
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

    {
        return AbstractReplicationStrategy.createReplicationStrategy(
                table,
                "org.apache.cassandra.locator.RackUnawareStrategy",
                tmd,
                new SimpleSnitch(),
                null);
    }
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

public class DynamicEndpointSnitchTest
{
    @Test
    public void testSnitch() throws UnknownHostException, InterruptedException
    {
        DynamicEndpointSnitch dsnitch = new DynamicEndpointSnitch(new SimpleSnitch());
        InetAddress self = FBUtilities.getLocalAddress();
        ArrayList<InetAddress> order = new ArrayList<InetAddress>();
        InetAddress host1 = InetAddress.getByName("127.0.0.1");
        InetAddress host2 = InetAddress.getByName("127.0.0.2");
        InetAddress host3 = InetAddress.getByName("127.0.0.3");
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

        KSMetaData ksmd = Schema.instance.getKSMetaData(keyspaceName);
        return AbstractReplicationStrategy.createReplicationStrategy(
                keyspaceName,
                ksmd.strategyClass,
                tmd,
                new SimpleSnitch(),
                ksmd.strategyOptions);
    }
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

            Map<String, String> currentStrategyOptions = ksDef.getStrategy_options();

            // adding default data center from SimpleSnitch
            if (currentStrategyOptions == null || currentStrategyOptions.isEmpty())
            {
                SimpleSnitch snitch = new SimpleSnitch();
                Map<String, String> options = new HashMap<String, String>();

                try
                {
                    options.put(snitch.getDatacenter(InetAddress.getLocalHost()), "1");
                }
                catch (UnknownHostException e)
                {
                    throw new RuntimeException(e.getMessage());
                }
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

    private AbstractReplicationStrategy getStrategy(String table, TokenMetadata tmd) throws ConfigurationException
    {
        return AbstractReplicationStrategy.createReplicationStrategy(table,
                                                                     "org.apache.cassandra.locator.SimpleStrategy",
                                                                     tmd,
                                                                     new SimpleSnitch(),
                                                                     null);
    }
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

        KSMetaData ksmd = Schema.instance.getKSMetaData(table);
        return AbstractReplicationStrategy.createReplicationStrategy(
                table,
                ksmd.strategyClass,
                tmd,
                new SimpleSnitch(),
                ksmd.strategyOptions);
    }
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

        KSMetaData ksmd = Schema.instance.getKSMetaData(table);
        return AbstractReplicationStrategy.createReplicationStrategy(
                table,
                ksmd.strategyClass,
                tmd,
                new SimpleSnitch(),
                ksmd.strategyOptions);
    }
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

            Map<String, String> currentStrategyOptions = ksDef.getStrategy_options();

            // adding default data center from SimpleSnitch
            if (currentStrategyOptions == null || currentStrategyOptions.isEmpty())
            {
                SimpleSnitch snitch = new SimpleSnitch();
                Map<String, String> options = new HashMap<String, String>();
                options.put(snitch.getDatacenter(FBUtilities.getBroadcastAddress()), "1");

                ksDef.setStrategy_options(options);
            }
        }
View Full Code Here

Examples of org.apache.cassandra.locator.SimpleSnitch

            Map<String, String> currentStrategyOptions = ksDef.getStrategy_options();

            // adding default data center from SimpleSnitch
            if (currentStrategyOptions == null || currentStrategyOptions.isEmpty())
            {
                SimpleSnitch snitch = new SimpleSnitch();
                Map<String, String> options = new HashMap<String, String>();

                try
                {
                    options.put(snitch.getDatacenter(InetAddress.getLocalHost()), "1");
                }
                catch (UnknownHostException e)
                {
                    throw new RuntimeException(e);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.