Package com.datastax.driver.core

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


    @Override
    public InputStream getInputStream( BinaryKey key ) throws BinaryStoreException {
        try {
            ResultSet rs = session.execute("SELECT payload FROM modeshape.binary WHERE cid='" + key.toString() + "'");
            Row row = rs.one();
            if (row == null) {
                throw new BinaryStoreException(JcrI18n.unableToFindBinaryValue.text(key, session));
            }

            ByteBuffer buffer = row.getBytes("payload");
View Full Code Here


        .select(COLUMN_DATA)
        .from(settings.getKeyspaceName(), settings.getTableName())
        .where(QueryBuilder.eq(COLUMN_SESSION_ID, sessionId))
        .and(QueryBuilder.eq(COLUMN_PAGE_ID, pageId));
    ResultSet rows = session.execute(dataSelect);
    Row row = rows.one();
    byte[] bytes = null;
    if (row != null)
    {
      ByteBuffer data = row.getBytes(COLUMN_DATA);
      bytes = new byte[data.remaining()];
View Full Code Here

  @Override
  public String describePartitioner() throws ConnectionException {
    Statement q = QueryBuilder.select("partitioner").from("system", "local");
    ResultSet result = session.execute(q);
    com.datastax.driver.core.Row row = result.one();
    if (row == null) {
      throw new RuntimeException("Missing paritioner");
    }
    String pName = row.getString(0);
    return pName;
View Full Code Here

   
    List<HostInfo> hosts = new ArrayList<HostInfo>();

    Statement query = QueryBuilder.select().all().from("system", "local");
    ResultSet resultSet = session.execute(query);
    hosts.add(new HostInfo(resultSet.one(), resultSet));
   
    query = QueryBuilder.select("peer", "data_center", "host_id", "rack", "tokens").from("system", "peers");
    resultSet = session.execute(query);
    for (Row row : resultSet.all()) {
      hosts.add(new HostInfo(row, null));
View Full Code Here

   
      Map<String, List<String>> versions = new HashMap<String, List<String>>();

    ResultSet rs = session.execute(SELECT_SCHEMA_LOCAL);
   
        Row localRow = rs.one();
        if (localRow != null && !localRow.isNull("schema_version")) {
          UUID localSchemaVersion = localRow.getUUID("schema_version");
          InetAddress localServer = rs.getExecutionInfo().getQueriedHost().getAddress();
            addSchemaVersion(localSchemaVersion, localServer, versions);
        }
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.