-
Notifications
You must be signed in to change notification settings - Fork 4k
composite filter #12646
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
base: master
Are you sure you want to change the base?
composite filter #12646
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,13 +16,15 @@ | |
|
|
||
| package io.grpc.xds; | ||
|
|
||
| import com.google.protobuf.Struct; | ||
| import io.grpc.Attributes; | ||
| import io.grpc.EquivalentAddressGroup; | ||
| import io.grpc.Grpc; | ||
| import io.grpc.NameResolver; | ||
| import io.grpc.xds.XdsNameResolverProvider.CallCounterProvider; | ||
| import io.grpc.xds.client.Locality; | ||
| import io.grpc.xds.client.XdsClient; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Attributes used for xDS implementation. | ||
|
|
@@ -100,5 +102,18 @@ final class XdsAttributes { | |
| static final Attributes.Key<Long> ATTR_DRAIN_GRACE_NANOS = | ||
| Attributes.Key.create("io.grpc.xds.XdsAttributes.drainGraceTime"); | ||
|
|
||
| /** | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see the usages for these newly added attributes in code, but I can see for others. Is there something I am missing here or will something be added in followup PRs? |
||
| * Attribute key for xDS route metadata used in filter matching. | ||
| */ | ||
| @NameResolver.ResolutionResultAttr | ||
| public static final Attributes.Key<Map<String, Struct>> ATTR_FILTER_METADATA = Attributes.Key | ||
| .create("io.grpc.xds.XdsAttributes.filterMetadata"); | ||
|
|
||
| /** | ||
| * CallOptions key for xDS route metadata used in filter matching. | ||
| */ | ||
| public static final io.grpc.CallOptions.Key<Map<String, Struct>> CALL_OPTIONS_FILTER_METADATA = | ||
| io.grpc.CallOptions.Key.create("io.grpc.xds.XdsAttributes.filterMetadata"); | ||
|
|
||
| private XdsAttributes() {} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,7 +230,7 @@ static FilterChain parseFilterChain( | |
| // FilterChain contains L4 filters, so we ensure it contains only HCM. | ||
| if (proto.getFiltersCount() != 1) { | ||
| throw new ResourceInvalidException("FilterChain " + filterChainName | ||
| + " should contain exact one HttpConnectionManager filter"); | ||
| + " should contain exactly one HttpConnectionManager filter"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Okay for now. But it's usually better to move small unrelated changes into a separate PR. |
||
| } | ||
| io.envoyproxy.envoy.config.listener.v3.Filter l4Filter = proto.getFiltersList().get(0); | ||
| if (!l4Filter.hasTypedConfig()) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -716,6 +716,7 @@ public void onUpdate(StatusOr<XdsConfig> updateOrStatus) { | |
| } | ||
|
|
||
| VirtualHost virtualHost = update.getVirtualHost(); | ||
| // filters and there configurations | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change relevant? |
||
| ImmutableList<NamedFilterConfig> filterConfigs = httpConnectionManager.httpFilterConfigs(); | ||
| long streamDurationNano = httpConnectionManager.httpMaxStreamDurationNano(); | ||
|
|
||
|
|
||
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.
go/java-practices/null#collection
Is there a semantic difference between a null
filterMetadataand emptyfilterMetadata?