-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Refactor DirectDruidClient, extract QueryContextInputStreamResponseHandler #8848
Conversation
import java.util.concurrent.atomic.AtomicLong; | ||
import java.util.concurrent.atomic.AtomicReference; | ||
|
||
public class BufferInputStreamResponseHandler implements HttpResponseHandler<InputStream, InputStream> |
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.
Please add a class-level Javadoc explaining something about this class. Also, its name suggests that it could possibly be emulated by combining existing pieces (like BufferedInputStream + some other HttpResponseHandler). If that is not possible, or the semantics are actually different, it should be highlighted in the comment.
Optional: explain the concurrency (the class has a lot of it: Atomic fields, BlockingQueue, etc.) and add concurrent access documentation to the methods of this class.
thank you, @leventov |
/** | ||
* An HTTP response handler which uses sequence input streams to create a final InputStream. | ||
* | ||
* This implementation takes query context into consideration, e.g. timeout, maxQueuedBytes, backpressue. |
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.
Typo, "backpressure"
* may end with an IOException upon read() | ||
* | ||
* {@link org.apache.druid.java.util.http.client.response.SequenceInputStreamResponseHandler} also uses | ||
* sequence input streams to create final InputStream, but it does not have timeout, backpressue, |
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.
and here
* An HTTP response handler which uses sequence input streams to create a final InputStream. | ||
* | ||
* This implementation takes query context into consideration, e.g. timeout, maxQueuedBytes, backpressue. | ||
* It uses a blocking queue to feed a SequenceInputStream that is terminated whenever the handler's Done |
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.
Please make "Done method" a javadoc link
* method is called or a throwable is detected. | ||
* | ||
* The resulting InputStream will attempt to terminate normally, but on exception in HttpResponseHandler | ||
* may end with an IOException upon read() |
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.
And please make read() a javadoc link
thank you, @leventov |
* method is called or a throwable is detected. | ||
* This implementation takes query context into consideration, e.g. timeout, maxQueuedBytes, backpressure. | ||
* It uses a blocking queue to feed a SequenceInputStream that is terminated whenever the handler's | ||
* {@link #Done()} is called or a throwable is detected. |
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.
This link is not valid.
* | ||
* The resulting InputStream will attempt to terminate normally, but on exception in HttpResponseHandler | ||
* may end with an IOException upon read() | ||
* may end with an IOException upon {@link #read()} |
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.
And this
thank you @leventov |
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.
LGTM, please fix inspection errors
thank you, @leventov |
CI still fails |
Hi @leventov |
d649a8e
to
390532b
Compare
Yes, merge master |
09ccafb
to
30868ef
Compare
@zhenxiao note for future: don't force push branches. merge master into PR branch, do not rebase. |
whoops, CI pass now @leventov how about this one? A will have conflicts with base brach. B will need force push. which one should I do? |
bac2ea0
to
57899a4
Compare
When you are at the state "old-master -> my patch", you just need to run two actions: Then history will look like this:
|
thank you so much, @leventov I will do it next time |
tests passed. @leventov could you please take a look? |
d9d0a86
to
806825f
Compare
Codecov Report
@@ Coverage Diff @@
## master #8848 +/- ##
============================================
+ Coverage 62.93% 63.9% +0.96%
- Complexity 22577 22580 +3
============================================
Files 2980 2865 -115
Lines 123590 117386 -6204
Branches 17030 15646 -1384
============================================
- Hits 77785 75010 -2775
+ Misses 38708 35510 -3198
+ Partials 7097 6866 -231
Continue to review full report at Codecov.
|
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@druid.apache.org list. Thank you for your contributions. |
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Fixes #8444
CC @leventov