Class RouteAction.RequestMirrorPolicy
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessage
-
- io.envoyproxy.envoy.config.route.v3.RouteAction.RequestMirrorPolicy
-
- All Implemented Interfaces:
com.google.protobuf.Message
,com.google.protobuf.MessageLite
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,RouteAction.RequestMirrorPolicyOrBuilder
,java.io.Serializable
- Enclosing class:
- RouteAction
public static final class RouteAction.RequestMirrorPolicy extends com.google.protobuf.GeneratedMessage implements RouteAction.RequestMirrorPolicyOrBuilder
The router is capable of shadowing traffic from one cluster to another. The current implementation is "fire and forget," meaning Envoy will not wait for the shadow cluster to respond before returning the response from the primary cluster. All normal statistics are collected for the shadow cluster making this feature useful for testing. During shadowing, the host/authority header is altered such that ``-shadow`` is appended. This is useful for logging. For example, ``cluster1`` becomes ``cluster1-shadow``. This behavior can be disabled by setting ``disable_shadow_host_suffix_append`` to ``true``. .. note:: Shadowing will not be triggered if the primary cluster does not exist. .. note:: Shadowing doesn't support Http CONNECT and upgrades. [#next-free-field: 7]
Protobuf typeenvoy.config.route.v3.RouteAction.RequestMirrorPolicy
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RouteAction.RequestMirrorPolicy.Builder
The router is capable of shadowing traffic from one cluster to another.-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message,T extends java.lang.Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description private int
bitField0_
private java.lang.Object
cluster_
static int
CLUSTER_FIELD_NUMBER
static int
CLUSTER_HEADER_FIELD_NUMBER
private java.lang.Object
clusterHeader_
private static RouteAction.RequestMirrorPolicy
DEFAULT_INSTANCE
static int
DISABLE_SHADOW_HOST_SUFFIX_APPEND_FIELD_NUMBER
private boolean
disableShadowHostSuffixAppend_
private byte
memoizedIsInitialized
private static com.google.protobuf.Parser<RouteAction.RequestMirrorPolicy>
PARSER
static int
RUNTIME_FRACTION_FIELD_NUMBER
private RuntimeFractionalPercent
runtimeFraction_
private static long
serialVersionUID
static int
TRACE_SAMPLED_FIELD_NUMBER
private com.google.protobuf.BoolValue
traceSampled_
-
Constructor Summary
Constructors Modifier Constructor Description private
RequestMirrorPolicy()
private
RequestMirrorPolicy(com.google.protobuf.GeneratedMessage.Builder<?> builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getCluster()
Only one of ``cluster`` and ``cluster_header`` can be specified.com.google.protobuf.ByteString
getClusterBytes()
Only one of ``cluster`` and ``cluster_header`` can be specified.java.lang.String
getClusterHeader()
Only one of ``cluster`` and ``cluster_header`` can be specified.com.google.protobuf.ByteString
getClusterHeaderBytes()
Only one of ``cluster`` and ``cluster_header`` can be specified.static RouteAction.RequestMirrorPolicy
getDefaultInstance()
RouteAction.RequestMirrorPolicy
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
boolean
getDisableShadowHostSuffixAppend()
Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header.com.google.protobuf.Parser<RouteAction.RequestMirrorPolicy>
getParserForType()
RuntimeFractionalPercent
getRuntimeFraction()
If not specified, all requests to the target cluster will be mirrored.RuntimeFractionalPercentOrBuilder
getRuntimeFractionOrBuilder()
If not specified, all requests to the target cluster will be mirrored.int
getSerializedSize()
com.google.protobuf.BoolValue
getTraceSampled()
Determines if the trace span should be sampled.com.google.protobuf.BoolValueOrBuilder
getTraceSampledOrBuilder()
Determines if the trace span should be sampled.int
hashCode()
boolean
hasRuntimeFraction()
If not specified, all requests to the target cluster will be mirrored.boolean
hasTraceSampled()
Determines if the trace span should be sampled.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable()
boolean
isInitialized()
static RouteAction.RequestMirrorPolicy.Builder
newBuilder()
static RouteAction.RequestMirrorPolicy.Builder
newBuilder(RouteAction.RequestMirrorPolicy prototype)
RouteAction.RequestMirrorPolicy.Builder
newBuilderForType()
protected RouteAction.RequestMirrorPolicy.Builder
newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
static RouteAction.RequestMirrorPolicy
parseDelimitedFrom(java.io.InputStream input)
static RouteAction.RequestMirrorPolicy
parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RouteAction.RequestMirrorPolicy
parseFrom(byte[] data)
static RouteAction.RequestMirrorPolicy
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RouteAction.RequestMirrorPolicy
parseFrom(com.google.protobuf.ByteString data)
static RouteAction.RequestMirrorPolicy
parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RouteAction.RequestMirrorPolicy
parseFrom(com.google.protobuf.CodedInputStream input)
static RouteAction.RequestMirrorPolicy
parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RouteAction.RequestMirrorPolicy
parseFrom(java.io.InputStream input)
static RouteAction.RequestMirrorPolicy
parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static RouteAction.RequestMirrorPolicy
parseFrom(java.nio.ByteBuffer data)
static RouteAction.RequestMirrorPolicy
parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser<RouteAction.RequestMirrorPolicy>
parser()
RouteAction.RequestMirrorPolicy.Builder
toBuilder()
void
writeTo(com.google.protobuf.CodedOutputStream output)
-
Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
bitField0_
private int bitField0_
-
CLUSTER_FIELD_NUMBER
public static final int CLUSTER_FIELD_NUMBER
- See Also:
- Constant Field Values
-
cluster_
private volatile java.lang.Object cluster_
-
CLUSTER_HEADER_FIELD_NUMBER
public static final int CLUSTER_HEADER_FIELD_NUMBER
- See Also:
- Constant Field Values
-
clusterHeader_
private volatile java.lang.Object clusterHeader_
-
RUNTIME_FRACTION_FIELD_NUMBER
public static final int RUNTIME_FRACTION_FIELD_NUMBER
- See Also:
- Constant Field Values
-
runtimeFraction_
private RuntimeFractionalPercent runtimeFraction_
-
TRACE_SAMPLED_FIELD_NUMBER
public static final int TRACE_SAMPLED_FIELD_NUMBER
- See Also:
- Constant Field Values
-
traceSampled_
private com.google.protobuf.BoolValue traceSampled_
-
DISABLE_SHADOW_HOST_SUFFIX_APPEND_FIELD_NUMBER
public static final int DISABLE_SHADOW_HOST_SUFFIX_APPEND_FIELD_NUMBER
- See Also:
- Constant Field Values
-
disableShadowHostSuffixAppend_
private boolean disableShadowHostSuffixAppend_
-
memoizedIsInitialized
private byte memoizedIsInitialized
-
DEFAULT_INSTANCE
private static final RouteAction.RequestMirrorPolicy DEFAULT_INSTANCE
-
PARSER
private static final com.google.protobuf.Parser<RouteAction.RequestMirrorPolicy> PARSER
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage
-
getCluster
public java.lang.String getCluster()
Only one of ``cluster`` and ``cluster_header`` can be specified. [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}] Specifies the cluster that requests will be mirrored to. The cluster must exist in the cluster manager configuration.
string cluster = 1 [(.udpa.annotations.field_migrate) = { ... }
- Specified by:
getCluster
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The cluster.
-
getClusterBytes
public com.google.protobuf.ByteString getClusterBytes()
Only one of ``cluster`` and ``cluster_header`` can be specified. [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}] Specifies the cluster that requests will be mirrored to. The cluster must exist in the cluster manager configuration.
string cluster = 1 [(.udpa.annotations.field_migrate) = { ... }
- Specified by:
getClusterBytes
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The bytes for cluster.
-
getClusterHeader
public java.lang.String getClusterHeader()
Only one of ``cluster`` and ``cluster_header`` can be specified. Envoy will determine the cluster to route to by reading the value of the HTTP header named by cluster_header from the request headers. Only the first value in header is used, and no shadow request will happen if the value is not found in headers. Envoy will not wait for the shadow cluster to respond before returning the response from the primary cluster. .. attention:: Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1 ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead. .. note:: If the header appears multiple times only the first value is used.
string cluster_header = 5 [(.validate.rules) = { ... }
- Specified by:
getClusterHeader
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The clusterHeader.
-
getClusterHeaderBytes
public com.google.protobuf.ByteString getClusterHeaderBytes()
Only one of ``cluster`` and ``cluster_header`` can be specified. Envoy will determine the cluster to route to by reading the value of the HTTP header named by cluster_header from the request headers. Only the first value in header is used, and no shadow request will happen if the value is not found in headers. Envoy will not wait for the shadow cluster to respond before returning the response from the primary cluster. .. attention:: Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1 ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead. .. note:: If the header appears multiple times only the first value is used.
string cluster_header = 5 [(.validate.rules) = { ... }
- Specified by:
getClusterHeaderBytes
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The bytes for clusterHeader.
-
hasRuntimeFraction
public boolean hasRuntimeFraction()
If not specified, all requests to the target cluster will be mirrored. If specified, this field takes precedence over the ``runtime_key`` field and requests must also fall under the percentage of matches indicated by this field. For some fraction N/D, a random number in the range [0,D) is selected. If the number is <= the value of the numerator N, or if the key is not present, the default value, the request will be mirrored.
.envoy.config.core.v3.RuntimeFractionalPercent runtime_fraction = 3;
- Specified by:
hasRuntimeFraction
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- Whether the runtimeFraction field is set.
-
getRuntimeFraction
public RuntimeFractionalPercent getRuntimeFraction()
If not specified, all requests to the target cluster will be mirrored. If specified, this field takes precedence over the ``runtime_key`` field and requests must also fall under the percentage of matches indicated by this field. For some fraction N/D, a random number in the range [0,D) is selected. If the number is <= the value of the numerator N, or if the key is not present, the default value, the request will be mirrored.
.envoy.config.core.v3.RuntimeFractionalPercent runtime_fraction = 3;
- Specified by:
getRuntimeFraction
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The runtimeFraction.
-
getRuntimeFractionOrBuilder
public RuntimeFractionalPercentOrBuilder getRuntimeFractionOrBuilder()
If not specified, all requests to the target cluster will be mirrored. If specified, this field takes precedence over the ``runtime_key`` field and requests must also fall under the percentage of matches indicated by this field. For some fraction N/D, a random number in the range [0,D) is selected. If the number is <= the value of the numerator N, or if the key is not present, the default value, the request will be mirrored.
.envoy.config.core.v3.RuntimeFractionalPercent runtime_fraction = 3;
- Specified by:
getRuntimeFractionOrBuilder
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
-
hasTraceSampled
public boolean hasTraceSampled()
Determines if the trace span should be sampled. Defaults to true.
.google.protobuf.BoolValue trace_sampled = 4;
- Specified by:
hasTraceSampled
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- Whether the traceSampled field is set.
-
getTraceSampled
public com.google.protobuf.BoolValue getTraceSampled()
Determines if the trace span should be sampled. Defaults to true.
.google.protobuf.BoolValue trace_sampled = 4;
- Specified by:
getTraceSampled
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The traceSampled.
-
getTraceSampledOrBuilder
public com.google.protobuf.BoolValueOrBuilder getTraceSampledOrBuilder()
Determines if the trace span should be sampled. Defaults to true.
.google.protobuf.BoolValue trace_sampled = 4;
- Specified by:
getTraceSampledOrBuilder
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
-
getDisableShadowHostSuffixAppend
public boolean getDisableShadowHostSuffixAppend()
Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header. Defaults to ``false``.
bool disable_shadow_host_suffix_append = 6;
- Specified by:
getDisableShadowHostSuffixAppend
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The disableShadowHostSuffixAppend.
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessage
- Throws:
java.io.IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessage
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in classcom.google.protobuf.AbstractMessage
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static RouteAction.RequestMirrorPolicy parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static RouteAction.RequestMirrorPolicy parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
newBuilderForType
public RouteAction.RequestMirrorPolicy.Builder newBuilderForType()
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.MessageLite
-
newBuilder
public static RouteAction.RequestMirrorPolicy.Builder newBuilder()
-
newBuilder
public static RouteAction.RequestMirrorPolicy.Builder newBuilder(RouteAction.RequestMirrorPolicy prototype)
-
toBuilder
public RouteAction.RequestMirrorPolicy.Builder toBuilder()
- Specified by:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RouteAction.RequestMirrorPolicy.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
- Overrides:
newBuilderForType
in classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
public static RouteAction.RequestMirrorPolicy getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<RouteAction.RequestMirrorPolicy> parser()
-
getParserForType
public com.google.protobuf.Parser<RouteAction.RequestMirrorPolicy> getParserForType()
- Specified by:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
public RouteAction.RequestMirrorPolicy getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
-