/** * Reports the request that applies for the specified column, or null if no such request exists. * * <p> * If the column belongs to a map-type family and there is a request for the entire family, * the request for the entire family is reported. * </p> * * @param family The requested column family name. * @param qualifier The requested column qualifier name. * Null means no qualifier, ie. reports the request for the entire family. * @return the request that applies for the specified column or family, * or null if no such request exists. */ public Column getRequestForColumn(String family, String qualifier) { final Column column = getColumn(family, qualifier); if (column != null) { return column; } if (qualifier != null) { return getColumn(family, null); } return null; }
/** * Reports the request the applies for the specified column, or null if no such request exists. * * <p> * If the column belongs to a map-type family and there is a request for the entire family, * the request for the entire family is reported. * </p> * * @param columnName Requested column or family. * @return the request that applies for the specified column or family, * or null if no such request exists. */ public Column getRequestForColumn(final FijiColumnName columnName) { final Column column = getColumn(columnName); if (column != null) { return column; } if (columnName.isFullyQualified()) { return getColumn(columnName.getFamily(), null); } return null; }
mColumnRequest = mDataRequest.getColumn(family.getFamily(), null); if (!mColumnRequest.isPagingEnabled()) { throw new FijiColumnPagingNotEnabledException(
/** * Initializes a qualifier pager. * * @param entityId The entityId of the row. * @param dataRequest The requested data. * @param table The Fiji table that this row belongs to. * @param family Iterate through the qualifiers from this map-type family. * @throws FijiColumnPagingNotEnabledException If paging is not enabled for the specified family. */ public HBaseQualifierPager( EntityId entityId, FijiDataRequest dataRequest, HBaseFijiTable table, FijiColumnName family) throws FijiColumnPagingNotEnabledException { Preconditions.checkArgument(!family.isFullyQualified(), "Must use HBaseQualifierPager on a map-type family, but got '{}'.", family); mFamily = family; mDataRequest = dataRequest; mColumnRequest = mDataRequest.getColumn(family.getFamily(), null); if (!mColumnRequest.isPagingEnabled()) { throw new FijiColumnPagingNotEnabledException( String.format("Paging is not enabled for column [%s].", family)); } mEntityId = entityId; mTable = table; mHasNext = true; // there might be no page to read, but we don't know until we issue an RPC // Only retain the table if everything else ran fine: mTable.retain(); }
/** {@inheritDoc} */ @Override public FijiPager getPager(final String family) throws FijiColumnPagingNotEnabledException { final FijiColumnName column = FijiColumnName.create(family, null); Preconditions.checkState(mLayout.getFamilyMap().get(family).isMapType(), "getPager(String family) is only enabled on map type column families. " + "The column family '%s' is a group type column family. " + "Please use the getPager(String family, String qualifier) method.", family); final Column columnRequest = mResult.getDataRequest().getColumn(column); Preconditions.checkNotNull(columnRequest, "Requested column %s is not included in the data request %s.", column, mResult.getDataRequest()); if (!columnRequest.isPagingEnabled()) { throw new FijiColumnPagingNotEnabledException( String.format("Requested column %s does not have paging enabled in data request %s.", column, mResult.getDataRequest())); } return new FijiResultQualifierPager(mResult.narrowView(column), mLayout); }
Preconditions.checkArgument(colName.isFullyQualified()); Column columnRequest = dataRequest.getColumn(colName.getFamily(), colName.getQualifier()); if (columnRequest == null) { columnRequest = dataRequest.getColumn(colName.getFamily(), null); Preconditions.checkArgument(columnRequest != null, "Couldn't create pager: "