Package com.datastax.driver.core.policies

Examples of com.datastax.driver.core.policies.WhiteListPolicy


        Cluster cluster = null;
        try {
            cluster = Cluster.builder()
                             .addContactPoint(CCMBridge.IP_PREFIX + "1")
                             // ensure we will only connect to node1
                             .withLoadBalancingPolicy(new WhiteListPolicy(Policies.defaultLoadBalancingPolicy(),
                                                                          Lists.newArrayList(socketAddress(1))))
                             .build();
            Session session = cluster.connect();
            session.execute("DELETE rpc_address FROM system.peers WHERE peer = ?", InetAddress.getByName(CCMBridge.IP_PREFIX + "2"));
            session.close();
View Full Code Here


    @Test(groups = "long")
    public void whiteListPolicyTest() throws Throwable {

        List<InetSocketAddress> whiteList = Arrays.asList(new InetSocketAddress(InetAddress.getByName(CCMBridge.IP_PREFIX + '2'), 9042));

        Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new WhiteListPolicy(new RoundRobinPolicy(), whiteList));
        CCMBridge.CCMCluster c = CCMBridge.buildCluster(3, builder);
        try {

            createSchema(c.session);
            init(c, 12);
View Full Code Here

    {
        this.host = host;
        this.port = port;
        this.encryptionOptions = encryptionOptions;
        if (settings.node.isWhiteList)
            whitelist = new WhiteListPolicy(new DCAwareRoundRobinPolicy(), settings.node.resolveAll(settings.port.nativePort));
        else
            whitelist = null;
    }
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.policies.WhiteListPolicy

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.