Skip to content

Instantly share code, notes, and snippets.

@ftrossbach
Last active March 17, 2017 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ftrossbach/c9afc3b7cc068d31fcf8413d6740a296 to your computer and use it in GitHub Desktop.
Save ftrossbach/c9afc3b7cc068d31fcf8413d6740a296 to your computer and use it in GitHub Desktop.
Specific Client
//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