#[non_exhaustive]pub struct Topic {
pub name: String,
pub partition_count: i32,
pub replication_factor: i32,
pub configs: HashMap<String, String>,
/* private fields */
}Expand description
A Kafka topic in a given cluster.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. 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}
partition_count: i32Required. 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: i32Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
configs: HashMap<String, String>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.
Implementations§
Source§impl Topic
impl Topic
pub fn new() -> Self
Sourcepub fn set_partition_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_partition_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of partition_count.
Sourcepub fn set_replication_factor<T: Into<i32>>(self, v: T) -> Self
pub fn set_replication_factor<T: Into<i32>>(self, v: T) -> Self
Sets the value of replication_factor.
Sourcepub fn set_configs<T, K, V>(self, v: T) -> Self
pub fn set_configs<T, K, V>(self, v: T) -> Self
Sets the value of configs.