Class: Gitlab::Database::Batch::Strategies::BaseStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/database/batch/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

PrimaryKey

Instance Method Summary collapse

Constructor Details

#initialize(connection:) ⇒ BaseStrategy

Returns a new instance of BaseStrategy.



12
13
14
# File 'lib/gitlab/database/batch/strategies/base_strategy.rb', line 12

def initialize(connection:)
  @connection = connection
end

Instance Method Details

#next_batch(*arguments) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
19
# File 'lib/gitlab/database/batch/strategies/base_strategy.rb', line 16

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