/** * @param o the other filter to compare with * @return true if and only if the fields of the filter that are serialized * are equal to the corresponding fields in other. Used for testing. */ @Override boolean areSerializedFieldsEqual(Filter o) { if (o == this) return true; if (!(o instanceof ColumnPaginationFilter)) return false; ColumnPaginationFilter other = (ColumnPaginationFilter)o; if (this.columnOffset != null) { return this.getLimit() == other.getLimit() && Bytes.equals(this.getColumnOffset(), other.getColumnOffset()); } return this.getLimit() == other.getLimit() && this.getOffset() == other.getOffset(); }
/** * @param o the other filter to compare with * @return true if and only if the fields of the filter that are serialized * are equal to the corresponding fields in other. Used for testing. */ @Override boolean areSerializedFieldsEqual(Filter o) { if (o == this) return true; if (!(o instanceof ColumnPaginationFilter)) return false; ColumnPaginationFilter other = (ColumnPaginationFilter)o; if (this.columnOffset != null) { return this.getLimit() == other.getLimit() && Bytes.equals(this.getColumnOffset(), other.getColumnOffset()); } return this.getLimit() == other.getLimit() && this.getOffset() == other.getOffset(); }
/** {@inheritDoc} */ @Override public FilterSupportStatus isFilterSupported( FilterAdapterContext context, ColumnPaginationFilter filter) { // We require a single column family to be specified: int familyCount = context.getScan().numFamilies(); if (filter.getColumnOffset() != null && familyCount != 1) { return UNSUPPORTED_STATUS; } return FilterSupportStatus.SUPPORTED; } }
/** {@inheritDoc} */ @Override public FilterSupportStatus isFilterSupported( FilterAdapterContext context, ColumnPaginationFilter filter) { // We require a single column family to be specified: int familyCount = context.getScan().numFamilies(); if (filter.getColumnOffset() != null && familyCount != 1) { return UNSUPPORTED_STATUS; } return FilterSupportStatus.SUPPORTED; } }
/** * @param other * @return true if and only if the fields of the filter that are serialized * are equal to the corresponding fields in other. Used for testing. */ boolean areSerializedFieldsEqual(Filter o) { if (o == this) return true; if (!(o instanceof ColumnPaginationFilter)) return false; ColumnPaginationFilter other = (ColumnPaginationFilter)o; if (this.columnOffset != null) { return this.getLimit() == this.getLimit() && Bytes.equals(this.getColumnOffset(), other.getColumnOffset()); } return this.getLimit() == other.getLimit() && this.getOffset() == other.getOffset(); }
/** * @param o the other filter to compare with * @return true if and only if the fields of the filter that are serialized * are equal to the corresponding fields in other. Used for testing. */ @Override boolean areSerializedFieldsEqual(Filter o) { if (o == this) return true; if (!(o instanceof ColumnPaginationFilter)) return false; ColumnPaginationFilter other = (ColumnPaginationFilter)o; if (this.columnOffset != null) { return this.getLimit() == other.getLimit() && Bytes.equals(this.getColumnOffset(), other.getColumnOffset()); } return this.getLimit() == other.getLimit() && this.getOffset() == other.getOffset(); }
/** {@inheritDoc} */ @Override public Filter adapt(FilterAdapterContext context, ColumnPaginationFilter filter) throws IOException { //REVISIT: if (filter.getColumnOffset() != null) { byte[] family = context.getScan().getFamilies()[0]; ByteString startQualifier = ByteString.copyFrom(filter.getColumnOffset()); // Include all cells starting at the qualifier scan.getColumnOffset() // up to limit cells. return createChain( filter, FILTERS.qualifier().rangeWithinFamily(Bytes.toString(family)) .startClosed(startQualifier)); } else if (filter.getOffset() > 0) { // Include starting at an integer offset up to limit cells. return createChain( filter, FILTERS.offset().cellsPerRow(filter.getOffset())); } else { // No meaningful offset supplied. return createChain(filter, null); } }
/** {@inheritDoc} */ @Override public Filter adapt(FilterAdapterContext context, ColumnPaginationFilter filter) throws IOException { //REVISIT: if (filter.getColumnOffset() != null) { byte[] family = context.getScan().getFamilies()[0]; ByteString startQualifier = ByteString.copyFrom(filter.getColumnOffset()); // Include all cells starting at the qualifier scan.getColumnOffset() // up to limit cells. return createChain( filter, FILTERS.qualifier().rangeWithinFamily(Bytes.toString(family)) .startClosed(startQualifier)); } else if (filter.getOffset() > 0) { // Include starting at an integer offset up to limit cells. return createChain( filter, FILTERS.offset().cellsPerRow(filter.getOffset())); } else { // No meaningful offset supplied. return createChain(filter, null); } }