Class Topic.RetentionConfig.Builder (1.16.5)

public static final class Topic.RetentionConfig.Builder extends GeneratedMessage.Builder<Topic.RetentionConfig.Builder> implements Topic.RetentionConfigOrBuilder

The settings for a topic's message retention.

Protobuf type google.cloud.pubsublite.v1.Topic.RetentionConfig

Static Methods

getDescriptor()

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

Methods

build()

public Topic.RetentionConfig build()
Returns
Type Description
Topic.RetentionConfig

buildPartial()

public Topic.RetentionConfig buildPartial()
Returns
Type Description
Topic.RetentionConfig

clear()

public Topic.RetentionConfig.Builder clear()
Returns
Type Description
Topic.RetentionConfig.Builder
Overrides

clearPerPartitionBytes()

public Topic.RetentionConfig.Builder clearPerPartitionBytes()

The provisioned storage, in bytes, per partition. If the number of bytes stored in any of the topic's partitions grows beyond this value, older messages will be dropped to make room for newer ones, regardless of the value of period.

int64 per_partition_bytes = 1;

Returns
Type Description
Topic.RetentionConfig.Builder

This builder for chaining.

clearPeriod()

public Topic.RetentionConfig.Builder clearPeriod()

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

.google.protobuf.Duration period = 2;

Returns
Type Description
Topic.RetentionConfig.Builder

getDefaultInstanceForType()

public Topic.RetentionConfig getDefaultInstanceForType()
Returns
Type Description
Topic.RetentionConfig

getDescriptorForType()

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

getPerPartitionBytes()

public long getPerPartitionBytes()

The provisioned storage, in bytes, per partition. If the number of bytes stored in any of the topic's partitions grows beyond this value, older messages will be dropped to make room for newer ones, regardless of the value of period.

int64 per_partition_bytes = 1;

Returns
Type Description
long

The perPartitionBytes.

getPeriod()

public Duration getPeriod()

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

.google.protobuf.Duration period = 2;

Returns
Type Description
Duration

The period.

getPeriodBuilder()

public Duration.Builder getPeriodBuilder()

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

.google.protobuf.Duration period = 2;

Returns
Type Description
Builder

getPeriodOrBuilder()

public DurationOrBuilder getPeriodOrBuilder()

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

.google.protobuf.Duration period = 2;

Returns
Type Description
DurationOrBuilder

hasPeriod()

public boolean hasPeriod()

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

.google.protobuf.Duration period = 2;

Returns
Type Description
boolean

Whether the period field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Topic.RetentionConfig other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergePeriod(Duration value)

public Topic.RetentionConfig.Builder mergePeriod(Duration value)

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

.google.protobuf.Duration period = 2;

Parameter
Name Description
value Duration
Returns
Type Description
Topic.RetentionConfig.Builder

setPerPartitionBytes(long value)

public Topic.RetentionConfig.Builder setPerPartitionBytes(long value)

The provisioned storage, in bytes, per partition. If the number of bytes stored in any of the topic's partitions grows beyond this value, older messages will be dropped to make room for newer ones, regardless of the value of period.

int64 per_partition_bytes = 1;

Parameter
Name Description
value long

The perPartitionBytes to set.

Returns
Type Description
Topic.RetentionConfig.Builder

This builder for chaining.

setPeriod(Duration value)

public Topic.RetentionConfig.Builder setPeriod(Duration value)

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

.google.protobuf.Duration period = 2;

Parameter
Name Description
value Duration
Returns
Type Description
Topic.RetentionConfig.Builder

setPeriod(Duration.Builder builderForValue)

public Topic.RetentionConfig.Builder setPeriod(Duration.Builder builderForValue)

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

.google.protobuf.Duration period = 2;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Topic.RetentionConfig.Builder