Package com.datastax.driver.core

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


                time = time.plus(duration);
            }
            nextResultSet = findIndexEntries();
        }
        if (time.isBefore(endTime)) {
            List<Row> rows = nextResultSet.all();
            rowCount = rows.size();
            rowIterator = rows.iterator();
        } else {
            rowCount = 0;
            rowIterator = Iterators.emptyIterator();
View Full Code Here


     * @return true if the RHQ user exists, false otherwise
     */
    protected boolean userExists() {
        try {
            ResultSet resultSet = execute("SELECT * FROM system_auth.users WHERE name = '" + username + "'");
            return !resultSet.all().isEmpty();
        } catch (Exception e) {
            log.error(e);
            throw new RuntimeException(e);
        }
    }
View Full Code Here

     * @return true if the RHQ schema exists, false otherwise
     */
    protected boolean schemaExists() {
        try {
            ResultSet resultSet = execute("SELECT * FROM system.schema_keyspaces WHERE keyspace_name = 'rhq'");
            if (!resultSet.all().isEmpty()) {
                resultSet = execute(
                    "SELECT * FROM system.schema_columnfamilies " +
                    "WHERE keyspace_name='rhq' AND columnfamily_name='schema_version'");
                return !resultSet.all().isEmpty();
            }
View Full Code Here

            ResultSet resultSet = execute("SELECT * FROM system.schema_keyspaces WHERE keyspace_name = 'rhq'");
            if (!resultSet.all().isEmpty()) {
                resultSet = execute(
                    "SELECT * FROM system.schema_columnfamilies " +
                    "WHERE keyspace_name='rhq' AND columnfamily_name='schema_version'");
                return !resultSet.all().isEmpty();
            }
            return false;
        } catch (AuthenticationException exp) {
            throw exp;
        } catch (Exception e) {
View Full Code Here

     */
    protected int getInstalledSchemaVersion() {
        int maxVersion = 0;
        try {
            ResultSet resultSet = execute("SELECT version FROM rhq.schema_version");
            for (Row row : resultSet.all()) {
                if (maxVersion < row.getInt(0)) {
                    maxVersion = row.getInt(0);
                }
            }
        } catch (Exception e) {
View Full Code Here

    cm.buildKeyspace(definition2, false);

    //Select from the newly created table
    ObjectMapper om = cm.getObjectMapper(definition2);
    ResultSet rs = om.getCqlExecutor().executeSync(CQLStatement.make("SELECT * FROM testtype3cb23c7ffc4256283064bd5eae1886b4", "testtype"));
    assertEquals(0, rs.all().size());

    cm.teardown();
  }

  @Test
View Full Code Here

    } else {
      String query = QueryFactory.BuildQuery(QueryType.SELECT,
          StorageType.CASSANDRA);
      ResultSet rs = session.execute(String.format(query, db + "."
          + table, keycol, key));
      if (rs != null && rs.all().size() > 0)
        return QueryUtils.formatQueryResult(rs);
      return "{\"msg\":\"Nothing is found\"}";
    }
  }
View Full Code Here

        LoadTableToStorage();
    }
    private void LoadTableToStorage() {
        ResultSet rs = session
                .execute("select column1, value from "+MetaConstants.META_KEY_SPACE+"."+MetaConstants.META_COLUMN_FAMILY+ " where key='"+MetaConstants.STAASH_TABLE_ENTITY_TYPE+"';");
        List<Row> rows = rs.all();
        for (Row row : rows) {
            String field = row.getString(0);
            JsonObject val = new JsonObject(row.getString(1));
            String storage = val.getField("storage");
            tableToStorageMap.put(field, storage);
View Full Code Here

        }
    }
    public  Map<String,JsonObject> LoadStorage() {
        ResultSet rs = session
                .execute("select column1, value from "+MetaConstants.META_KEY_SPACE+"."+MetaConstants.META_COLUMN_FAMILY+ " where key='"+MetaConstants.STAASH_STORAGE_TYPE_ENTITY+"';");
        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));
            jsonStorage.putObject(field, val);
View Full Code Here

    }

    private void LoadDbNames() {
        ResultSet rs = session
                .execute("select column1 from "+MetaConstants.META_KEY_SPACE+"."+MetaConstants.META_COLUMN_FAMILY+ " where key='com.test.entity.type.paas.db';");
        List<Row> rows = rs.all();
        for (Row row : rows) {
            dbHolder.add(row.getString(0));
        }
    }
    private void LoadDbToTableMap() {
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.