-
Notifications
You must be signed in to change notification settings - Fork 986
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
Support ByteArrayCodec only for values #1122
Comments
Thanks for report. How if we add a codec adapter so we aid codec creation, something like |
Less code duplication indeed, should I proceed implementing it? |
On second thought, I think I didn't understand the proposal. I guess you are referring to something like:
In that way V type for key codec is useless (like the K type in valueCodec). It seems more correct to create a |
We don’t distinguish between key and value codecs. The of(...) method needs a slight tweak to genetics: key codec would be <K, ?> and value codec <?, V> as we’re combining only the portion of generics what the actual codec is used for. Feel free to submit a PR. We’ll work out the rest over some code. |
- Supports using different codecs for keys and values
- Supports using different codecs for keys and values Original pull request: #1123.
Feature Request
I think it would worth the effort to implement a mix of
StringCodec
andByteArrayCodec
for keys and values respectively. While someone could easily use theByteArrayCodec
and convert the key to string afterwards, this is not possible when theByteArrayCodec
is wrapped inside theCompressionCodec
. In that way, one cannot escape from having compressed keys even though the original intention would commonly (IMHO) be to just compress the value.@mp911de I could give it a try if you feel so. My gut feeling is that, if accepted, a little bit of refactoring would be needed to avoid code duplication between the new one,
StringCodec
andByteArrayCodec
, but we can have a first version in a PR and discuss on how you 'd suggest to proceedThe text was updated successfully, but these errors were encountered: