github.com/pingcap/br@v5.3.0-alpha.0.20220125034240-ec59c7b6ce30+incompatible/pkg/mock/backend.go (about)

     1  // Code generated by MockGen. DO NOT EDIT.
     2  // Source: github.com/pingcap/br/pkg/lightning/backend (interfaces: AbstractBackend,EngineWriter)
     3  
     4  // $ mockgen -package mock -mock_names 'AbstractBackend=MockBackend' github.com/pingcap/br/pkg/lightning/backend AbstractBackend,EngineWriter
     5  
     6  // Package mock is a generated GoMock package.
     7  package mock
     8  
     9  import (
    10  	context "context"
    11  	gomock "github.com/golang/mock/gomock"
    12  	uuid "github.com/google/uuid"
    13  	backend "github.com/pingcap/br/pkg/lightning/backend"
    14  	kv "github.com/pingcap/br/pkg/lightning/backend/kv"
    15  	model "github.com/pingcap/parser/model"
    16  	table "github.com/pingcap/tidb/table"
    17  	reflect "reflect"
    18  	time "time"
    19  )
    20  
    21  // MockBackend is a mock of AbstractBackend interface
    22  type MockBackend struct {
    23  	ctrl     *gomock.Controller
    24  	recorder *MockBackendMockRecorder
    25  }
    26  
    27  // MockBackendMockRecorder is the mock recorder for MockBackend
    28  type MockBackendMockRecorder struct {
    29  	mock *MockBackend
    30  }
    31  
    32  // NewMockBackend creates a new mock instance
    33  func NewMockBackend(ctrl *gomock.Controller) *MockBackend {
    34  	mock := &MockBackend{ctrl: ctrl}
    35  	mock.recorder = &MockBackendMockRecorder{mock}
    36  	return mock
    37  }
    38  
    39  // EXPECT returns an object that allows the caller to indicate expected use
    40  func (m *MockBackend) EXPECT() *MockBackendMockRecorder {
    41  	return m.recorder
    42  }
    43  
    44  // CheckRequirements mocks base method
    45  func (m *MockBackend) CheckRequirements(arg0 context.Context, arg1 *backend.CheckCtx) error {
    46  	m.ctrl.T.Helper()
    47  	ret := m.ctrl.Call(m, "CheckRequirements", arg0, arg1)
    48  	ret0, _ := ret[0].(error)
    49  	return ret0
    50  }
    51  
    52  // CheckRequirements indicates an expected call of CheckRequirements
    53  func (mr *MockBackendMockRecorder) CheckRequirements(arg0, arg1 interface{}) *gomock.Call {
    54  	mr.mock.ctrl.T.Helper()
    55  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckRequirements", reflect.TypeOf((*MockBackend)(nil).CheckRequirements), arg0, arg1)
    56  }
    57  
    58  // CleanupEngine mocks base method
    59  func (m *MockBackend) CleanupEngine(arg0 context.Context, arg1 uuid.UUID) error {
    60  	m.ctrl.T.Helper()
    61  	ret := m.ctrl.Call(m, "CleanupEngine", arg0, arg1)
    62  	ret0, _ := ret[0].(error)
    63  	return ret0
    64  }
    65  
    66  // CleanupEngine indicates an expected call of CleanupEngine
    67  func (mr *MockBackendMockRecorder) CleanupEngine(arg0, arg1 interface{}) *gomock.Call {
    68  	mr.mock.ctrl.T.Helper()
    69  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanupEngine", reflect.TypeOf((*MockBackend)(nil).CleanupEngine), arg0, arg1)
    70  }
    71  
    72  // Close mocks base method
    73  func (m *MockBackend) Close() {
    74  	m.ctrl.T.Helper()
    75  	m.ctrl.Call(m, "Close")
    76  }
    77  
    78  // Close indicates an expected call of Close
    79  func (mr *MockBackendMockRecorder) Close() *gomock.Call {
    80  	mr.mock.ctrl.T.Helper()
    81  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockBackend)(nil).Close))
    82  }
    83  
    84  // CloseEngine mocks base method
    85  func (m *MockBackend) CloseEngine(arg0 context.Context, arg1 *backend.EngineConfig, arg2 uuid.UUID) error {
    86  	m.ctrl.T.Helper()
    87  	ret := m.ctrl.Call(m, "CloseEngine", arg0, arg1, arg2)
    88  	ret0, _ := ret[0].(error)
    89  	return ret0
    90  }
    91  
    92  // CloseEngine indicates an expected call of CloseEngine
    93  func (mr *MockBackendMockRecorder) CloseEngine(arg0, arg1, arg2 interface{}) *gomock.Call {
    94  	mr.mock.ctrl.T.Helper()
    95  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseEngine", reflect.TypeOf((*MockBackend)(nil).CloseEngine), arg0, arg1, arg2)
    96  }
    97  
    98  // CollectLocalDuplicateRows mocks base method
    99  func (m *MockBackend) CollectLocalDuplicateRows(arg0 context.Context, arg1 table.Table) error {
   100  	m.ctrl.T.Helper()
   101  	ret := m.ctrl.Call(m, "CollectLocalDuplicateRows", arg0, arg1)
   102  	ret0, _ := ret[0].(error)
   103  	return ret0
   104  }
   105  
   106  // CollectLocalDuplicateRows indicates an expected call of CollectLocalDuplicateRows
   107  func (mr *MockBackendMockRecorder) CollectLocalDuplicateRows(arg0, arg1 interface{}) *gomock.Call {
   108  	mr.mock.ctrl.T.Helper()
   109  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CollectLocalDuplicateRows", reflect.TypeOf((*MockBackend)(nil).CollectLocalDuplicateRows), arg0, arg1)
   110  }
   111  
   112  // CollectRemoteDuplicateRows mocks base method
   113  func (m *MockBackend) CollectRemoteDuplicateRows(arg0 context.Context, arg1 table.Table) error {
   114  	m.ctrl.T.Helper()
   115  	ret := m.ctrl.Call(m, "CollectRemoteDuplicateRows", arg0, arg1)
   116  	ret0, _ := ret[0].(error)
   117  	return ret0
   118  }
   119  
   120  // CollectRemoteDuplicateRows indicates an expected call of CollectRemoteDuplicateRows
   121  func (mr *MockBackendMockRecorder) CollectRemoteDuplicateRows(arg0, arg1 interface{}) *gomock.Call {
   122  	mr.mock.ctrl.T.Helper()
   123  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CollectRemoteDuplicateRows", reflect.TypeOf((*MockBackend)(nil).CollectRemoteDuplicateRows), arg0, arg1)
   124  }
   125  
   126  // EngineFileSizes mocks base method
   127  func (m *MockBackend) EngineFileSizes() []backend.EngineFileSize {
   128  	m.ctrl.T.Helper()
   129  	ret := m.ctrl.Call(m, "EngineFileSizes")
   130  	ret0, _ := ret[0].([]backend.EngineFileSize)
   131  	return ret0
   132  }
   133  
   134  // EngineFileSizes indicates an expected call of EngineFileSizes
   135  func (mr *MockBackendMockRecorder) EngineFileSizes() *gomock.Call {
   136  	mr.mock.ctrl.T.Helper()
   137  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EngineFileSizes", reflect.TypeOf((*MockBackend)(nil).EngineFileSizes))
   138  }
   139  
   140  // FetchRemoteTableModels mocks base method
   141  func (m *MockBackend) FetchRemoteTableModels(arg0 context.Context, arg1 string) ([]*model.TableInfo, error) {
   142  	m.ctrl.T.Helper()
   143  	ret := m.ctrl.Call(m, "FetchRemoteTableModels", arg0, arg1)
   144  	ret0, _ := ret[0].([]*model.TableInfo)
   145  	ret1, _ := ret[1].(error)
   146  	return ret0, ret1
   147  }
   148  
   149  // FetchRemoteTableModels indicates an expected call of FetchRemoteTableModels
   150  func (mr *MockBackendMockRecorder) FetchRemoteTableModels(arg0, arg1 interface{}) *gomock.Call {
   151  	mr.mock.ctrl.T.Helper()
   152  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchRemoteTableModels", reflect.TypeOf((*MockBackend)(nil).FetchRemoteTableModels), arg0, arg1)
   153  }
   154  
   155  // FlushAllEngines mocks base method
   156  func (m *MockBackend) FlushAllEngines(arg0 context.Context) error {
   157  	m.ctrl.T.Helper()
   158  	ret := m.ctrl.Call(m, "FlushAllEngines", arg0)
   159  	ret0, _ := ret[0].(error)
   160  	return ret0
   161  }
   162  
   163  // FlushAllEngines indicates an expected call of FlushAllEngines
   164  func (mr *MockBackendMockRecorder) FlushAllEngines(arg0 interface{}) *gomock.Call {
   165  	mr.mock.ctrl.T.Helper()
   166  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FlushAllEngines", reflect.TypeOf((*MockBackend)(nil).FlushAllEngines), arg0)
   167  }
   168  
   169  // FlushEngine mocks base method
   170  func (m *MockBackend) FlushEngine(arg0 context.Context, arg1 uuid.UUID) error {
   171  	m.ctrl.T.Helper()
   172  	ret := m.ctrl.Call(m, "FlushEngine", arg0, arg1)
   173  	ret0, _ := ret[0].(error)
   174  	return ret0
   175  }
   176  
   177  // FlushEngine indicates an expected call of FlushEngine
   178  func (mr *MockBackendMockRecorder) FlushEngine(arg0, arg1 interface{}) *gomock.Call {
   179  	mr.mock.ctrl.T.Helper()
   180  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FlushEngine", reflect.TypeOf((*MockBackend)(nil).FlushEngine), arg0, arg1)
   181  }
   182  
   183  // ImportEngine mocks base method
   184  func (m *MockBackend) ImportEngine(arg0 context.Context, arg1 uuid.UUID) error {
   185  	m.ctrl.T.Helper()
   186  	ret := m.ctrl.Call(m, "ImportEngine", arg0, arg1)
   187  	ret0, _ := ret[0].(error)
   188  	return ret0
   189  }
   190  
   191  // ImportEngine indicates an expected call of ImportEngine
   192  func (mr *MockBackendMockRecorder) ImportEngine(arg0, arg1 interface{}) *gomock.Call {
   193  	mr.mock.ctrl.T.Helper()
   194  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImportEngine", reflect.TypeOf((*MockBackend)(nil).ImportEngine), arg0, arg1)
   195  }
   196  
   197  // LocalWriter mocks base method
   198  func (m *MockBackend) LocalWriter(arg0 context.Context, arg1 *backend.LocalWriterConfig, arg2 uuid.UUID) (backend.EngineWriter, error) {
   199  	m.ctrl.T.Helper()
   200  	ret := m.ctrl.Call(m, "LocalWriter", arg0, arg1, arg2)
   201  	ret0, _ := ret[0].(backend.EngineWriter)
   202  	ret1, _ := ret[1].(error)
   203  	return ret0, ret1
   204  }
   205  
   206  // LocalWriter indicates an expected call of LocalWriter
   207  func (mr *MockBackendMockRecorder) LocalWriter(arg0, arg1, arg2 interface{}) *gomock.Call {
   208  	mr.mock.ctrl.T.Helper()
   209  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalWriter", reflect.TypeOf((*MockBackend)(nil).LocalWriter), arg0, arg1, arg2)
   210  }
   211  
   212  // MakeEmptyRows mocks base method
   213  func (m *MockBackend) MakeEmptyRows() kv.Rows {
   214  	m.ctrl.T.Helper()
   215  	ret := m.ctrl.Call(m, "MakeEmptyRows")
   216  	ret0, _ := ret[0].(kv.Rows)
   217  	return ret0
   218  }
   219  
   220  // MakeEmptyRows indicates an expected call of MakeEmptyRows
   221  func (mr *MockBackendMockRecorder) MakeEmptyRows() *gomock.Call {
   222  	mr.mock.ctrl.T.Helper()
   223  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MakeEmptyRows", reflect.TypeOf((*MockBackend)(nil).MakeEmptyRows))
   224  }
   225  
   226  // NewEncoder mocks base method
   227  func (m *MockBackend) NewEncoder(arg0 table.Table, arg1 *kv.SessionOptions) (kv.Encoder, error) {
   228  	m.ctrl.T.Helper()
   229  	ret := m.ctrl.Call(m, "NewEncoder", arg0, arg1)
   230  	ret0, _ := ret[0].(kv.Encoder)
   231  	ret1, _ := ret[1].(error)
   232  	return ret0, ret1
   233  }
   234  
   235  // NewEncoder indicates an expected call of NewEncoder
   236  func (mr *MockBackendMockRecorder) NewEncoder(arg0, arg1 interface{}) *gomock.Call {
   237  	mr.mock.ctrl.T.Helper()
   238  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewEncoder", reflect.TypeOf((*MockBackend)(nil).NewEncoder), arg0, arg1)
   239  }
   240  
   241  // OpenEngine mocks base method
   242  func (m *MockBackend) OpenEngine(arg0 context.Context, arg1 *backend.EngineConfig, arg2 uuid.UUID) error {
   243  	m.ctrl.T.Helper()
   244  	ret := m.ctrl.Call(m, "OpenEngine", arg0, arg1, arg2)
   245  	ret0, _ := ret[0].(error)
   246  	return ret0
   247  }
   248  
   249  // OpenEngine indicates an expected call of OpenEngine
   250  func (mr *MockBackendMockRecorder) OpenEngine(arg0, arg1, arg2 interface{}) *gomock.Call {
   251  	mr.mock.ctrl.T.Helper()
   252  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenEngine", reflect.TypeOf((*MockBackend)(nil).OpenEngine), arg0, arg1, arg2)
   253  }
   254  
   255  // ResetEngine mocks base method
   256  func (m *MockBackend) ResetEngine(arg0 context.Context, arg1 uuid.UUID) error {
   257  	m.ctrl.T.Helper()
   258  	ret := m.ctrl.Call(m, "ResetEngine", arg0, arg1)
   259  	ret0, _ := ret[0].(error)
   260  	return ret0
   261  }
   262  
   263  // ResetEngine indicates an expected call of ResetEngine
   264  func (mr *MockBackendMockRecorder) ResetEngine(arg0, arg1 interface{}) *gomock.Call {
   265  	mr.mock.ctrl.T.Helper()
   266  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetEngine", reflect.TypeOf((*MockBackend)(nil).ResetEngine), arg0, arg1)
   267  }
   268  
   269  // RetryImportDelay mocks base method
   270  func (m *MockBackend) RetryImportDelay() time.Duration {
   271  	m.ctrl.T.Helper()
   272  	ret := m.ctrl.Call(m, "RetryImportDelay")
   273  	ret0, _ := ret[0].(time.Duration)
   274  	return ret0
   275  }
   276  
   277  // RetryImportDelay indicates an expected call of RetryImportDelay
   278  func (mr *MockBackendMockRecorder) RetryImportDelay() *gomock.Call {
   279  	mr.mock.ctrl.T.Helper()
   280  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RetryImportDelay", reflect.TypeOf((*MockBackend)(nil).RetryImportDelay))
   281  }
   282  
   283  // ShouldPostProcess mocks base method
   284  func (m *MockBackend) ShouldPostProcess() bool {
   285  	m.ctrl.T.Helper()
   286  	ret := m.ctrl.Call(m, "ShouldPostProcess")
   287  	ret0, _ := ret[0].(bool)
   288  	return ret0
   289  }
   290  
   291  // ShouldPostProcess indicates an expected call of ShouldPostProcess
   292  func (mr *MockBackendMockRecorder) ShouldPostProcess() *gomock.Call {
   293  	mr.mock.ctrl.T.Helper()
   294  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldPostProcess", reflect.TypeOf((*MockBackend)(nil).ShouldPostProcess))
   295  }
   296  
   297  // MockEngineWriter is a mock of EngineWriter interface
   298  type MockEngineWriter struct {
   299  	ctrl     *gomock.Controller
   300  	recorder *MockEngineWriterMockRecorder
   301  }
   302  
   303  // MockEngineWriterMockRecorder is the mock recorder for MockEngineWriter
   304  type MockEngineWriterMockRecorder struct {
   305  	mock *MockEngineWriter
   306  }
   307  
   308  // NewMockEngineWriter creates a new mock instance
   309  func NewMockEngineWriter(ctrl *gomock.Controller) *MockEngineWriter {
   310  	mock := &MockEngineWriter{ctrl: ctrl}
   311  	mock.recorder = &MockEngineWriterMockRecorder{mock}
   312  	return mock
   313  }
   314  
   315  // EXPECT returns an object that allows the caller to indicate expected use
   316  func (m *MockEngineWriter) EXPECT() *MockEngineWriterMockRecorder {
   317  	return m.recorder
   318  }
   319  
   320  // AppendRows mocks base method
   321  func (m *MockEngineWriter) AppendRows(arg0 context.Context, arg1 string, arg2 []string, arg3 kv.Rows) error {
   322  	m.ctrl.T.Helper()
   323  	ret := m.ctrl.Call(m, "AppendRows", arg0, arg1, arg2, arg3)
   324  	ret0, _ := ret[0].(error)
   325  	return ret0
   326  }
   327  
   328  // AppendRows indicates an expected call of AppendRows
   329  func (mr *MockEngineWriterMockRecorder) AppendRows(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
   330  	mr.mock.ctrl.T.Helper()
   331  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendRows", reflect.TypeOf((*MockEngineWriter)(nil).AppendRows), arg0, arg1, arg2, arg3)
   332  }
   333  
   334  // Close mocks base method
   335  func (m *MockEngineWriter) Close(arg0 context.Context) (backend.ChunkFlushStatus, error) {
   336  	m.ctrl.T.Helper()
   337  	ret := m.ctrl.Call(m, "Close", arg0)
   338  	ret0, _ := ret[0].(backend.ChunkFlushStatus)
   339  	ret1, _ := ret[1].(error)
   340  	return ret0, ret1
   341  }
   342  
   343  // Close indicates an expected call of Close
   344  func (mr *MockEngineWriterMockRecorder) Close(arg0 interface{}) *gomock.Call {
   345  	mr.mock.ctrl.T.Helper()
   346  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockEngineWriter)(nil).Close), arg0)
   347  }
   348  
   349  // IsSynced mocks base method
   350  func (m *MockEngineWriter) IsSynced() bool {
   351  	m.ctrl.T.Helper()
   352  	ret := m.ctrl.Call(m, "IsSynced")
   353  	ret0, _ := ret[0].(bool)
   354  	return ret0
   355  }
   356  
   357  // IsSynced indicates an expected call of IsSynced
   358  func (mr *MockEngineWriterMockRecorder) IsSynced() *gomock.Call {
   359  	mr.mock.ctrl.T.Helper()
   360  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSynced", reflect.TypeOf((*MockEngineWriter)(nil).IsSynced))
   361  }