Sha256: c41b405fff3aaf46da728531b7ffee9a58bacf6a0f93632c93a12bc21ee6b13b

Contents?: true

Size: 691 Bytes

Versions: 16

Compression:

Stored size: 691 Bytes

Contents

# frozen_string_literal: true

module Karafka
  class Cli
    class Topics < Cli::Base
      # Creates missing topics and aligns the partitions count
      class Migrate < Base
        # Runs the migration
        # @return [Boolean] true if there were any changes applied
        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
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
karafka-2.4.14 lib/karafka/cli/topics/migrate.rb
karafka-2.4.13 lib/karafka/cli/topics/migrate.rb
karafka-2.4.12 lib/karafka/cli/topics/migrate.rb
karafka-2.4.11 lib/karafka/cli/topics/migrate.rb
karafka-2.4.10 lib/karafka/cli/topics/migrate.rb
karafka-2.4.9 lib/karafka/cli/topics/migrate.rb
karafka-2.4.8 lib/karafka/cli/topics/migrate.rb
karafka-2.4.7 lib/karafka/cli/topics/migrate.rb
karafka-2.4.6 lib/karafka/cli/topics/migrate.rb
karafka-2.4.5 lib/karafka/cli/topics/migrate.rb
karafka-2.4.4 lib/karafka/cli/topics/migrate.rb
karafka-2.4.3 lib/karafka/cli/topics/migrate.rb
karafka-2.4.0 lib/karafka/cli/topics/migrate.rb
karafka-2.4.0.rc1 lib/karafka/cli/topics/migrate.rb
karafka-2.4.0.beta2 lib/karafka/cli/topics/migrate.rb
karafka-2.4.0.beta1 lib/karafka/cli/topics/migrate.rb