Reference documentation and code samples for the Google Cloud Managed Kafka V1 Client class Topic.
A Kafka topic in a given cluster.
Generated from protobuf message google.cloud.managedkafka.v1.Topic
Namespace
Google \ Cloud \ ManagedKafka \ V1Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ name |
string
Identifier. The name of the topic. The |
↳ partition_count |
int
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. |
↳ replication_factor |
int
Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability. |
↳ configs |
array|Google\Protobuf\Internal\MapField
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: |
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}
| Returns | |
|---|---|
| Type | Description |
string |
|
setName
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}
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
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.
| Returns | |
|---|---|
| Type | Description |
int |
|
setPartitionCount
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.
| Parameter | |
|---|---|
| Name | Description |
var |
int
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getReplicationFactor
Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
| Returns | |
|---|---|
| Type | Description |
int |
|
setReplicationFactor
Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
| Parameter | |
|---|---|
| Name | Description |
var |
int
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getConfigs
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.
| Returns | |
|---|---|
| Type | Description |
Google\Protobuf\Internal\MapField |
|
setConfigs
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.
| Parameter | |
|---|---|
| Name | Description |
var |
array|Google\Protobuf\Internal\MapField
|
| Returns | |
|---|---|
| Type | Description |
$this |
|