Package com.datastax.driver.core

Examples of com.datastax.driver.core.ResultSet


        }
    }

    private void assertTablesDropped(String... tables) {
        Set<String> existingTables = new HashSet<String>();
        ResultSet resultSet = session.execute("SELECT columnfamily_name FROM system.schema_columnfamilies " +
            "WHERE keyspace_name = 'rhq'");
        for (Row row : resultSet) {
            existingTables.add(row.getString(0));
        }
        for (String table : tables) {
View Full Code Here


        log.info("Searching for most recent hour having raw data");

        DateTime previousHour = current1HourTimeSlice();
        DateTime oldestRawTime = previousHour.minus(Days.days(7));

        ResultSet resultSet = getIndexTimeSlice(Bucket.ONE_HOUR, previousHour);
        Row row = resultSet.one();
        while (row == null && previousHour.compareTo(oldestRawTime) > 0) {
            previousHour = previousHour.minusHours(1);
            resultSet = getIndexTimeSlice(Bucket.ONE_HOUR, previousHour);
            row = resultSet.one();
        }

        if (row == null) {
            log.info("No data found in metrics_index table");
            return null;
View Full Code Here

        private Map<String, ByteBuffer> previousRowKey = new HashMap<String, ByteBuffer>(); // previous CF row key

        public RowIterator()
        {
            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(quote(keyspace)).getTable(quote(cfName)).getPartitionKey())
                partitionBoundColumns.put(meta.getName(), Boolean.TRUE);
            rows = rs.iterator();
        }
View Full Code Here

   */
  @Override
  public Set<EventBean> lookup(Object[] keys, EventBean[] eventsPerStream) {
    final BoundStatement boundStatement = _statement.bind(keys);

    final ResultSet cassandraResultList = _session.execute(boundStatement);

    final Set<EventBean> esperResultSet = new HashSet<EventBean>();
    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 Map<Object, Object> resultData = new HashMap<Object, Object>();
      final Row cassandraRow = it.next();
View Full Code Here

        results.add(result);
      }

    }
   
    ResultSet resultSet = null;

        if (keysToLookup.size() > 0) {
            //String[] keyStrings = new String[keysToLookup.size()];
            ByteBuffer[] keyStrings = new ByteBuffer[keysToLookup.size()];
            int count = 0;
View Full Code Here

      if (result == null)
        keysToLookup.add(0, previousKey);

      results.add(result);
    }
        ResultSet resultSet = null;

        if (keysToLookup.size() > 0) {
            //String[] keyStrings = new String[keysToLookup.size()];
            ByteBuffer[] keyStrings = new ByteBuffer[keysToLookup.size()];
            int count = 0;
View Full Code Here

    private void loadCache(boolean reverse) {
        if (cachedRows != null && cachedRows.hasNext())
            return; // There are more rows so return and the code will return
                    // the next result from cache

        ResultSet resultSet = null;

        if (needToGetBatch) {
            if (batchListener != null)
                batchListener.beforeFetchingNextBatch();
View Full Code Here

        if (batchListener != null)
            batchListener.beforeFetchingNextBatch();

        columnNameType = sliceInfo.getColumnNameType();
        ResultSet resultSet = null;
        Clause rkClause = QueryBuilder.eq("id", ByteBuffer.wrap(rowKey));
        Query query = null;
        query = QueryBuilder.select().all().from(keys, table).where(rkClause).disableTracing();

        subList = new ArrayList<com.datastax.driver.core.Row>();
View Full Code Here

    private void checkIfRowExsits(String table, byte[] rowKey, String colName) {
        Clause rkClause = QueryBuilder.eq("id", ByteBuffer.wrap(rowKey));
        Clause cnClause = QueryBuilder.eq("colname", colName);
        try {
            Query query = QueryBuilder.select().all().from(keys, table).where(rkClause).and(cnClause);
            ResultSet resultSet = session.execute(query);
            if (resultSet.isExhausted())
                return;
            else {
                Query delQuery = QueryBuilder.delete().from(keys, table).where(rkClause).and(cnClause);
                session.execute(delQuery);
            }
View Full Code Here

        }
        selectWhere.and(indClause);
        Clause keyClause = QueryBuilder.eq("colvalue", ByteBuffer.wrap(key));
        selectWhere.and(keyClause);
        Query query = selectWhere.limit(1);
        ResultSet resultSet = session.execute(query);
        return !resultSet.isExhausted();
   }
View Full Code Here

TOP

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

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.