Created
October 21, 2019 15:11
-
-
Save dbergqvist/5c4ca87710b5365e96d2a6d7fd21ed42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String[] MANHATTAN_BUS_LINES = {"M1","M2","M3",... | |
List<RowRange> ranges = new ArrayList<>(); | |
for (String busLine : MANHATTAN_BUS_LINES) { | |
ranges.add( | |
new RowRange( | |
Bytes.toBytes("MTA/" + busLine + "/1496275200000"), true, | |
Bytes.toBytes("MTA/" + busLine + "/1496275200001"), false)); | |
} | |
Filter filter = new MultiRowRangeFilter(ranges); | |
Scan scan = new Scan(); | |
scan.setFilter(filter); | |
scan.setMaxVersions(Integer.MAX_VALUE) | |
.addColumn(COLUMN_FAMILY_NAME, LAT_COLUMN_NAME) | |
.addColumn(COLUMN_FAMILY_NAME, LONG_COLUMN_NAME); | |
scan.withStartRow(Bytes.toBytes("MTA/M")).setRowPrefixFilter(Bytes.toBytes("MTA/M")); | |
ResultScanner scanner = table.getScanner(scan); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment