private List<CellTsPairInfo> loadNextPage() { try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool); AgnosticLightResultSet resultSet = selectNextPage(conns)) { List<CellTsPairInfo> ret = new ArrayList<>(); for (AgnosticLightResultRow row : resultSet) { byte[] rowName = row.getBytes("row_name"); byte[] colName = row.getBytes("col_name"); if (request.shouldCheckIfLatestValueIsEmpty()) { long[] sortedTimestamps = castAndSortTimestamps((Object[]) row.getArray("timestamps")); boolean isLatestValEmpty = row.getBoolean("latest_val_empty"); for (int i = 0; i < sortedTimestamps.length - 1; ++i) { ret.add(new CellTsPairInfo(rowName, colName, sortedTimestamps[i], false)); } // For the maximum timestamp, we know whether its value is empty or not, // so we handle it separately ret.add(new CellTsPairInfo( rowName, colName, sortedTimestamps[sortedTimestamps.length - 1], isLatestValEmpty)); } else { long ts = row.getLong("ts"); ret.add(new CellTsPairInfo(rowName, colName, ts, false)); } } return ret; } }
private List<CellTsPairInfo> loadNextPage() { try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool); AgnosticLightResultSet resultSet = selectNextPage(conns)) { List<CellTsPairInfo> ret = new ArrayList<>(); for (AgnosticLightResultRow row : resultSet) { byte[] rowName = row.getBytes("row_name"); byte[] colName = row.getBytes("col_name"); if (request.shouldCheckIfLatestValueIsEmpty()) { long[] sortedTimestamps = castAndSortTimestamps((Object[]) row.getArray("timestamps")); boolean isLatestValEmpty = row.getBoolean("latest_val_empty"); for (int i = 0; i < sortedTimestamps.length - 1; ++i) { ret.add(new CellTsPairInfo(rowName, colName, sortedTimestamps[i], false)); } // For the maximum timestamp, we know whether its value is empty or not, // so we handle it separately ret.add(new CellTsPairInfo( rowName, colName, sortedTimestamps[sortedTimestamps.length - 1], isLatestValEmpty)); } else { long ts = row.getLong("ts"); ret.add(new CellTsPairInfo(rowName, colName, ts, false)); } } return ret; } }