Class: Google::Apis::ManagedkafkaV1::Topic

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/managedkafka_v1/classes.rb,
lib/google/apis/managedkafka_v1/representations.rb,
lib/google/apis/managedkafka_v1/representations.rb

Overview

A Kafka topic in a given cluster.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Topic

Returns a new instance of Topic.



1969
1970
1971
# File 'lib/google/apis/managedkafka_v1/classes.rb', line 1969

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#configsHash<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. Corresponds to the JSON property configs

Returns:

  • (Hash<String,String>)


1946
1947
1948
# File 'lib/google/apis/managedkafka_v1/classes.rb', line 1946

def configs
  @configs
end

#nameString

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 Corresponds to the JSON property name

Returns:

  • (String)


1953
1954
1955
# File 'lib/google/apis/managedkafka_v1/classes.rb', line 1953

def name
  @name
end

#partition_countFixnum

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. Corresponds to the JSON property partitionCount

Returns:

  • (Fixnum)


1961
1962
1963
# File 'lib/google/apis/managedkafka_v1/classes.rb', line 1961

def partition_count
  @partition_count
end

#replication_factorFixnum

Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability. Corresponds to the JSON property replicationFactor

Returns:

  • (Fixnum)


1967
1968
1969
# File 'lib/google/apis/managedkafka_v1/classes.rb', line 1967

def replication_factor
  @replication_factor
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1974
1975
1976
1977
1978
1979
# File 'lib/google/apis/managedkafka_v1/classes.rb', line 1974

def update!(**args)
  @configs = args[:configs] if args.key?(:configs)
  @name = args[:name] if args.key?(:name)
  @partition_count = args[:partition_count] if args.key?(:partition_count)
  @replication_factor = args[:replication_factor] if args.key?(:replication_factor)
end