Class: Karafka::Cli::Topics::Migrate

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/cli/topics/migrate.rb

Overview

Creates missing topics and aligns the partitions count

Instance Method Summary collapse

Methods included from Helpers::Colorize

#green, #grey, #red, #yellow

Instance Method Details

#callBoolean

Runs the migration

Returns:

  • (Boolean)

    true if there were any changes applied



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/karafka/cli/topics/migrate.rb', line 10

def call
  any_changes = false

  if Topics::Create.new.call
    any_changes = true
    wait
  end

  if Topics::Repartition.new.call
    any_changes = true
    wait
  end

  # No need to wait after the last one
  any_changes = true if Topics::Align.new.call

  any_changes
end