public static final class Topic.Builder extends GeneratedMessage.Builder<Topic.Builder> implements TopicOrBuilderA Kafka topic in a given cluster.
Protobuf type google.cloud.managedkafka.v1.Topic
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > Topic.BuilderImplements
TopicOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
build()
public Topic build()| Returns | |
|---|---|
| Type | Description |
Topic |
|
buildPartial()
public Topic buildPartial()| Returns | |
|---|---|
| Type | Description |
Topic |
|
clear()
public Topic.Builder clear()| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
|
clearConfigs()
public Topic.Builder clearConfigs()| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
|
clearName()
public Topic.Builder clearName() Identifier. The name of the topic. The topic segment is used when
connecting directly to the cluster. Structured like:
projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
This builder for chaining. |
clearPartitionCount()
public Topic.Builder clearPartitionCount()Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.
int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
This builder for chaining. |
clearReplicationFactor()
public Topic.Builder clearReplicationFactor()Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
This builder for chaining. |
containsConfigs(String key)
public boolean containsConfigs(String key) Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example:
cleanup.policy, compression.type.
map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
key |
String |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
getConfigs() (deprecated)
public Map<String,String> getConfigs()Use #getConfigsMap() instead.
| Returns | |
|---|---|
| Type | Description |
Map<String,String> |
|
getConfigsCount()
public int getConfigsCount() Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example:
cleanup.policy, compression.type.
map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
|
getConfigsMap()
public Map<String,String> getConfigsMap() Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example:
cleanup.policy, compression.type.
map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
Map<String,String> |
|
getConfigsOrDefault(String key, String defaultValue)
public String getConfigsOrDefault(String key, String defaultValue) Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example:
cleanup.policy, compression.type.
map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
key |
String |
defaultValue |
String |
| Returns | |
|---|---|
| Type | Description |
String |
|
getConfigsOrThrow(String key)
public String getConfigsOrThrow(String key) Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example:
cleanup.policy, compression.type.
map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
key |
String |
| Returns | |
|---|---|
| Type | Description |
String |
|
getDefaultInstanceForType()
public Topic getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
Topic |
|
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getMutableConfigs() (deprecated)
public Map<String,String> getMutableConfigs()Use alternate mutation accessors instead.
| Returns | |
|---|---|
| Type | Description |
Map<String,String> |
|
getName()
public String getName() Identifier. The name of the topic. The topic segment is used when
connecting directly to the cluster. Structured like:
projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Returns | |
|---|---|
| Type | Description |
String |
The name. |
getNameBytes()
public ByteString getNameBytes() Identifier. The name of the topic. The topic segment is used when
connecting directly to the cluster. Structured like:
projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for name. |
getPartitionCount()
public int getPartitionCount()Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.
int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
int |
The partitionCount. |
getReplicationFactor()
public int getReplicationFactor()Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
| Returns | |
|---|---|
| Type | Description |
int |
The replicationFactor. |
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
internalGetMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)| Parameter | |
|---|---|
| Name | Description |
number |
int |
| Returns | |
|---|---|
| Type | Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
internalGetMutableMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)| Parameter | |
|---|---|
| Name | Description |
number |
int |
| Returns | |
|---|---|
| Type | Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeFrom(Topic other)
public Topic.Builder mergeFrom(Topic other)| Parameter | |
|---|---|
| Name | Description |
other |
Topic |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Topic.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public Topic.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
|
putAllConfigs(Map<String,String> values)
public Topic.Builder putAllConfigs(Map<String,String> values) Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example:
cleanup.policy, compression.type.
map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
values |
Map<String,String> |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
|
putConfigs(String key, String value)
public Topic.Builder putConfigs(String key, String value) Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example:
cleanup.policy, compression.type.
map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
key |
String |
value |
String |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
|
removeConfigs(String key)
public Topic.Builder removeConfigs(String key) Optional. Configurations for the topic that are overridden from the cluster
defaults. The key of the map is a Kafka topic property name, for example:
cleanup.policy, compression.type.
map<string, string> configs = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
key |
String |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
|
setName(String value)
public Topic.Builder setName(String value) Identifier. The name of the topic. The topic segment is used when
connecting directly to the cluster. Structured like:
projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe name to set. |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
This builder for chaining. |
setNameBytes(ByteString value)
public Topic.Builder setNameBytes(ByteString value) Identifier. The name of the topic. The topic segment is used when
connecting directly to the cluster. Structured like:
projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for name to set. |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
This builder for chaining. |
setPartitionCount(int value)
public Topic.Builder setPartitionCount(int value)Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.
int32 partition_count = 2 [(.google.api.field_behavior) = REQUIRED];
| Parameter | |
|---|---|
| Name | Description |
value |
intThe partitionCount to set. |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
This builder for chaining. |
setReplicationFactor(int value)
public Topic.Builder setReplicationFactor(int value)Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
int32 replication_factor = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
| Parameter | |
|---|---|
| Name | Description |
value |
intThe replicationFactor to set. |
| Returns | |
|---|---|
| Type | Description |
Topic.Builder |
This builder for chaining. |