Package com.datastax.driver.core

Examples of com.datastax.driver.core.ResultSet


        }
        return storageMap;
    }

    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));
        }
    }
View Full Code Here


        for (Row row : rows) {
            dbHolder.add(row.getString(0));
        }
    }
    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

            currval.add(table);
            dbToTableMap.put(key, currval);
        }
    }
    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 String listRow(String db, String table, String keycol, String key) {
        // TODO Auto-generated method stub
        String query = select().all().from(db, table).where(eq(keycol, key))
                .getQueryString();
        ResultSet rs = session.execute(query);
        return convertResultSet(rs);
    }
View Full Code Here

        // TODO Auto-generated method stub
        return tableToStorageMap;
    }
    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

        return null;
    }

    public Map<String, JsonObject> runQuery(String key, String col) {
        // TODO Auto-generated method stub
        ResultSet rs;
        if (col!=null && !col.equals("*")) {
            rs = session
                .execute("select column1, value from "+MetaConstants.META_KEY_SPACE+"."+MetaConstants.META_COLUMN_FAMILY+ " where key='"+key+"' and column1='"+col+"';");
        }
        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

        }
        String query = select().all().from(db, table).where(eq(keycol, key))
                .getQueryString();
        Cluster cluster = Cluster.builder().addContactPoints("localhost").build();
        Session session = cluster.connect(db);
        ResultSet rs = session.execute(query);
        return convertResultSet(rs);
    }
View Full Code Here

        Long rowKey = (Long.valueOf(evTime)/periodicity)*periodicity;
        String query = select().all().from(db, table).where(eq("key", String.valueOf(rowKey))).and(eq("column1",Long.valueOf(evTime)))
                .getQueryString();
        Cluster cluster = Cluster.builder().addContactPoints("localhost").build();
        Session session = cluster.connect(db);
        ResultSet rs = session.execute(query);
        return convertResultSet(rs);
    }
View Full Code Here

            this.client = client;
        }

        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 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

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.