use of com.google.cloud.bigtable.data.v2.models.Filters.TimestampRangeFilter in project java-bigtable-hbase by googleapis.
the class ScanAdapter method createTimeRangeFilter.
private Filters.Filter createTimeRangeFilter(TimeRange timeRange) {
TimestampRangeFilter rangeBuilder = FILTERS.timestamp().range();
rangeBuilder.startClosed(convertUnits(timeRange.getMin()));
if (timeRange.getMax() != Long.MAX_VALUE) {
rangeBuilder.endOpen(convertUnits(timeRange.getMax()));
}
return rangeBuilder;
}
use of com.google.cloud.bigtable.data.v2.models.Filters.TimestampRangeFilter in project java-bigtable-hbase by googleapis.
the class TestTimestampRangeFilterAdapter method timestampFiltersAreAdapted.
@Test
public void timestampFiltersAreAdapted() {
TimestampRangeFilter filter = new TimestampRangeFilter(10L, 20L);
Filters.Filter expectedFilter = filterAdapter.adapt(emptyScanContext, filter);
TimestampRange expectedTimestampFilter = expectedFilter.toProto().getTimestampRangeFilter();
Assert.assertEquals(10000L, expectedTimestampFilter.getStartTimestampMicros());
Assert.assertEquals(20000L, expectedTimestampFilter.getEndTimestampMicros());
}
Aggregations