Пример #1
0
  @Override
  public ReadResult read() {
    AbstractCursor<Column> cursor = getCursorWithResults();
    if (cursor == null) return new ReadResult(); // no more data to read

    return translate(cursor.getCurrent());
  }
Пример #2
0
  protected AbstractCursor<Column> getCursorWithResults() {
    if (cursor != null && cursor.next()) {
      return cursor;
    } else if (currentIndex >= existingPartitions.size()) return null;

    int count = 0;
    do {
      Long currentPartId = existingPartitions.get(currentIndex);
      NoSqlTypedSession em = mgr.getTypedSession();
      NoSqlSession raw = em.getRawSession();

      byte[] rowKeyPostFix =
          meta.getIdColumnMeta().convertToStorage2(new BigInteger("" + currentPartId));
      byte[] rowKey = meta.getIdColumnMeta().formVirtRowKey(rowKeyPostFix);
      cursor = raw.columnSlice(meta, rowKey, startBytes, endBytes, 500, BigInteger.class);
      currentIndex++;
      if (cursor.next()) return cursor;
      count++;

    } while (!hasReachedEnd(end));

    // reached end and no data found
    return null;
  }