Last active
March 17, 2017 13:23
-
-
Save ftrossbach/c9afc3b7cc068d31fcf8413d6740a296 to your computer and use it in GitHub Desktop.
Specific Client
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
//constructing a client for a store called "kv" with String keys and long values | |
SpecificBlockingKiqrClient<String, Long> client = new SpecificBlockingRestKiqrClientImpl<>("localhost", 44321, "kv", String.class, Long.class, Serdes.String(), Serdes.Long()); | |
//querying key "key1" from key-value store "kv" with String keys and Long values | |
Optional<Long> result = client.getScalarKeyValue("key1"); | |
//querying count of entries from key-value store "kv" | |
Optional<Long> result = client.count("kv"); | |
//querying all keys from store "kv" with String keys and Long values | |
Map<String, Long> result = client.getAllKeyValues(); | |
//querying key range "key1" to "key3" from store "kv" with String keys and Long values | |
Map<String, Long> result = client.getRangeKeyValues("key1", "key3"); | |
//querying windows for "key1" from epoch time 1 to epoch time 1000 from store "window" with String keys and Long values | |
SpecificBlockingKiqrClient<String, Long> client = new SpecificBlockingRestKiqrClientImpl<>("localhost", 44321, "window", String.class, Long.class, Serdes.String(), Serdes.Long()); | |
Map<Long, Long> result = client.getWindow("key1", 1L, 1000L); | |
//querying sessions for "key1" from store "session" with String keys and Long values | |
SpecificBlockingKiqrClient<String, Long> client = new SpecificBlockingRestKiqrClientImpl<>("localhost", 44321, "session", String.class, Long.class, Serdes.String(), Serdes.Long()); | |
Map<Window, Long> session = client.getSession("key1"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment