Class TrafficSplit.Builder (2.28.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TrafficSplit.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TrafficSplit.Builder
Overrides

build()

public TrafficSplit build()
Returns
TypeDescription
TrafficSplit

buildPartial()

public TrafficSplit buildPartial()
Returns
TypeDescription
TrafficSplit

clear()

public TrafficSplit.Builder clear()
Returns
TypeDescription
TrafficSplit.Builder
Overrides

clearAllocations()

public TrafficSplit.Builder clearAllocations()
Returns
TypeDescription
TrafficSplit.Builder

clearField(Descriptors.FieldDescriptor field)

public TrafficSplit.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
TrafficSplit.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public TrafficSplit.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
TrafficSplit.Builder

This builder for chaining.

clone()

public TrafficSplit.Builder clone()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

getAllocations()

public Map<String,Double> getAllocations()

Use #getAllocationsMap() instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValuedouble
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
double

getDefaultInstanceForType()

public TrafficSplit getDefaultInstanceForType()
Returns
TypeDescription
TrafficSplit

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMutableAllocations()

public Map<String,Double> getMutableAllocations()

Use alternate mutation accessors instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
int

The enum numeric value on the wire for shardBy.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(TrafficSplit other)

public TrafficSplit.Builder mergeFrom(TrafficSplit other)
Parameter
NameDescription
otherTrafficSplit
Returns
TypeDescription
TrafficSplit.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TrafficSplit.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TrafficSplit.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public TrafficSplit.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
TrafficSplit.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TrafficSplit.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valuesMap<String,java.lang.Double>
Returns
TypeDescription
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
NameDescription
keyString
valuedouble
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
TrafficSplit.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public TrafficSplit.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TrafficSplit.Builder
Overrides

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

public TrafficSplit.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueTrafficSplit.ShardBy

The shardBy to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
TrafficSplit.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final TrafficSplit.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
TrafficSplit.Builder
Overrides