Class Rollout.TrafficPercentStrategy (3.31.0)

public static final class Rollout.TrafficPercentStrategy extends GeneratedMessageV3 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

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > Rollout.TrafficPercentStrategy

Static Fields

PERCENTAGES_FIELD_NUMBER

public static final int PERCENTAGES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Rollout.TrafficPercentStrategy getDefaultInstance()
Returns
TypeDescription
Rollout.TrafficPercentStrategy

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Rollout.TrafficPercentStrategy.Builder newBuilder()
Returns
TypeDescription
Rollout.TrafficPercentStrategy.Builder

newBuilder(Rollout.TrafficPercentStrategy prototype)

public static Rollout.TrafficPercentStrategy.Builder newBuilder(Rollout.TrafficPercentStrategy prototype)
Parameter
NameDescription
prototypeRollout.TrafficPercentStrategy
Returns
TypeDescription
Rollout.TrafficPercentStrategy.Builder

parseDelimitedFrom(InputStream input)

public static Rollout.TrafficPercentStrategy parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Rollout.TrafficPercentStrategy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Rollout.TrafficPercentStrategy parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Rollout.TrafficPercentStrategy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Rollout.TrafficPercentStrategy parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Rollout.TrafficPercentStrategy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Rollout.TrafficPercentStrategy parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Rollout.TrafficPercentStrategy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Rollout.TrafficPercentStrategy parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Rollout.TrafficPercentStrategy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Rollout.TrafficPercentStrategy parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Rollout.TrafficPercentStrategy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Rollout.TrafficPercentStrategy
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Rollout.TrafficPercentStrategy> parser()
Returns
TypeDescription
Parser<TrafficPercentStrategy>

Methods

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

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Rollout.TrafficPercentStrategy getDefaultInstanceForType()
Returns
TypeDescription
Rollout.TrafficPercentStrategy

getParserForType()

public Parser<Rollout.TrafficPercentStrategy> getParserForType()
Returns
TypeDescription
Parser<TrafficPercentStrategy>
Overrides

getPercentages() (deprecated)

public Map<String,Double> getPercentages()

Use #getPercentagesMap() instead.

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

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Rollout.TrafficPercentStrategy.Builder newBuilderForType()
Returns
TypeDescription
Rollout.TrafficPercentStrategy.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Rollout.TrafficPercentStrategy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Rollout.TrafficPercentStrategy.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Rollout.TrafficPercentStrategy.Builder toBuilder()
Returns
TypeDescription
Rollout.TrafficPercentStrategy.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException