Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect HashSlot calculation for XREAD and XREADGROUP commands (#…
…2093) I have created a fix for the incorrect HashSlot calculation for the XREAD and XREADGROUP commands (#2086) Since these differ a lot from other messages I have created some new CommandMessage classes: - SingleStreamReadGroupCommandMessage - MultiStreamReadGroupCommandMessage - SingleStreamReadCommandMessage - MultiStreamReadCommandMessage The single CommandMessage classes could be removed by only using the multi command messages, but then we have to create a new StreamPostion array and a new StreamPostion object. I wasn't sure which option too choose, so feel free to give input on this (GC vs duplicate code). There is also some code duplication between the Read and ReadGroup Command messages as the ReadGroup command is very similar to the XREAD but has some additional values in the front of the command (group, consumer, noack). A base class could be created as well to reduce some of the duplication (calculating the hashslot in case of multiple streams and writing the streams part of the commands). The method CommandAndKey is also not overriden for these Messages as I wasn't which argument of the command to include in the string. Co-authored-by: Niels Derdaele <niels.derdaele@alsic.be> Co-authored-by: Nick Craver <nrcraver@gmail.com>
- Loading branch information