-
Notifications
You must be signed in to change notification settings - Fork 4k
Add ClientTransportFilter #10646
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
Merged
larry-safran
merged 21 commits into
grpc:master
from
joybestourous:joy.bestourous/clienttransportfilter
Jan 3, 2024
Merged
Add ClientTransportFilter #10646
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a40996c
Add ClientTransportFilter
joybestourous ae4c2f6
style check
joybestourous fae28eb
stylecheck and ForwardingChannelBuilders
joybestourous 89b72ab
abstract -> interface, add transportAttrs, copy of transportFilters
joybestourous a4c6f6e
filter -> hook, remove from ForwardingChannelBuilder
joybestourous 766069b
remove throws Exception
joybestourous 5b8e668
add @since
joybestourous 0a8915c
add issue 10652
joybestourous 1434b93
Filter and add filterTransport to Listener
joybestourous a527ec3
filter transport comment
joybestourous e02f2f3
reassign attributes
joybestourous 8f325bd
Update core/src/main/java/io/grpc/internal/OobChannel.java
joybestourous 6bc89bc
Update api/src/main/java/io/grpc/ClientTransportFilter.java
joybestourous 296c240
Update core/src/main/java/io/grpc/internal/InternalSubchannel.java
joybestourous a5ec406
Update core/src/test/java/io/grpc/internal/InternalSubchannelTest.java
joybestourous a1bb386
checkstyle error
joybestourous 9f2269f
fix tests
joybestourous 20653a0
remove shutdown counter
joybestourous 315a80d
Remove incorrect replacement
sergiitk b084ea0
cronet error
joybestourous dfadf85
Fix test by adding when clause for mock listener
larry-safran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * Copyright 2023 The gRPC Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package io.grpc; | ||
|
|
||
| /** | ||
| * Listens on the client transport life-cycle events. These filters do not have the capability | ||
| * to modify the channels or transport life-cycle event behavior, but they can be useful hooks | ||
| * for transport observability. Multiple filters may be registered to the client. | ||
| * | ||
| * @since 1.61.0 | ||
| */ | ||
| @ExperimentalApi("https://gitub.com/grpc/grpc-java/issues/10652") | ||
| public abstract class ClientTransportFilter { | ||
joybestourous marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * Called when a transport is ready to accept traffic (when a connection has been established). | ||
| * The default implementation is a no-op. | ||
| * | ||
| * @param transportAttrs current transport attributes | ||
| * | ||
| * @return new transport attributes. Default implementation returns the passed-in attributes | ||
| * intact. | ||
| */ | ||
| public Attributes transportReady(Attributes transportAttrs) { | ||
| return transportAttrs; | ||
| } | ||
|
|
||
| /** | ||
| * Called when a transport completed shutting down. All resources have been released. | ||
| * All streams have either been closed or transferred off this transport. | ||
| * Default implementation is a no-op | ||
| * | ||
| * @param transportAttrs the effective transport attributes, which is what is returned by {@link | ||
| * #transportReady} of the last executed filter. | ||
| */ | ||
| public void transportTerminated(Attributes transportAttrs) { | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.