Class TrafficSplit.Builder (2.42.0)

public static final class TrafficSplit.Builder extends GeneratedMessageV3.Builder<TrafficSplit.Builder> implements TrafficSplitOrBuilder

Traffic routing configuration for versions within a single service. Traffic splits define how traffic directed to the service is assigned to versions.

Protobuf type google.appengine.v1.TrafficSplit

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public TrafficSplit build()
Returns
Type Description
TrafficSplit

buildPartial()

public TrafficSplit buildPartial()
Returns
Type Description
TrafficSplit

clear()

public TrafficSplit.Builder clear()
Returns
Type Description
TrafficSplit.Builder
Overrides

clearAllocations()

public TrafficSplit.Builder clearAllocations()
Returns
Type Description
TrafficSplit.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearShardBy()

public TrafficSplit.Builder clearShardBy()

Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.

.google.appengine.v1.TrafficSplit.ShardBy shard_by = 1;

Returns
Type Description
TrafficSplit.Builder

This builder for chaining.

clone()

public TrafficSplit.Builder clone()
Returns
Type Description
TrafficSplit.Builder
Overrides

containsAllocations(String key)

public boolean containsAllocations(String key)

Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

map<string, double> allocations = 2;

Parameter
Name Description
key String
Returns
Type Description
boolean

getAllocations() (deprecated)

public Map<String,Double> getAllocations()

Use #getAllocationsMap() instead.

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

getAllocationsCount()

public int getAllocationsCount()

Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

map<string, double> allocations = 2;

Returns
Type Description
int

getAllocationsMap()

public Map<String,Double> getAllocationsMap()

Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

map<string, double> allocations = 2;

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

getAllocationsOrDefault(String key, double defaultValue)

public double getAllocationsOrDefault(String key, double defaultValue)

Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

map<string, double> allocations = 2;

Parameters
Name Description
key String
defaultValue double
Returns
Type Description
double

getAllocationsOrThrow(String key)

public double getAllocationsOrThrow(String key)

Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

map<string, double> allocations = 2;

Parameter
Name Description
key String
Returns
Type Description
double

getDefaultInstanceForType()

public TrafficSplit getDefaultInstanceForType()
Returns
Type Description
TrafficSplit

getDescriptorForType()

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

getMutableAllocations() (deprecated)

public Map<String,Double> getMutableAllocations()

Use alternate mutation accessors instead.

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

getShardBy()

public TrafficSplit.ShardBy getShardBy()

Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.

.google.appengine.v1.TrafficSplit.ShardBy shard_by = 1;

Returns
Type Description
TrafficSplit.ShardBy

The shardBy.

getShardByValue()

public int getShardByValue()

Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.

.google.appengine.v1.TrafficSplit.ShardBy shard_by = 1;

Returns
Type Description
int

The enum numeric value on the wire for shardBy.

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(TrafficSplit other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllAllocations(Map<String,Double> values)

public TrafficSplit.Builder putAllAllocations(Map<String,Double> values)

Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

map<string, double> allocations = 2;

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

putAllocations(String key, double value)

public TrafficSplit.Builder putAllocations(String key, double value)

Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

map<string, double> allocations = 2;

Parameters
Name Description
key String
value double
Returns
Type Description
TrafficSplit.Builder

removeAllocations(String key)

public TrafficSplit.Builder removeAllocations(String key)

Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.

map<string, double> allocations = 2;

Parameter
Name Description
key String
Returns
Type Description
TrafficSplit.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setShardBy(TrafficSplit.ShardBy value)

public TrafficSplit.Builder setShardBy(TrafficSplit.ShardBy value)

Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.

.google.appengine.v1.TrafficSplit.ShardBy shard_by = 1;

Parameter
Name Description
value TrafficSplit.ShardBy

The shardBy to set.

Returns
Type Description
TrafficSplit.Builder

This builder for chaining.

setShardByValue(int value)

public TrafficSplit.Builder setShardByValue(int value)

Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.

.google.appengine.v1.TrafficSplit.ShardBy shard_by = 1;

Parameter
Name Description
value int

The enum numeric value on the wire for shardBy to set.

Returns
Type Description
TrafficSplit.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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