private Map<Sha256Hash, Integer> getColumnCountsUnordered(TableReference tableRef, List<byte[]> rowList, ColumnRangeSelection columnRangeSelection, long timestamp) { return runRead(tableRef, dbReadTable -> { Map<Sha256Hash, Integer> counts = new HashMap<>(rowList.size()); try (ClosableIterator<AgnosticLightResultRow> iter = dbReadTable.getRowsColumnRangeCounts(rowList, timestamp, columnRangeSelection)) { while (iter.hasNext()) { AgnosticLightResultRow row = iter.next(); Sha256Hash rowHash = Sha256Hash.computeHash(row.getBytes(ROW)); counts.put(rowHash, row.getInteger("column_count")); } } return counts; }); }
private List<CellTsPairInfo> loadPage(boolean singleRow) { FullQuery query = getQuery(singleRow); try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool); AgnosticLightResultSet resultSet = executeQuery(conns.get(), query)) { List<CellTsPairInfo> ret = new ArrayList<>(); for (AgnosticLightResultRow row : resultSet) { ret.add(new CellTsPairInfo( row.getBytes("row_name"), row.getBytes("col_name"), row.getLong("ts"), request.shouldCheckIfLatestValueIsEmpty() && row.getInteger("empty_val") == 1)); } return ret; } }
private Map<Sha256Hash, Integer> getColumnCountsUnordered(TableReference tableRef, List<byte[]> rowList, ColumnRangeSelection columnRangeSelection, long timestamp) { return runRead(tableRef, dbReadTable -> { Map<Sha256Hash, Integer> counts = new HashMap<>(rowList.size()); try (ClosableIterator<AgnosticLightResultRow> iter = dbReadTable.getRowsColumnRangeCounts(rowList, timestamp, columnRangeSelection)) { while (iter.hasNext()) { AgnosticLightResultRow row = iter.next(); Sha256Hash rowHash = Sha256Hash.computeHash(row.getBytes(ROW)); counts.put(rowHash, row.getInteger("column_count")); } } return counts; }); }
private List<CellTsPairInfo> loadPage(boolean singleRow) { FullQuery query = getQuery(singleRow); try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool); AgnosticLightResultSet resultSet = executeQuery(conns.get(), query)) { List<CellTsPairInfo> ret = new ArrayList<>(); for (AgnosticLightResultRow row : resultSet) { ret.add(new CellTsPairInfo( row.getBytes("row_name"), row.getBytes("col_name"), row.getLong("ts"), request.shouldCheckIfLatestValueIsEmpty() && row.getInteger("empty_val") == 1)); } return ret; } }