Created
April 7, 2016 03:40
-
-
Save cosbor11/ad9f87a8189eb81afebc4e45e08f05b2 to your computer and use it in GitHub Desktop.
Query partitioned data
This file contains hidden or 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
| // Create a query that includes the partition and flag for whether the NSA is listening | |
| // Area Code is partitioned and isNSAListening is indexed. This should be an optimized query | |
| QueryCriteria nsaListeningCriteria = new QueryCriteria( | |
| "isNSAListening", QueryCriteriaOperator.EQUAL, true); | |
| Query query = new Query(CallLog.class, nsaListeningCriteria); | |
| query.setPartition(555); | |
| List<CallLog> nsaIsWastingThereTimeListeningTo = manager.executeQuery(query); | |
| assertTrue("NSA is only listening to 1 call in area code 555", nsaIsWastingThereTimeListeningTo.size() == 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment