Class Rollout.TrafficPercentStrategy.Builder (3.52.0)

public static final class Rollout.TrafficPercentStrategy.Builder extends GeneratedMessageV3.Builder<Rollout.TrafficPercentStrategy.Builder> implements Rollout.TrafficPercentStrategyOrBuilder

Strategy that specifies how clients of Google Service Controller want to send traffic to use different config versions. This is generally used by API proxy to split traffic based on your configured percentage for each config version.

One example of how to gradually rollout a new service configuration using this strategy: Day 1

 Rollout {
   id: "example.googleapis.com/rollout_20160206"
   traffic_percent_strategy {
     percentages: {
       "example.googleapis.com/20160201": 70.00
       "example.googleapis.com/20160206": 30.00
     }
   }
 }

Day 2

 Rollout {
   id: "example.googleapis.com/rollout_20160207"
   traffic_percent_strategy: {
     percentages: {
       "example.googleapis.com/20160206": 100.00
     }
   }
 }

Protobuf type google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Rollout.TrafficPercentStrategy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

build()

public Rollout.TrafficPercentStrategy build()
Returns
Type Description
Rollout.TrafficPercentStrategy

buildPartial()

public Rollout.TrafficPercentStrategy buildPartial()
Returns
Type Description
Rollout.TrafficPercentStrategy

clear()

public Rollout.TrafficPercentStrategy.Builder clear()
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Rollout.TrafficPercentStrategy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public Rollout.TrafficPercentStrategy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

clearPercentages()

public Rollout.TrafficPercentStrategy.Builder clearPercentages()
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder

clone()

public Rollout.TrafficPercentStrategy.Builder clone()
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

containsPercentages(String key)

public boolean containsPercentages(String key)

Maps service configuration IDs to their corresponding traffic percentage. Key is the service configuration ID, Value is the traffic percentage which must be greater than 0.0 and the sum must equal to 100.0.

map<string, double> percentages = 1;

Parameter
Name Description
key String
Returns
Type Description
boolean

getDefaultInstanceForType()

public Rollout.TrafficPercentStrategy getDefaultInstanceForType()
Returns
Type Description
Rollout.TrafficPercentStrategy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMutablePercentages() (deprecated)

public Map<String,Double> getMutablePercentages()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,java.lang.Double>

getPercentages() (deprecated)

public Map<String,Double> getPercentages()

Use #getPercentagesMap() instead.

Returns
Type Description
Map<String,java.lang.Double>

getPercentagesCount()

public int getPercentagesCount()

Maps service configuration IDs to their corresponding traffic percentage. Key is the service configuration ID, Value is the traffic percentage which must be greater than 0.0 and the sum must equal to 100.0.

map<string, double> percentages = 1;

Returns
Type Description
int

getPercentagesMap()

public Map<String,Double> getPercentagesMap()

Maps service configuration IDs to their corresponding traffic percentage. Key is the service configuration ID, Value is the traffic percentage which must be greater than 0.0 and the sum must equal to 100.0.

map<string, double> percentages = 1;

Returns
Type Description
Map<String,java.lang.Double>

getPercentagesOrDefault(String key, double defaultValue)

public double getPercentagesOrDefault(String key, double defaultValue)

Maps service configuration IDs to their corresponding traffic percentage. Key is the service configuration ID, Value is the traffic percentage which must be greater than 0.0 and the sum must equal to 100.0.

map<string, double> percentages = 1;

Parameters
Name Description
key String
defaultValue double
Returns
Type Description
double

getPercentagesOrThrow(String key)

public double getPercentagesOrThrow(String key)

Maps service configuration IDs to their corresponding traffic percentage. Key is the service configuration ID, Value is the traffic percentage which must be greater than 0.0 and the sum must equal to 100.0.

map<string, double> percentages = 1;

Parameter
Name Description
key String
Returns
Type Description
double

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Rollout.TrafficPercentStrategy other)

public Rollout.TrafficPercentStrategy.Builder mergeFrom(Rollout.TrafficPercentStrategy other)
Parameter
Name Description
other Rollout.TrafficPercentStrategy
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Rollout.TrafficPercentStrategy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Rollout.TrafficPercentStrategy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Rollout.TrafficPercentStrategy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

putAllPercentages(Map<String,Double> values)

public Rollout.TrafficPercentStrategy.Builder putAllPercentages(Map<String,Double> values)

Maps service configuration IDs to their corresponding traffic percentage. Key is the service configuration ID, Value is the traffic percentage which must be greater than 0.0 and the sum must equal to 100.0.

map<string, double> percentages = 1;

Parameter
Name Description
values Map<String,java.lang.Double>
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder

putPercentages(String key, double value)

public Rollout.TrafficPercentStrategy.Builder putPercentages(String key, double value)

Maps service configuration IDs to their corresponding traffic percentage. Key is the service configuration ID, Value is the traffic percentage which must be greater than 0.0 and the sum must equal to 100.0.

map<string, double> percentages = 1;

Parameters
Name Description
key String
value double
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder

removePercentages(String key)

public Rollout.TrafficPercentStrategy.Builder removePercentages(String key)

Maps service configuration IDs to their corresponding traffic percentage. Key is the service configuration ID, Value is the traffic percentage which must be greater than 0.0 and the sum must equal to 100.0.

map<string, double> percentages = 1;

Parameter
Name Description
key String
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Rollout.TrafficPercentStrategy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Rollout.TrafficPercentStrategy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Rollout.TrafficPercentStrategy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Rollout.TrafficPercentStrategy.Builder
Overrides