Package com.datastax.driver.core.policies

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


        assertThat(actual.state).isEqualTo(expected);
        return this;
    }

    public HostAssert isAtDistance(HostDistance expected) {
        LoadBalancingPolicy loadBalancingPolicy = cluster.manager.loadBalancingPolicy();
        assertThat(loadBalancingPolicy.distance(actual)).isEqualTo(expected);
        return this;
    }
View Full Code Here


    public static Cluster getInputCluster(String host, Configuration conf)
    {
        int port = getInputNativePort(conf);
        Optional<AuthProvider> authProvider = getAuthProvider(conf);
        Optional<SSLOptions> sslOptions = getSSLOptions(conf);
        LoadBalancingPolicy loadBalancingPolicy = getReadLoadBalancingPolicy(conf, host);
        SocketOptions socketOptions = getReadSocketOptions(conf);
        QueryOptions queryOptions = getReadQueryOptions(conf);
        PoolingOptions poolingOptions = getReadPoolingOptions(conf);
       
        Cluster.Builder builder = Cluster.builder()
View Full Code Here

        return socketOptions;
    }

    private static LoadBalancingPolicy getReadLoadBalancingPolicy(Configuration conf, final String stickHost)
    {
        return new LoadBalancingPolicy()
        {
            private Host origHost;
            private Set<Host> liveRemoteHosts = Sets.newHashSet();

            @Override
View Full Code Here

        Policies policies = configuration.getPolicies();
        JsonObject policiesJson = new JsonObject();
        json.putObject("policies", policiesJson);

        if (policies != null) {
            LoadBalancingPolicy lbPolicy = policies.getLoadBalancingPolicy();
            policiesJson.putString("load_balancing", lbPolicy == null ? null : lbPolicy.getClass().getSimpleName());
            ReconnectionPolicy reconnectionPolicy = policies.getReconnectionPolicy();
            policiesJson.putString("reconnection", reconnectionPolicy == null ? null : reconnectionPolicy.getClass().getSimpleName());
            RetryPolicy retryPolicy = policies.getRetryPolicy();
            policiesJson.putString("retry", retryPolicy == null ? null : retryPolicy.getClass().getSimpleName());
        }
View Full Code Here

        Policies policies = configuration.getPolicies();
        JsonObject policiesJson = new JsonObject();
        json.putObject("policies", policiesJson);

        if (policies != null) {
            LoadBalancingPolicy lbPolicy = policies.getLoadBalancingPolicy();
            policiesJson.putString("load_balancing", lbPolicy == null ? null : lbPolicy.getClass().getSimpleName());
            ReconnectionPolicy reconnectionPolicy = policies.getReconnectionPolicy();
            policiesJson.putString("reconnection", reconnectionPolicy == null ? null : reconnectionPolicy.getClass().getSimpleName());
            RetryPolicy retryPolicy = policies.getRetryPolicy();
            policiesJson.putString("retry", retryPolicy == null ? null : retryPolicy.getClass().getSimpleName());
        }
View Full Code Here

        Policies policies = configuration.getPolicies();
        JsonObject policiesJson = new JsonObject();
        json.putObject("policies", policiesJson);

        if (policies != null) {
            LoadBalancingPolicy lbPolicy = policies.getLoadBalancingPolicy();
            policiesJson.putString("load_balancing", lbPolicy == null ? null : lbPolicy.getClass().getSimpleName());
            ReconnectionPolicy reconnectionPolicy = policies.getReconnectionPolicy();
            policiesJson.putString("reconnection", reconnectionPolicy == null ? null : reconnectionPolicy.getClass().getSimpleName());
            RetryPolicy retryPolicy = policies.getRetryPolicy();
            policiesJson.putString("retry", retryPolicy == null ? null : retryPolicy.getClass().getSimpleName());
        }
View Full Code Here

    public static Cluster getInputCluster(String[] hosts, Configuration conf)
    {
        int port = getInputNativePort(conf);
        Optional<AuthProvider> authProvider = getAuthProvider(conf);
        Optional<SSLOptions> sslOptions = getSSLOptions(conf);
        LoadBalancingPolicy loadBalancingPolicy = getReadLoadBalancingPolicy(conf, hosts);
        SocketOptions socketOptions = getReadSocketOptions(conf);
        QueryOptions queryOptions = getReadQueryOptions(conf);
        PoolingOptions poolingOptions = getReadPoolingOptions(conf);
       
        Cluster.Builder builder = Cluster.builder()
View Full Code Here

    public static Cluster getInputCluster(String[] hosts, Configuration conf)
    {
        int port = getInputNativePort(conf);
        Optional<AuthProvider> authProvider = getAuthProvider(conf);
        Optional<SSLOptions> sslOptions = getSSLOptions(conf);
        LoadBalancingPolicy loadBalancingPolicy = getReadLoadBalancingPolicy(conf, hosts);
        SocketOptions socketOptions = getReadSocketOptions(conf);
        QueryOptions queryOptions = getReadQueryOptions(conf);
        PoolingOptions poolingOptions = getReadPoolingOptions(conf);
       
        Cluster.Builder builder = Cluster.builder()
View Full Code Here

    public static Cluster getInputCluster(String host, Configuration conf)
    {
        int port = getInputNativePort(conf);
        Optional<AuthProvider> authProvider = getAuthProvider(conf);
        Optional<SSLOptions> sslOptions = getSSLOptions(conf);
        LoadBalancingPolicy loadBalancingPolicy = getReadLoadBalancingPolicy(conf, host);
        SocketOptions socketOptions = getReadSocketOptions(conf);
        QueryOptions queryOptions = getReadQueryOptions(conf);
        PoolingOptions poolingOptions = getReadPoolingOptions(conf);
       
        Cluster.Builder builder = Cluster.builder()
View Full Code Here

        return socketOptions;
    }

    private static LoadBalancingPolicy getReadLoadBalancingPolicy(Configuration conf, final String stickHost)
    {
        return new LoadBalancingPolicy()
        {
            private Host origHost;
            private Set<Host> liveRemoteHosts = Sets.newHashSet();

            @Override
View Full Code Here

TOP

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

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.