1 | # frozen_string_literal: true |
||
2 | |||
3 | 1 | module NoSE |
|
4 | # Loaders which insert data into indexes from external sources |
||
5 | 1 | module Loader |
|
6 | # Superclass for all data loaders |
||
7 | 1 | class LoaderBase |
|
8 | 1 | def initialize(workload = nil, backend = nil) |
|
9 | 1 | @workload = workload |
|
10 | 1 | @backend = backend |
|
11 | end |
||
12 | |||
13 | # :nocov: |
||
14 | # @abstract Subclasses should produce a workload |
||
15 | # @return [void] |
||
16 | 1 | def workload(_config) |
|
17 | fail NotImplementedError |
||
18 | end |
||
19 | # :nocov: |
||
20 | |||
21 | # :nocov: |
||
22 | # @abstract Subclasses should load data for the given list of indexes |
||
23 | # @return [void] |
||
24 | 1 | def load(_indexes, _config, _show_progress = false, _limit = nil, |
|
0 ignored issues
–
show
introduced
by
![]() |
|||
25 | _skip_existing = true) |
||
0 ignored issues
–
show
|
|||
26 | fail NotImplementedError |
||
27 | end |
||
28 | # :nocov: |
||
29 | |||
30 | # @abstract Subclasses should generate a model from the external source |
||
31 | # :nocov: |
||
32 | 1 | def model(_config) |
|
33 | fail NotImplementedError |
||
34 | end |
||
35 | # :nocov: |
||
36 | end |
||
37 | end |
||
38 | end |
||
39 |