Package com.datastax.driver.core

Examples of com.datastax.driver.core.ResultSet.all()


        }
    }
    private void LoadDbToTableMap() {
        ResultSet rs = session
                .execute("select column1 from "+MetaConstants.META_KEY_SPACE+"."+MetaConstants.META_COLUMN_FAMILY+ " where key='com.test.entity.type.paas.table';");
        List<Row> rows = rs.all();
        for (Row row : rows) {
            String key = row.getString(0).split("\\.")[0];
            String table = row.getString(0).split("\\.")[1];
            List<String> currval = null;
            currval = dbToTableMap.get(key);
View Full Code Here


        }
    }
    private void LoadDbToTimeSeriesMap() {
        ResultSet rs = session
                .execute("select column1 from "+MetaConstants.META_KEY_SPACE+"."+MetaConstants.META_COLUMN_FAMILY+ " where key='com.test.entity.type.paas.timeseries';");
        List<Row> rows = rs.all();
        for (Row row : rows) {
            String key = row.getString(0).split("\\.")[0];
            String table = row.getString(0).split("\\.")[1];
            List<String> currval = null;
            currval = dbToTimeseriesMap.get(key);
View Full Code Here

    }
    public Map<String, JsonObject> runQuery(String key, String col) {
        // TODO Auto-generated method stub
        ResultSet rs = session
                .execute("select column1, value from "+MetaConstants.META_KEY_SPACE+"."+MetaConstants.META_COLUMN_FAMILY+ " where key='"+key+"' and column1='"+col+"';");
        List<Row> rows = rs.all();
        Map<String,JsonObject> storageMap = new HashMap<String,JsonObject>();
        for (Row row : rows) {
            String field = row.getString(0);
            JsonObject val = new JsonObject(row.getString(1));
            storageMap.put(field, val);
View Full Code Here

        }
        else {
            rs = session
                    .execute("select column1, value from "+MetaConstants.META_KEY_SPACE+"."+MetaConstants.META_COLUMN_FAMILY+ " where key='"+key+"';");
        }
        List<Row> rows = rs.all();
        Map<String,JsonObject> storageMap = new HashMap<String,JsonObject>();
        for (Row row : rows) {
            String field = row.getString(0);
            JsonObject val = new JsonObject(row.getString(1));
            storageMap.put(field, val);
View Full Code Here

        public boolean run() throws Exception
        {
            ResultSet rs = client.getSession().execute(bindArgs(partitions.get(0)));
            validate(rs);
            rowCount = rs.all().size();
            partitionCount = Math.min(1, rowCount);
            return true;
        }
    }
View Full Code Here

   */
  private long readSchemaIdCounter() {
    // Sanity check that counter value is 1!
    String queryText = String.format("SELECT * FROM %s;", mCounterTable);
    ResultSet resultSet = mAdmin.execute(queryText);
    List<Row> rows = resultSet.all();
    assert(rows.size() == 1);
    Row row = rows.get(0);
    return row.getLong(SCHEMA_COUNTER_COLUMN_VALUE);
  }

View Full Code Here

        tableName,
        SCHEMA_COLUMN_ID_KEY,
        schemaId,
        SCHEMA_COLUMN_TIME);
    final ResultSet resultSet = mAdmin.execute(queryText);
    final List<Row> rows = resultSet.all();

    if (0 == rows.size()) {
      return null;
    }
View Full Code Here

   */
  private SchemaTableEntry loadFromHashTable(BytesKey schemaHash) throws IOException {
    final ByteBuffer tableKey = ByteBuffer.wrap(schemaHash.getBytes());
    final ResultSet resultSet = mAdmin.execute(mPreparedStatementReadHashTable.bind(tableKey));

    final List<Row> rows = resultSet.all();

    if (0 == rows.size()) {
      return null;
    }

View Full Code Here

    // TODO: check if below is necessary, or leftover
    // Sanity check that counter value is 1!
    final String selectQuery = String.format("SELECT * FROM %s;", tableName);
    final ResultSet resultSet = admin.execute(selectQuery);
    final List<Row> rows = resultSet.all();
    assert(rows.size() == 1);
    final Row row = rows.get(0);
    final long counterValue = row.getLong(SCHEMA_COUNTER_COLUMN_VALUE);
    assert(0 == counterValue);
  }
View Full Code Here

    // Just return a set of in-use tables
    ResultSet resultSet = mAdmin.execute(mListTablesStatement.bind());
    Set<String> keys = new HashSet<String>();

    // This code makes me miss Scala
    for (Row row: resultSet.all()) {
      keys.add(row.getString(QUALIFIER_TABLE));
    }

    List<String> list = new ArrayList<String>();
    list.addAll(keys);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.