Class: Gitlab::BackgroundMigration::BatchingStrategies::BaseStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/background_migration/batching_strategies/base_strategy.rb

Overview

Simple base class for batching strategy job classes.

Any strategy class that inherits from the base class will have connection to the tracking database set on initialization.

Direct Known Subclasses

PrimaryKeyBatchingStrategy

Instance Method Summary collapse

Constructor Details

#initialize(connection:) ⇒ BaseStrategy

Returns a new instance of BaseStrategy.


11
12
13
# File 'lib/gitlab/background_migration/batching_strategies/base_strategy.rb', line 11

def initialize(connection:)
  @connection = connection
end

Instance Method Details

#next_batch(*arguments) ⇒ Object

Raises:

  • (NotImplementedError)

15
16
17
18
# File 'lib/gitlab/background_migration/batching_strategies/base_strategy.rb', line 15

def next_batch(*arguments)
  raise NotImplementedError,
    "#{self.class} does not implement #{__method__}"
end