Class TrafficSplit.Builder (2.58.0)

publicstaticfinalclass TrafficSplit.BuilderextendsGeneratedMessageV3.Builder<TrafficSplit.Builder>implementsTrafficSplitOrBuilder

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

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicTrafficSplit.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TrafficSplit.Builder
Overrides

build()

publicTrafficSplitbuild()
Returns
Type Description
TrafficSplit

buildPartial()

publicTrafficSplitbuildPartial()
Returns
Type Description
TrafficSplit

clear()

publicTrafficSplit.Builderclear()
Returns
Type Description
TrafficSplit.Builder
Overrides

clearAllocations()

publicTrafficSplit.BuilderclearAllocations()
Returns
Type Description
TrafficSplit.Builder

clearField(Descriptors.FieldDescriptor field)

publicTrafficSplit.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
TrafficSplit.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicTrafficSplit.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
TrafficSplit.Builder
Overrides

clearShardBy()

publicTrafficSplit.BuilderclearShardBy()

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

publicTrafficSplit.Builderclone()
Returns
Type Description
TrafficSplit.Builder
Overrides

containsAllocations(String key)

publicbooleancontainsAllocations(Stringkey)

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)

publicMap<String,Double>getAllocations()

Use #getAllocationsMap() instead.

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

getAllocationsCount()

publicintgetAllocationsCount()

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

publicMap<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)

publicdoublegetAllocationsOrDefault(Stringkey,doubledefaultValue)

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)

publicdoublegetAllocationsOrThrow(Stringkey)

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

publicTrafficSplitgetDefaultInstanceForType()
Returns
Type Description
TrafficSplit

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMutableAllocations() (deprecated)

publicMap<String,Double>getMutableAllocations()

Use alternate mutation accessors instead.

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

getShardBy()

publicTrafficSplit.ShardBygetShardBy()

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

publicintgetShardByValue()

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

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

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

internalGetMutableMapFieldReflection(int number)

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

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(TrafficSplit other)

publicTrafficSplit.BuildermergeFrom(TrafficSplitother)
Parameter
Name Description
other TrafficSplit
Returns
Type Description
TrafficSplit.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicTrafficSplit.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
TrafficSplit.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicTrafficSplit.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
TrafficSplit.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalTrafficSplit.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TrafficSplit.Builder
Overrides

putAllAllocations(Map<String,Double> values)

publicTrafficSplit.BuilderputAllAllocations(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)

publicTrafficSplit.BuilderputAllocations(Stringkey,doublevalue)

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)

publicTrafficSplit.BuilderremoveAllocations(Stringkey)

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)

publicTrafficSplit.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TrafficSplit.Builder
Overrides

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

publicTrafficSplit.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
TrafficSplit.Builder
Overrides

setShardBy(TrafficSplit.ShardBy value)

publicTrafficSplit.BuildersetShardBy(TrafficSplit.ShardByvalue)

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)

publicTrafficSplit.BuildersetShardByValue(intvalue)

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)

publicfinalTrafficSplit.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TrafficSplit.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.