Package com.datastax.driver.core

Examples of com.datastax.driver.core.ResultSet$FetchingState


    ResultSetFuture results;
    synchronized (_session) {
      results = _session.executeAsync(selectAllQuery);
    }
    try {
      final ResultSet cassandraResultList = results.get();
      return new EsperResultSetIterator(cassandraResultList,
          _context.getEventFactory());
    } catch (InterruptedException e) {
      _log.warn(
          "Query execution was interrupted, returning empty iterator.",
View Full Code Here


      // }

      final BoundStatement boundStatement = _statement.bind(Arrays
          .copyOfRange(keys, 0, _statement.getVariables().size()));

      final ResultSet cassandraResultList = _session
          .execute(boundStatement);

      final CassandraRowVisitor rowVisitor = new CassandraRowVisitor(
          cassandraResultList.getColumnDefinitions());

      final Iterator<Row> it = cassandraResultList.iterator();
      // Iterate over all results and create fresh EventBean for all
      // data results from the database query.
      while (it.hasNext()) {
        final Row cassandraRow = it.next();
        esperResultSet.add(_eventFactory.wrap(rowVisitor
View Full Code Here

        {
            if (session == null)
                throw new RuntimeException("Can't create connection session");

            AbstractType type = partitioner.getTokenValidator();
            ResultSet rs = session.execute(cqlQuery, type.compose(type.fromString(split.getStartToken())), type.compose(type.fromString(split.getEndToken())) );
            for (ColumnMetadata meta : cluster.getMetadata().getKeyspace(keyspace).getTable(cfName).getPartitionKey())
                partitionBoundColumns.put(meta.getName(), Boolean.TRUE);
            rows = rs.iterator();
        }
View Full Code Here

    // ResultSet results =
    // session.execute("SELECT * FROM simplex.playlists; ");
    // for (Row row : results)
    // System.out.println(row.toString());

    ResultSet results = session.execute("SELECT * FROM yelp.business; ");
    for (Row row : results) {
      System.out.println(row.toString());
      System.out.println(String.format("%-30s\t%-20s\t%-20s",
          row.getString("business_id"),
          row.getString("full_address"), row.getString("city")));
View Full Code Here

        .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);

    result = session.execute("select * from testCQLTable2 WHERE id=1690e8da-5bf8-49e8-9583-4dff8a570727");
    val = result.iterator().next().getString("value");
    assertEquals("2- Cql loaded string", val);
  }
View Full Code Here

  public void should_work_twice() {
    test();
  }

  private void test() {
    ResultSet result = dummyCassandraConnector.getSession().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

    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

    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

    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

    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

TOP

Related Classes of com.datastax.driver.core.ResultSet$FetchingState

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.