Class VirtualCluster.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<VirtualCluster.Builder>
com.google.protobuf.GeneratedMessage.Builder<VirtualCluster.Builder>
io.envoyproxy.envoy.config.route.v3.VirtualCluster.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, VirtualClusterOrBuilder, Cloneable
Enclosing class:
VirtualCluster

public static final class VirtualCluster.Builder extends com.google.protobuf.GeneratedMessage.Builder<VirtualCluster.Builder> implements VirtualClusterOrBuilder
 A virtual cluster is a way of specifying a regex matching rule against
 certain important endpoints such that statistics are generated explicitly for
 the matched requests. The reason this is useful is that when doing
 prefix/path matching Envoy does not always know what the application
 considers to be an endpoint. Thus, it’s impossible for Envoy to generically
 emit per endpoint statistics. However, often systems have highly critical
 endpoints that they wish to get “perfect” statistics on. Virtual cluster
 statistics are perfect in the sense that they are emitted on the downstream
 side such that they include network level failures.

 Documentation for :ref:`virtual cluster statistics <config_http_filters_router_vcluster_stats>`.

 .. note::

 Virtual clusters are a useful tool, but we do not recommend setting up a virtual cluster for
 every application endpoint. This is both not easily maintainable and as well the matching and
 statistics output are not free.
 
Protobuf type envoy.config.route.v3.VirtualCluster
  • Field Details

  • Constructor Details

    • Builder

      private Builder()
    • Builder

      private Builder(com.google.protobuf.AbstractMessage.BuilderParent parent)
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<VirtualCluster.Builder>
    • clear

      public VirtualCluster.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<VirtualCluster.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<VirtualCluster.Builder>
    • getDefaultInstanceForType

      public VirtualCluster getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public VirtualCluster build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public VirtualCluster buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • buildPartialRepeatedFields

      private void buildPartialRepeatedFields(VirtualCluster result)
    • buildPartial0

      private void buildPartial0(VirtualCluster result)
    • mergeFrom

      public VirtualCluster.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<VirtualCluster.Builder>
    • mergeFrom

      public VirtualCluster.Builder mergeFrom(VirtualCluster other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<VirtualCluster.Builder>
    • mergeFrom

      public VirtualCluster.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<VirtualCluster.Builder>
      Throws:
      IOException
    • ensureHeadersIsMutable

      private void ensureHeadersIsMutable()
    • getHeadersList

      public List<HeaderMatcher> getHeadersList()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
      Specified by:
      getHeadersList in interface VirtualClusterOrBuilder
    • getHeadersCount

      public int getHeadersCount()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
      Specified by:
      getHeadersCount in interface VirtualClusterOrBuilder
    • getHeaders

      public HeaderMatcher getHeaders(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
      Specified by:
      getHeaders in interface VirtualClusterOrBuilder
    • setHeaders

      public VirtualCluster.Builder setHeaders(int index, HeaderMatcher value)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • setHeaders

      public VirtualCluster.Builder setHeaders(int index, HeaderMatcher.Builder builderForValue)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • addHeaders

      public VirtualCluster.Builder addHeaders(HeaderMatcher value)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • addHeaders

      public VirtualCluster.Builder addHeaders(int index, HeaderMatcher value)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • addHeaders

      public VirtualCluster.Builder addHeaders(HeaderMatcher.Builder builderForValue)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • addHeaders

      public VirtualCluster.Builder addHeaders(int index, HeaderMatcher.Builder builderForValue)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • addAllHeaders

      public VirtualCluster.Builder addAllHeaders(Iterable<? extends HeaderMatcher> values)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • clearHeaders

      public VirtualCluster.Builder clearHeaders()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • removeHeaders

      public VirtualCluster.Builder removeHeaders(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • getHeadersBuilder

      public HeaderMatcher.Builder getHeadersBuilder(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • getHeadersOrBuilder

      public HeaderMatcherOrBuilder getHeadersOrBuilder(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
      Specified by:
      getHeadersOrBuilder in interface VirtualClusterOrBuilder
    • getHeadersOrBuilderList

      public List<? extends HeaderMatcherOrBuilder> getHeadersOrBuilderList()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
      Specified by:
      getHeadersOrBuilderList in interface VirtualClusterOrBuilder
    • addHeadersBuilder

      public HeaderMatcher.Builder addHeadersBuilder()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • addHeadersBuilder

      public HeaderMatcher.Builder addHeadersBuilder(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • getHeadersBuilderList

      public List<HeaderMatcher.Builder> getHeadersBuilderList()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.config.route.v3.HeaderMatcher headers = 4;
    • internalGetHeadersFieldBuilder

      private com.google.protobuf.RepeatedFieldBuilder<HeaderMatcher,HeaderMatcher.Builder,HeaderMatcherOrBuilder> internalGetHeadersFieldBuilder()
    • getName

      public String getName()
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Specified by:
      getName in interface VirtualClusterOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Specified by:
      getNameBytes in interface VirtualClusterOrBuilder
      Returns:
      The bytes for name.
    • setName

      public VirtualCluster.Builder setName(String value)
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public VirtualCluster.Builder clearName()
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Returns:
      This builder for chaining.
    • setNameBytes

      public VirtualCluster.Builder setNameBytes(com.google.protobuf.ByteString value)
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.