Hi,
I have a stream that exposes the state for Queryable State. I am using the key as follows: public class MyKey { private TreeMap<String, String> map; @Override } If I only set the first three members for the key class, then the key lookup works correctly. If I add the TreeMap, then the lookup always errors with the message; “No state found for the given key/namespace”. What am I dong wrong with the TreeMap as a member in the Key class for equals/hashcode? Thanks, Sandeep |
Hi Sandeep, the equals method does not compare the this.map with that.map but that.dimensions. ...at least in your commented out code. Might this be the problem? Best, Matthias On Tue, Mar 23, 2021 at 5:28 AM Sandeep khanzode <[hidden email]> wrote:
|
Hi Matthias,
Thanks. But yes, I am comparing map with that.map … the comment is probably for the previous variable name. I can use String, Int, Enum, Long type keys in the Key that I send in the Query getKvState … but the moment I introduce a TreeMap, even though it contains a simple one entry String, String, it doesn’t work … Thanks, Sandeep
|
Could you provide the full stacktrace of your error? That might help me to dig into the code. Matthias On Tue, Mar 23, 2021 at 2:33 PM Sandeep khanzode <[hidden email]> wrote:
|
It seems that the record exists for that Key (which has the TreeMap member) but there is some equals/hashcode issue in comparing and determining match … maybe the serializedKey byte[] for TreeMap works differently?
|
Free forum by Nabble | Edit this page |