/** * Configures paging and sets the page size (i.e. the maximum number of cells per page). * * <p> * The page size is an upper limit to the number of cells retrieved from the region servers * at a time, to bound the amount of memory consumed on the client machine. * See {@link FijiPager} for more details. * </p> * <p> Defaults to zero, which means paging is disabled. </p> * * @param pageSize The maximum number of cells to return in each page of results. * Use 0 to disable paging and return all results at once. * @return This column request instance. */ public ColumnsDef withPageSize(int pageSize) { checkNoCols(); Preconditions.checkState(mPageSize == null, "Cannot set page size to %s, page size already set to %s.", pageSize, mPageSize); Preconditions.checkArgument(pageSize >= 0, "Page size must be 0 (disabled) or positive, but got: %s", mPageSize); mPageSize = pageSize; return this; }
/** * Sets a filter to attach to each column specified by this column request builder. * * @param filter The column filter; * @return This column request builder instance. */ public ColumnsDef withFilter(FijiColumnFilter filter) { checkNoCols(); Preconditions.checkState(!mFilterInitialized, "Cannot set filter multiple times"); mFilter = filter; mFilterInitialized = true; return this; }
/** * Sets the maximum number of the most recent versions of a particular column to return. * * <p> For a map type column family, the maximum number of versions applies to each qualifier * individually. In particular, the maximum number of versions does not limit the total * number of qualifiers or of versions returned for the entire family. * </p> * * <p> Note: the maximum number of versions is currently not working properly when using * a {@link FijiPager} to page through a map-type family. * In particular, when the maximum number of versions is greater than the page size, * the total number of cells returned for a qualifier may exceed the configured maximum. * Please see <a href="https://jira.fiji.org/browse/SCHEMA-282">SCHEMA-282</a> for more * details. * </p> * * @param maxVersions The maximum number of versions per column qualifier to return. * @return This column request builder instance. */ public ColumnsDef withMaxVersions(int maxVersions) { checkNoCols(); Preconditions.checkState(mMaxVersions == null, "Cannot set max versions to %s, max versions already set to %s.", maxVersions, mMaxVersions); Preconditions.checkArgument(maxVersions > 0, "Maximum number of versions must be strictly positive, but got: %s", maxVersions); mMaxVersions = maxVersions; return this; }