Class: Google::Apis::PubsubliteV1::PartitionConfig

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

Overview

The settings for a topic's partitions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ PartitionConfig

Returns a new instance of PartitionConfig.



436
437
438
# File 'lib/google/apis/pubsublite_v1/classes.rb', line 436

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

Instance Attribute Details

#capacityGoogle::Apis::PubsubliteV1::Capacity

The throughput capacity configuration for each partition. Corresponds to the JSON property capacity



416
417
418
# File 'lib/google/apis/pubsublite_v1/classes.rb', line 416

def capacity
  @capacity
end

#countFixnum

The number of partitions in the topic. Must be at least 1. Once a topic has been created the number of partitions can be increased but not decreased. Message ordering is not guaranteed across a topic resize. For more information see https://cloud.google.com/pubsub/lite/docs/topics#scaling_capacity Corresponds to the JSON property count

Returns:

  • (Fixnum)


424
425
426
# File 'lib/google/apis/pubsublite_v1/classes.rb', line 424

def count
  @count
end

#scaleFixnum

DEPRECATED: Use capacity instead which can express a superset of configurations. Every partition in the topic is allocated throughput equivalent to scale times the standard partition throughput (4 MiB/s). This is also reflected in the cost of this topic; a topic with scale of 2 and count of 10 is charged for 20 partitions. This value must be in the range [1,4] . Corresponds to the JSON property scale

Returns:

  • (Fixnum)


434
435
436
# File 'lib/google/apis/pubsublite_v1/classes.rb', line 434

def scale
  @scale
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



441
442
443
444
445
# File 'lib/google/apis/pubsublite_v1/classes.rb', line 441

def update!(**args)
  @capacity = args[:capacity] if args.key?(:capacity)
  @count = args[:count] if args.key?(:count)
  @scale = args[:scale] if args.key?(:scale)
end