Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/22599 )

Change subject: IMPALA-13795: Support serving webUI content with gzip 
compression
......................................................................


Patch Set 7:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/22599/7/be/src/util/webserver.cc
File be/src/util/webserver.cc:

http://gerrit.cloudera.org:8080/#/c/22599/7/be/src/util/webserver.cc@244
PS7, Line 244: string content
Does it make sense to pass this as const reference since there to avoid data 
copying?  Or it's necessary due to compressor's MaxOutputLen() specifics?


http://gerrit.cloudera.org:8080/#/c/22599/7/be/src/util/webserver.cc@291
PS7, Line 291: find("gzip")
I guess this is good enough for Impala's embedded webserver, but just FYI: per 
RFC9110, there might be some cases where finding 'gzip' substring doesn't mean 
the HTTP client wants to receive the content compressed with gzip.  Vice versa, 
there might be a case when gzip compression is specifically marked as 
non-acceptable.  For example:

  Accept-Encoding: zstd, gzip;q=0, *;q=0.5


> If the representation's content coding is one of the content codings listed 
> in the Accept-Encoding field value, then it is acceptable unless it is 
> accompanied by a qvalue of 0. (As defined in Section 12.4.2, a qvalue of 0 
> means "not acceptable".)

You can check [1] and [2] for more details.

[1] https://www.rfc-editor.org/rfc/rfc9110.html
[2] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding


http://gerrit.cloudera.org:8080/#/c/22599/7/be/src/util/webserver.cc@292
PS7, Line 292: CompressStringToBuffer(content, output).ok()
If this returns non-OK status, does it make sense to log about the failure?


http://gerrit.cloudera.org:8080/#/c/22599/7/be/src/util/webserver.cc@301
PS7, Line 301: output.size()
Could it be 0 if CompressStringToBuffer() failed while calling 
Codec::CreateCompressor()?  Would it be acceptable?


http://gerrit.cloudera.org:8080/#/c/22599/7/be/src/util/webserver.cc@304
PS7, Line 304: output
nit: I'd consult Impala's style guide regarding variable name shadowing



--
To view, visit http://gerrit.cloudera.org:8080/22599
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I431088a30337bbef2c8d6e16dd15fb6572db0f15
Gerrit-Change-Number: 22599
Gerrit-PatchSet: 7
Gerrit-Owner: Surya Hebbar <sheb...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <ale...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com>
Gerrit-Reviewer: Riza Suminto <riza.sumi...@cloudera.com>
Gerrit-Reviewer: Surya Hebbar <sheb...@cloudera.com>
Gerrit-Comment-Date: Wed, 21 May 2025 19:09:28 +0000
Gerrit-HasComments: Yes

Reply via email to