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
gcloud projects add-iam-policy-binding my-project --member user:alice@example.com --role roles/cloudsql.admin |
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
Query query = Query.create(TABLE_ID); | |
for (String busLine : MANHATTAN_BUS_LINES) { | |
query.range("MTA/" + busLine + "/1496275200000", "MTA/" + busLine + "/1496275200001"); | |
} | |
query.filter(FILTERS | |
.interleave() | |
.filter(FILTERS.qualifier().exactMatch(LAT_COLUMN_NAME_STRING)) | |
.filter(FILTERS.qualifier().exactMatch(LONG_COLUMN_NAME_STRING))); |
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); |
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
.filter(FILTERS.qualifier().exactMatch("DestinationName")) | |
.filter(FILTERS.value().exactMatch("Select Bus Service Westside West End AV"))) |
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
SingleColumnValueFilter valueFilter = | |
new SingleColumnValueFilter( | |
COLUMN_FAMILY_NAME, | |
Bytes.toBytes("DestinationName"), | |
CompareOp.EQUAL, | |
Bytes.toBytes("Select Bus Service Westside West End AV")); |
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
Filters.ChainFilter chain = FILTERS | |
.chain() | |
.filter(FILTERS.limit().cellsPerColumn(1)) | |
.filter(FILTERS.condition( | |
FILTERS.chain() | |
.filter(FILTERS.limit().cellsPerColumn(1)) | |
.filter(FILTERS.qualifier().exactMatch("DestinationName")) | |
.filter(FILTERS.value().exactMatch("Select Bus Service Yorkville East End AV"))) | |
.then(FILTERS | |
.interleave() |
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
Scan scan = new Scan(); | |
SingleColumnValueFilter valueFilter = | |
new SingleColumnValueFilter( | |
COLUMN_FAMILY_NAME, | |
Bytes.toBytes("DestinationName"), | |
CompareOp.EQUAL, | |
Bytes.toBytes("Select Bus Service Yorkville East End AV")); | |
scan.setMaxVersions(1) |
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
Query.create(TABLE_ID) | |
.prefix("MTA/M86-SBS/") | |
.filter(FILTERS.limit().cellsPerColumn(1)) |
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
scan.withStartRow(Bytes.toBytes("MTA/M86-SBS/")) | |
.setRowPrefixFilter(Bytes.toBytes("MTA/M86-SBS/")); | |
//Optionally, reduce the result to receive one version per column | |
scan.setMaxVersions(1); |
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
Query query = Query.create(TABLE_ID) | |
.prefix("MTA/M86-SBS/1496275200000") | |
.filter(FILTERS | |
.interleave() | |
.filter(FILTERS.qualifier().exactMatch(LAT_COLUMN_NAME_STRING)) | |
.filter(FILTERS.qualifier().exactMatch(LONG_COLUMN_NAME_STRING))); | |
ServerStream<Row> rows = dataClient.readRows(query); |
NewerOlder