summaryrefslogtreecommitdiff
path: root/lib/gitlab/background_migration/batching_strategies/base_strategy.rb
blob: 37bddea4f61dc95c0cce56f23245813c983373ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module Gitlab
  module BackgroundMigration
    module BatchingStrategies
      # 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.
      class BaseStrategy
        def initialize(connection:)
          @connection = connection
        end

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

        private

        attr_reader :connection
      end
    end
  end
end