Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LinkedHashMap instead of HashMap for Map outputs #133

Closed
mp911de opened this issue Sep 9, 2015 · 0 comments
Closed

Use LinkedHashMap instead of HashMap for Map outputs #133

mp911de opened this issue Sep 9, 2015 · 0 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@mp911de
Copy link
Collaborator

mp911de commented Sep 9, 2015

The response maps use the HashMap implementation to transport map data structures. A HashMap has a random order and does not preserve the Redis ordering. Switch therefore to a LinkedHashMap.

Motivation: A LinkedHashMap preserves the order of elements whereas a HashMap maintains a "random order". The order of Redis hash values depends on the order of insertion. Users might want to preserve that order and that's the reason why to use a LinkedHashMap.

References:

@mp911de mp911de added the type: enhancement A general enhancement label Sep 9, 2015
@mp911de mp911de added this to the Lettuce 4.0 milestone Sep 9, 2015
mp911de added a commit that referenced this issue Sep 10, 2015
Motivation: A LinkedHashMap preserves the order of elements whereas a HashMap maintains a "random order". The order of Redis hash values depends on the order of insertion. Users might want to preserve that order and that's the reason why to use a LinkedHashMap.
@mp911de mp911de closed this as completed Sep 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant