-
Notifications
You must be signed in to change notification settings - Fork 16
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
Allow configuration of compression codec. #26
Conversation
} | ||
}; | ||
|
||
public abstract String getEncodingString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this method and use compressionCodec.name().toLowerCase()
instead of getEncodingString()
. Or even call enum constants lowercase and use just name()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this because I'm anticipating that in the future we might want to add LZ4, which would manifest as an enum value LZ4
but encoding string "x-lz4"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gianm why not add it now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the http-client doesn't currently support LZ4 and adding it may be non-trivial work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gianm ok, could you please add this explanation to getEncodingString()
as a Javadoc comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leventov added.
@gianm this change is included into 1.0.6 release. |
@gianm could you please review some of my recent PRs into Druid? |
sure, I have been doing more development than reviewing this week, but was intending to get back to reviewing soon. |
thank you for your review. |
@gianm could you please describe a bit how this code change controls the compression? As I understand the ACCEPT_ENCODING header means which content encoding the client is able to decode. So it can disable the response compression, but not the request compression. |
And where the compression logic is? Is it in Druid? |
In Druid we've seen that for large resultsets, gzip compression / decompression time is substantial, and given that Druid is typically deployed on a LAN we could benefit from using a different codec or from not using compression at all. This patch adds configurability between gzip/deflate/identity (the ones currently supported by the client) rather than hard-coding gzip.
Allows changing the default through
withCompressionCodec
on the config builder, as well as overriding per-request through the Accept-Encoding header.