use of com.google.cloud.bigtable.data.v2.models.Filters in project java-bigtable-hbase by googleapis.
the class TestFilterListAdapter method interleavedFiltersAreAdapted.
@Test
public void interleavedFiltersAreAdapted() throws IOException {
FilterList filterList = makeFilterList(Operator.MUST_PASS_ONE);
List<Filter> filters = filterList.getFilters();
Filters.Filter expectedFilter = adapt(filterList);
Assert.assertEquals(filters.size(), expectedFilter.toProto().getInterleave().getFiltersCount());
for (int i = 0; i < filters.size(); i++) {
Assert.assertEquals(adapt(filters.get(i)).toProto(), expectedFilter.toProto().getInterleave().getFilters(i));
}
}
use of com.google.cloud.bigtable.data.v2.models.Filters in project java-bigtable-hbase by googleapis.
the class TestFilterListAdapter method chainedFiltersAreAdapted.
@Test
public void chainedFiltersAreAdapted() throws IOException {
FilterList filterList = makeFilterList(Operator.MUST_PASS_ALL);
List<Filter> filters = filterList.getFilters();
Filters.Filter expectedFilter = adapt(filterList);
Assert.assertEquals(filters.size(), expectedFilter.toProto().getChain().getFiltersCount());
for (int i = 0; i < filters.size(); i++) {
Assert.assertEquals(adapt(filters.get(i)).toProto(), expectedFilter.toProto().getChain().getFilters(i));
}
}
use of com.google.cloud.bigtable.data.v2.models.Filters in project java-bigtable-hbase by googleapis.
the class TestKeyOnlyFilterAdapter method stripValuesIsApplied.
@Test
public void stripValuesIsApplied() throws IOException {
KeyOnlyFilter filter = new KeyOnlyFilter();
Filters.Filter expectedFilter = filterAdapter.adapt(emptyScanContext, filter);
Chain chain = expectedFilter.toProto().getChain();
Assert.assertTrue(chain.getFilters(0).getStripValueTransformer() || chain.getFilters(1).getStripValueTransformer());
Filters.Filter filters = filterAdapter.adapt(emptyScanContext, filter);
Filters f = Filters.FILTERS;
Assert.assertEquals(filters.toProto(), f.chain().filter(f.limit().cellsPerColumn(1)).filter(f.value().strip()).toProto());
}
Aggregations