Package com.datastax.driver.core

Examples of com.datastax.driver.core.Row


      final Set<EventBean> esperResultSet = new HashSet<EventBean>();
      final Iterator<Row> it = cassandraResultList.iterator();
      while (it.hasNext()) {
        final Map<String, Object> eventData = new HashMap<String, Object>();
        final Row cassandraRow = it.next();

        // TODO: extract values from row into event bean.

        final EventBean event = _context.getEventFactory().wrap(
            eventData);
View Full Code Here


     * in the result set).
     *
     * @return the next result in this mapped result set or null if it is exhausted.
     */
    public T one() {
        Row row = rs.one();
        return row == null ? null : map(row);
    }
View Full Code Here

        protected Pair<Long, Row> computeNext()
        {
            if (rows == null || !rows.hasNext())
                return endOfData();

            Row row = rows.next();
            Map<String, ByteBuffer> keyColumns = new HashMap<String, ByteBuffer>();
            for (String column : partitionBoundColumns.keySet())
                keyColumns.put(column, row.getBytesUnsafe(column));

            // increase total CF row read
            if (previousRowKey.isEmpty() && !keyColumns.isEmpty())
            {
                previousRowKey = keyColumns;
View Full Code Here

        protected Pair<Long, Row> computeNext()
        {
            if (rows == null || !rows.hasNext())
                return endOfData();

            Row row = rows.next();
            Map<String, ByteBuffer> keyColumns = new HashMap<String, ByteBuffer>();
            for (String column : partitionBoundColumns.keySet())
                keyColumns.put(column, row.getBytesUnsafe(column));

            // increase total CF row read
            if (previousRowKey.isEmpty() && !keyColumns.isEmpty())
            {
                previousRowKey = keyColumns;
View Full Code Here

        protected Pair<Long, Row> computeNext()
        {
            if (rows == null || !rows.hasNext())
                return endOfData();

            Row row = rows.next();
            Map<String, ByteBuffer> keyColumns = new HashMap<String, ByteBuffer>();
            for (String column : partitionBoundColumns.keySet())
                keyColumns.put(column, row.getBytesUnsafe(column));

            // increase total CF row read
            if (previousRowKey.isEmpty() && !keyColumns.isEmpty())
            {
                previousRowKey = keyColumns;
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()];
      data.get(bytes);

      LOGGER.debug("Got data for session '{}' and page id '{}'", sessionId, pageId);
    }
View Full Code Here

     * in the result set).
     *
     * @return the next result in this mapped result set or null if it is exhausted.
     */
    public T one() {
        Row row = rs.one();
        return row == null ? null : map(row);
    }
View Full Code Here

    }

    List<T> result = new ArrayList<T>();
    Iterator<Row> iterator = resultSet.iterator();
    while (iterator.hasNext()) {
      Row row = iterator.next();
      result.add(readRowCallback.doWith(row));
    }

    return result;
  }
View Full Code Here

    }

    List<T> result = new ArrayList<T>();
    Iterator<Row> iterator = resultSet.iterator();
    while (iterator.hasNext()) {
      Row row = iterator.next();
      result.add(readRowCallback.doWith(row));
    }

    return result;
  }
View Full Code Here

    ResultSet resultSet = query(query);

    Iterator<Row> iterator = resultSet.iterator();
    if (iterator.hasNext()) {
      Row row = iterator.next();
      T result = readRowCallback.doWith(row);
      if (iterator.hasNext()) {
        throw new DuplicateKeyException("found two or more results in query " + query);
      }
      return result;
View Full Code Here

TOP

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

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.