Package org.rhq.cassandra.util

Examples of org.rhq.cassandra.util.ClusterBuilder


        for (StorageNode storageNode : storageNodes) {
            hostNames.add(storageNode.getAddress());
        }
        int port = storageNodes.get(0).getCqlPort();

        cluster = new ClusterBuilder().addContactPoints(hostNames.toArray(new String[hostNames.size()]))
            .withCredentialsObfuscated(this.cachedStorageUsername, this.cachedStoragePassword).withPort(port)
            .withLoadBalancingPolicy(getLoadBalancingPolicy())
            .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE)).withCompression(
                ProtocolOptions.Compression.NONE).build();
View Full Code Here


    @BeforeSuite
    @DeployCluster(numNodes = 1, username = RHQADMIN, password = RHQADMIN_PASSWORD, waitForSchemaAgreement = true)
    public void deployCluster() throws Exception {
        dateTimeService = new DateTimeService();

        Cluster cluster = new ClusterBuilder()
            .addContactPoints("127.0.0.1")
            .withCredentialsObfuscated(RHQADMIN, RHQADMIN_PASSWORD)
            .build();

        PoolingOptions poolingOptions = cluster.getConfiguration().getPoolingOptions();
View Full Code Here

    private final Log log = LogFactory.getLog(ClusterMonitorTest.class);

//    @Test
    public void monitorCluster() {
        Cluster cluster = new ClusterBuilder()
            .addContactPoints("127.0.0.1")
//            .withCredentials("cassandra", "cassandra")
            .withCredentials("rhqadmin", "rhqadmin")
            .build();
View Full Code Here

        }
    }

    private Session createSession(String[] nodes, int cqlPort) throws NoHostAvailableException {
        try {
            Cluster cluster = new ClusterBuilder().addContactPoints(nodes).withPort(cqlPort)
                .withCredentials("rhqadmin", "rhqadmin")
                .build();
            PoolingOptions poolingOptions = cluster.getConfiguration().getPoolingOptions();
            poolingOptions.setCoreConnectionsPerHost(HostDistance.LOCAL, 24);
            poolingOptions.setCoreConnectionsPerHost(HostDistance.REMOTE, 24);
View Full Code Here

    public void initSession(String username, String password, int cqlPort, String... nodes) {
        if (session == null) {
            log.debug("Initializing session for [username: " + username + ", cqlPort: " + cqlPort + ", nodes: " +
                Arrays.toString(nodes) + "]");
            cluster = new ClusterBuilder().addContactPoints(nodes).withCredentialsObfuscated(username, password)
                .withPort(cqlPort).withCompression(ProtocolOptions.Compression.NONE).build();
            session = cluster.connect("system");
        }
    }
View Full Code Here

TOP

Related Classes of org.rhq.cassandra.util.ClusterBuilder

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.