-
Notifications
You must be signed in to change notification settings - Fork 237
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
adding support for invocationId in Json path #850
Conversation
/gcbrun |
Codecov Report
@@ Coverage Diff @@
## master #850 +/- ##
=========================================
Coverage 80.49% 80.49%
- Complexity 1999 2007 +8
=========================================
Files 136 137 +1
Lines 8968 8989 +21
Branches 1031 1034 +3
=========================================
+ Hits 7219 7236 +17
- Misses 1334 1335 +1
- Partials 415 418 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
gcsio/src/test/java/com/google/cloud/hadoop/gcsio/TrackingHttpRequestInitializer.java
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Outdated
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Outdated
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Outdated
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Outdated
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
gcsio/src/test/java/com/google/cloud/hadoop/gcsio/TrackingHttpRequestInitializer.java
Show resolved
Hide resolved
/gcbrun |
gcsio/src/test/java/com/google/cloud/hadoop/gcsio/TrackingHttpRequestInitializer.java
Show resolved
Hide resolved
/gcbrun |
gcsio/src/test/java/com/google/cloud/hadoop/gcsio/TrackingHttpRequestInitializer.java
Show resolved
Hide resolved
gcsio/src/test/java/com/google/cloud/hadoop/gcsio/TrackingHttpRequestInitializer.java
Show resolved
Hide resolved
gcsio/src/test/java/com/google/cloud/hadoop/gcsio/TrackingHttpRequestInitializer.java
Outdated
Show resolved
Hide resolved
gcsio/src/test/java/com/google/cloud/hadoop/gcsio/TrackingHttpRequestInitializer.java
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
@@ -95,6 +96,7 @@ public void initialize(HttpRequest request) throws IOException { | |||
headers.setUserAgent(options.getDefaultUserAgent()); | |||
} | |||
headers.putAll(options.getHttpHeaders()); | |||
request.setInterceptor(new InvocationIdInterceptor(request.getInterceptor())); |
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.
It is not obvious why we are passing one interceptor to another. Is it because this will override the existing interceptor? If yes, please add a comment since it is not very obvious. Also we use ChainingInterceptors at other places for similar scenarios.
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.
Nothing is getting overridden. All interceptors are getting chained via this. Unlike gRPC in HTTP there is no way to provide more than one interceptor for request and this feels like the only way via which we can have multiple interceptors(one after another) act on a single request.
ChainingInterceptors
which you are referring to is not a interceptor but an initializer:ChainingHttpRequestInitializer
which chains multiple initializers
and interceptors
using the same exact logic which I used (or other way round).
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.
yes, I was referring about ChainingInterceptors. Please do add a comment explaining that this is doing a chaining interceptor. Also why not make use of existing chaining interceptor?
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.
There is NO ChainingInterceptors
there is [ChainingHttpRequestInitializer](https://github.com/GoogleCloudDataproc/hadoop-connectors/blob/master/util/src/main/java/com/google/cloud/hadoop/util/ChainingHttpRequestInitializer.java)
. I am not creating another HTTPInitializer
just an interceptor and hence there is no way(or no need to) I can use ChainingHttpRequestInitializer
. Interceptor
and Initializer
are two different things.
IIUC, If someone is creating a new interceptor and they can add it to any of the HTTPInitializer
used.
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Outdated
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
/gcbrun |
/gcbrun |
/gcbrun |
* adding support for invocationId in Json path * addressed review comments * addressed review comments * addressed review comments * addressed review comments
* adding support for invocationId in Json path (#850) * adding support for invocationId in Json path * addressed review comments * addressed review comments * addressed review comments * addressed review comments * formatting changes * fixed Unit test * formatting changes * Fixing integration test * formatting changes * fixed integration test
No description provided.