/** * Matches only cells from columns whose qualifiers satisfy the given <a * href="https://github.com/google/re2/wiki/Syntax">RE2 regex</a>. Note that, since column * qualifiers can contain arbitrary bytes, the `\C` escape sequence must be used if a true * wildcard is desired. The `.` character will not match the new line character `\n`, which may * be present in a binary qualifier. */ public Filter regex(@Nonnull ByteString regex) { Preconditions.checkNotNull(regex); return new SimpleFilter(RowFilter.newBuilder().setColumnQualifierRegexFilter(regex).build()); }
.setColumnQualifierRegexFilter( ByteStringer.wrap(regex.toString().getBytes()))).build(); filter = RowFilter.newBuilder().setChain(filterChain.build()).build();
.setColumnQualifierRegexFilter( ByteStringer.wrap(regex.toString().getBytes()))).build(); filter = RowFilter.newBuilder().setChain(filterChain.build()).build();
setColumnQualifierRegexFilter(other.getColumnQualifierRegexFilter()); break;
setColumnQualifierRegexFilter(other.getColumnQualifierRegexFilter()); break;
/** * Matches only cells from columns whose qualifiers satisfy the given <a * href="https://github.com/google/re2/wiki/Syntax">RE2 regex</a>. Note that, since column * qualifiers can contain arbitrary bytes, the `\C` escape sequence must be used if a true * wildcard is desired. The `.` character will not match the new line character `\n`, which may * be present in a binary qualifier. */ public Filter regex(@Nonnull ByteString regex) { Preconditions.checkNotNull(regex); return new SimpleFilter(RowFilter.newBuilder().setColumnQualifierRegexFilter(regex).build()); }
/** * Matches only cells from columns whose qualifiers satisfy the given <a * href="https://github.com/google/re2/wiki/Syntax">RE2 regex</a>. Note that, since column * qualifiers can contain arbitrary bytes, the `\C` escape sequence must be used if a true * wildcard is desired. The `.` character will not match the new line character `\n`, which may * be present in a binary qualifier. */ public Filter regex(@Nonnull ByteString regex) { Preconditions.checkNotNull(regex); return new SimpleFilter(RowFilter.newBuilder().setColumnQualifierRegexFilter(regex).build()); }
setColumnQualifierRegexFilter(other.getColumnQualifierRegexFilter()); break;
@Test public void qualifierRegexStringTest() { RowFilter actualFilter = FILTERS.qualifier().regex("^hi").toProto(); RowFilter expectedFilter = RowFilter.newBuilder() .setColumnQualifierRegexFilter(ByteString.copyFromUtf8("^hi")) .build(); assertThat(actualFilter).isEqualTo(expectedFilter); }
@Test public void qualifierRegexTest() { RowFilter actualFilter = FILTERS.qualifier().regex(ByteString.copyFromUtf8("^hi")).toProto(); RowFilter expectedFilter = RowFilter.newBuilder() .setColumnQualifierRegexFilter(ByteString.copyFromUtf8("^hi")) .build(); assertThat(actualFilter).isEqualTo(expectedFilter); }
@Test public void qualifierExactMatchTest() { RowFilter actualFilter = FILTERS.qualifier().exactMatch(ByteString.copyFromUtf8("^hi")).toProto(); RowFilter expectedFilter = RowFilter.newBuilder() .setColumnQualifierRegexFilter(ByteString.copyFromUtf8("\\^hi")) .build(); assertThat(actualFilter).isEqualTo(expectedFilter); }
@Test public void qualifierExactStringMatchTest() { RowFilter actualFilter = FILTERS.qualifier().exactMatch("^hi").toProto(); RowFilter expectedFilter = RowFilter.newBuilder() .setColumnQualifierRegexFilter(ByteString.copyFromUtf8("\\^hi")) .build(); assertThat(actualFilter).isEqualTo(expectedFilter); }