/** * Initializes a new iterator over the qualifiers from a map-type family. * * <p> * The qualifier iterator wraps a map-type family pager. * The size of the qualifier page determines how many qualifiers to retrieve per RPC. * Smaller values will reduce the memory footprint but increase the number of RPCs. * The size of a qualifier can be estimated or bounded as the size of a KeyValue with no value. * </p> * * @param row Fiji row data with paging enabled on the specified map-type family. * @param family Map-type family name. * @param pageSize Size of the underlying qualifier pages. * @throws IOException on I/O error. */ public MapFamilyQualifierIterator(FijiRowData row, String family, int pageSize) throws IOException { this.mRow = row; this.mFamily = family; this.mPageSize = pageSize; this.mQualifierPager = this.mRow.getPager(family); this.mNext = getNext(); }
/** * Initializes a new iterator over the versions in a fully-qualified column. * * <p> * The version iterator wraps a column pager. * The size of the version page determines how many cells/versions to retrieve per RPC. * Smaller values will reduce the memory footprint but increase the number of RPCs. * To properly configure the version page size, the user must estimate or bound the expected * size of the cells being retrieved (ie. the size of the KeyValue objects). * </p> * * @param row Fiji row data with paging enabled on the specified map-type family. * @param family Family name containing the column to iterate through. * @param qualifier Qualifier of the column to iterate through. * @param pageSize Size of the underlying pages of versions. * @throws IOException on I/O error. */ public ColumnVersionIterator(FijiRowData row, String family, String qualifier, int pageSize) throws IOException { this.mRow = row; this.mFamily = family; this.mQualifier = qualifier; this.mPageSize = pageSize; this.mVersionPager = this.mRow.getPager(this.mFamily, this.mQualifier); this.mNext = getNext(); }
/** * Initializes the list of associated column family FijiPagers for this FijiRowData. * * @param fijiDataRequest the data request for this FijiRowData. * @return map of families to their associated qualifier pagers. */ private Map<String, FijiPager> getFijiQualifierPagers(FijiDataRequest fijiDataRequest) { Map<String, FijiPager> fijiQualifierPagers = Maps.newHashMap(); for (FijiDataRequest.Column column : fijiDataRequest.getColumns()) { if (column.isPagingEnabled() && !column.getColumnName().isFullyQualified()) { // Only include pagers for column families. try { LOG.info("Paging enabled for column family: {}", column.getColumnName()); FijiPager fijiPager = mRowData.getPager(column.getFamily()); fijiQualifierPagers.put(column.getFamily(), fijiPager); } catch (FijiColumnPagingNotEnabledException e) { LOG.warn("Paging not enabled for column family: {}", column.getColumnName()); } } } return fijiQualifierPagers; }
/** * Initializes the list of associated fully qualified cell FijiPagers for this FijiRowData. Any * non fully qualified cell paging configuration will be ignored. * * @param fijiDataRequest the data request for this FijiRowData. * @param fijiRowData the fijiRowData to generate the pagers from. * @return map of FijiColumnNames to their associated cell pagers. */ private static Map<FijiColumnName, FijiPager> getFijiCellPagers(FijiDataRequest fijiDataRequest, FijiRowData fijiRowData) { Map<FijiColumnName, FijiPager> fijiCellPagers = Maps.newHashMap(); for (FijiDataRequest.Column column : fijiDataRequest.getColumns()) { if (column.isPagingEnabled() && column.getColumnName().isFullyQualified()) { // Only include pagers for fully qualified cells try { LOG.info("Paging enabled for column: {}", column.getColumnName()); FijiPager fijiPager = fijiRowData.getPager(column.getFamily(), column.getQualifier()); fijiCellPagers.put(column.getColumnName(), fijiPager); } catch (FijiColumnPagingNotEnabledException e) { LOG.warn("Paging not enabled for column: {}", column.getColumnName()); } } } return fijiCellPagers; }