These are chat archives for atomix/atomix

29th
Jul 2016
Kevin Daly
@kedaly
Jul 29 2016 12:45
Hi I'm trying to figure out how to debug something. I need to see the values in a MultiMap, is there a way to do this?
Jordan Halterman
@kuujo
Jul 29 2016 16:46
@kedaly you can only get the values for a single key with get. The reason there's no values() or even keySet type methods is to avoid pulling the entire map to the client. There's been some debate about whether or not this should be implemented. I'm not particularly opposed to it considering that data structures are not partitioned in any way and are therefore limited to the size of a single node anyways. The alternative is lazy Collection and Set implementations and/or lazy implementations of the Java 8 stream API, but there are consistency and memory issues to consider with those. In order to properly manage a lazy collection we'd probably have to copy the memory on the server. Many concurrent iterators could consume a lot of memory. But I don't want to mess with that stuff now. We'll likely just implement them as a single request/response that would be limited by the Netty frame size and handle the resource issues in a later version.
Feel free to submit a PR :-) Add a command to MultiMapCommands and then an implementation on MultiMapState to return the values and add a method to DistributedMultiMap
I can do it pretty quickly but it will take a few days to get to it. I think there have been enough requests for these methods to make them a top priority