Using the Samza KeyValueStore interface, how do I retrieve all documents with a common key prefix? The keys are Strings, and RocksDb will be the underlying store.
Are there any issues with the approach below using the range method?
KeyValueStore<String,String> store = (KeyValueStore<String, String>) context.getStore("foo")
store.put("aaa.xxx", "foo");
store.put("aaa.yyy", "bar");
store.put("bbb.zzz", "qux");
// get all docs starting with "aaa."
KeyValueIterator<String, String> it = store.range("aaa.", "aaa." + Character.MAX_VALUE)
This will work, but because the range end value is exclusive, you could also just do store.range("aaa.", "b")