use of com.google.cloud.bigtable.hbase.util.RowKeyWrapper in project java-bigtable-hbase by googleapis.
the class TestMultiRowRangeAdapter method testOpenSingle.
@Test
public void testOpenSingle() throws IOException {
MultiRowRangeFilter filter = new MultiRowRangeFilter(Collections.singletonList(new RowRange("cc", false, "ee", false)));
Filters.Filter adaptedFilter = adapter.adapt(context, filter);
Assert.assertEquals(unaffectedRowFilter, adaptedFilter);
RangeSet<RowKeyWrapper> indexScanHint = adapter.getIndexScanHint(filter);
RangeSet<RowKeyWrapper> expected = ImmutableRangeSet.of(Range.open(new RowKeyWrapper(ByteString.copyFromUtf8("cc")), new RowKeyWrapper(ByteString.copyFromUtf8("ee"))));
Assert.assertEquals(expected, indexScanHint);
}
use of com.google.cloud.bigtable.hbase.util.RowKeyWrapper in project java-bigtable-hbase by googleapis.
the class TestMultiRowRangeAdapter method testUnboundedStartSingle.
@Test
public void testUnboundedStartSingle() throws IOException {
MultiRowRangeFilter filter = new MultiRowRangeFilter(Collections.singletonList(new RowRange(HConstants.EMPTY_START_ROW, true, "ee".getBytes(), true)));
Filters.Filter adaptedFilter = adapter.adapt(context, filter);
Assert.assertEquals(unaffectedRowFilter, adaptedFilter);
RangeSet<RowKeyWrapper> indexScanHint = adapter.getIndexScanHint(filter);
RangeSet<RowKeyWrapper> expected = ImmutableRangeSet.of(Range.atMost(new RowKeyWrapper(ByteString.copyFromUtf8("ee"))));
Assert.assertEquals(expected, indexScanHint);
}
use of com.google.cloud.bigtable.hbase.util.RowKeyWrapper in project java-bigtable-hbase by googleapis.
the class TestMultiRowRangeAdapter method testDisjoint.
@Test
public void testDisjoint() throws IOException {
MultiRowRangeFilter filter = new MultiRowRangeFilter(Arrays.asList(new RowRange("bb", true, "cc", true), new RowRange("ss", true, "yy", true)));
Filters.Filter adaptedFilter = adapter.adapt(context, filter);
Assert.assertEquals(unaffectedRowFilter, adaptedFilter);
RangeSet<RowKeyWrapper> indexScanHint = adapter.getIndexScanHint(filter);
RangeSet<RowKeyWrapper> expected = ImmutableRangeSet.<RowKeyWrapper>builder().add(Range.closed(new RowKeyWrapper(ByteString.copyFromUtf8("bb")), new RowKeyWrapper(ByteString.copyFromUtf8("cc")))).add(Range.closed(new RowKeyWrapper(ByteString.copyFromUtf8("ss")), new RowKeyWrapper(ByteString.copyFromUtf8("yy")))).build();
Assert.assertEquals(expected, indexScanHint);
}
use of com.google.cloud.bigtable.hbase.util.RowKeyWrapper in project java-bigtable-hbase by googleapis.
the class TestMultiRowRangeAdapter method testUnbounded.
@Test
public void testUnbounded() throws IOException {
MultiRowRangeFilter filter = new MultiRowRangeFilter(Collections.singletonList(new RowRange(HConstants.EMPTY_START_ROW, true, HConstants.EMPTY_END_ROW, true)));
Filters.Filter adaptedFilter = adapter.adapt(context, filter);
Assert.assertEquals(unaffectedRowFilter, adaptedFilter);
RangeSet<RowKeyWrapper> indexScanHint = adapter.getIndexScanHint(filter);
RangeSet<RowKeyWrapper> expected = ImmutableRangeSet.of(Range.<RowKeyWrapper>all());
Assert.assertEquals(expected, indexScanHint);
}
use of com.google.cloud.bigtable.hbase.util.RowKeyWrapper in project java-bigtable-hbase by googleapis.
the class TestMultiRowRangeAdapter method testClosedSingle.
@Test
public void testClosedSingle() throws IOException {
MultiRowRangeFilter filter = new MultiRowRangeFilter(Collections.singletonList(new RowRange("cc", true, "ee", true)));
Filters.Filter adaptedFilter = adapter.adapt(context, filter);
Assert.assertEquals(unaffectedRowFilter, adaptedFilter);
RangeSet<RowKeyWrapper> indexScanHint = adapter.getIndexScanHint(filter);
RangeSet<RowKeyWrapper> expected = ImmutableRangeSet.of(Range.closed(new RowKeyWrapper(ByteString.copyFromUtf8("cc")), new RowKeyWrapper(ByteString.copyFromUtf8("ee"))));
Assert.assertEquals(expected, indexScanHint);
}
Aggregations