Package com.datastax.driver.core

Examples of com.datastax.driver.core.Cluster$Manager$ClusterCloseFuture


  public void should_work_twice() {
    test();
  }

  private void test() {
    Cluster cluster = Cluster.builder()
        .addContactPoints("127.0.0.1")
        .withPort(9142)
        .build();
    Session session = cluster.connect("myownkeyspace");
    ResultSet result = session.execute("select * from testCQLTableKS WHERE id=1690e8da-5bf8-49e8-9583-4dff8a570787");
    String val = result.iterator().next().getString("value");
    assertEquals("KS- Cql loaded string", val);
  }
View Full Code Here


  public void should_work_twice() {
    test();
  }

  private void test() {
    Cluster cluster = Cluster.builder()
        .addContactPoints("127.0.0.1")
        .withPort(9142)
        .build();
    Session session = cluster.connect("cassandra_unit_keyspace");
    ResultSet result = session.execute("select * from testCQLTableRootLocation WHERE id=1690e8da-5bf8-49e8-9583-4dff8a570797");
    String val = result.iterator().next().getString("value");
    assertEquals("Root- Cql loaded string", val);
  }
View Full Code Here

  public void should_work_twice() {
    test();
  }

  private void test() {
    Cluster cluster = Cluster.builder()
        .addContactPoints("127.0.0.1")
        .withPort(9142)
        .build();
    Session session = cluster.connect("cassandra_unit_keyspace");
    ResultSet result = session.execute("select * from testCQLTable WHERE id=1690e8da-5bf8-49e8-9583-4dff8a570737");
    String val = result.iterator().next().getString("value");
    assertEquals("Cql loaded string", val);
  }
View Full Code Here

  public void should_work_twice() {
    test();
  }

  private void test() {
    Cluster cluster = Cluster.builder()
        .addContactPoints("127.0.0.1")
        .withPort(9142)
        .build();
    Session session = cluster.connect("cassandra_unit_keyspace");
    ResultSet result = session.execute("select * from testCQLTable1 WHERE id=1690e8da-5bf8-49e8-9583-4dff8a570717");
    String val = result.iterator().next().getString("value");
    assertEquals("1- Cql loaded string", val);
  }
View Full Code Here

  public void should_work_twice() {
    test();
  }

  private void test() {
    Cluster cluster = Cluster.builder()
        .addContactPoints("127.0.0.1")
            .withPort(9142)
        .build();
    Session session = cluster.connect("cassandra_unit_keyspace");
    ResultSet result = session.execute("select * from testCQLTable WHERE id=1690e8da-5bf8-49e8-9583-4dff8a570737");
    String val = result.iterator().next().getString("value");
    assertEquals("Cql loaded string", val);
  }
View Full Code Here

      switch (cassandraDataSet.type()) {
        case cql:
          dataset = dataSetLocations(testContext, cassandraDataSet);
          datasetIterator = dataset.listIterator();

          Cluster cluster = new Cluster.Builder().addContactPoints(host).withPort(port).build();
          Session session = cluster.connect();
         
          CQLDataLoader cqlDataLoader = new CQLDataLoader(session);
          while (datasetIterator.hasNext()) {
            String next = datasetIterator.next();
            boolean dropAndCreateKeyspace = datasetIterator.previousIndex() == 0;
View Full Code Here

        DataLoader dataLoader = new DataLoader("clusterToLoad", host + ":" + port);
        dataLoader.load(new FileDataSet(file), loadingOption);
    }

    private static void cqlDataSetLoad(String host, String port, String file) {
        Cluster cluster = new Cluster.Builder().addContactPoints(host).withPort(Integer.parseInt(port)).build();
        Session session = cluster.connect();
        CQLDataLoader dataLoader = new CQLDataLoader(session);
        dataLoader.load(new FileCQLDataSet(file, false));
    }
View Full Code Here

  public void testBuildCluster() throws Exception {
    logger.debug("testBuildCluster");
    //Get a connection manager based on the test properties
    ConnectionManager connectionManager = TestHelpers.getTestConnectionManager();
    connectionManager.setLogCql(true);
    Cluster cassCluster = connectionManager.buildCluster(true);
    assertNotNull(connectionManager);

    assertEquals(1,cassCluster.getMetadata().getAllHosts().size());
    assertEquals(cassCluster.getMetadata().getClusterName(), "Test Cluster");

    connectionManager.teardown();
  }
View Full Code Here

    }
    @Provides
    @Named("metacluster")
    Cluster provideCluster(@Named("paas.cassclient") String clientType,@Named("paas.metacluster") String clustername) {
        if (clientType.equals("cql")) {
        Cluster cluster = Cluster.builder().addContactPoint(clustername).build();
        return cluster;
        } else return null;
    }
View Full Code Here

        return keyspace;
    }
    @Provides
    @Named("datacluster")
    Cluster provideDataCluster(@Named("paas.datacluster") String clustername) {       
        Cluster cluster = Cluster.builder().addContactPoint(clustername).build();
        return cluster;
    }   
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.Cluster$Manager$ClusterCloseFuture

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.