github.com/rohankumardubey/aresdb@v0.0.2-0.20190517170215-e54e3ca06b9c/diskstore/mocks/DiskStore.go (about)

     1  //  Copyright (c) 2017-2018 Uber Technologies, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated by mockery v1.0.0
    16  package mocks
    17  
    18  import io "io"
    19  import mock "github.com/stretchr/testify/mock"
    20  import utils "github.com/uber/aresdb/utils"
    21  
    22  // DiskStore is an autogenerated mock type for the DiskStore type
    23  type DiskStore struct {
    24  	mock.Mock
    25  }
    26  
    27  // DeleteBatchVersions provides a mock function with given fields: table, shard, batchID, batchVersion, seqNum
    28  func (_m *DiskStore) DeleteBatchVersions(table string, shard int, batchID int, batchVersion uint32, seqNum uint32) error {
    29  	ret := _m.Called(table, shard, batchID, batchVersion, seqNum)
    30  
    31  	var r0 error
    32  	if rf, ok := ret.Get(0).(func(string, int, int, uint32, uint32) error); ok {
    33  		r0 = rf(table, shard, batchID, batchVersion, seqNum)
    34  	} else {
    35  		r0 = ret.Error(0)
    36  	}
    37  
    38  	return r0
    39  }
    40  
    41  // DeleteBatches provides a mock function with given fields: table, shard, batchIDStart, batchIDEnd
    42  func (_m *DiskStore) DeleteBatches(table string, shard int, batchIDStart int, batchIDEnd int) (int, error) {
    43  	ret := _m.Called(table, shard, batchIDStart, batchIDEnd)
    44  
    45  	var r0 int
    46  	if rf, ok := ret.Get(0).(func(string, int, int, int) int); ok {
    47  		r0 = rf(table, shard, batchIDStart, batchIDEnd)
    48  	} else {
    49  		r0 = ret.Get(0).(int)
    50  	}
    51  
    52  	var r1 error
    53  	if rf, ok := ret.Get(1).(func(string, int, int, int) error); ok {
    54  		r1 = rf(table, shard, batchIDStart, batchIDEnd)
    55  	} else {
    56  		r1 = ret.Error(1)
    57  	}
    58  
    59  	return r0, r1
    60  }
    61  
    62  // DeleteColumn provides a mock function with given fields: table, column, shard
    63  func (_m *DiskStore) DeleteColumn(table string, column int, shard int) error {
    64  	ret := _m.Called(table, column, shard)
    65  
    66  	var r0 error
    67  	if rf, ok := ret.Get(0).(func(string, int, int) error); ok {
    68  		r0 = rf(table, column, shard)
    69  	} else {
    70  		r0 = ret.Error(0)
    71  	}
    72  
    73  	return r0
    74  }
    75  
    76  // DeleteLogFile provides a mock function with given fields: table, shard, creationTime
    77  func (_m *DiskStore) DeleteLogFile(table string, shard int, creationTime int64) error {
    78  	ret := _m.Called(table, shard, creationTime)
    79  
    80  	var r0 error
    81  	if rf, ok := ret.Get(0).(func(string, int, int64) error); ok {
    82  		r0 = rf(table, shard, creationTime)
    83  	} else {
    84  		r0 = ret.Error(0)
    85  	}
    86  
    87  	return r0
    88  }
    89  
    90  // DeleteSnapshot provides a mock function with given fields: table, shard, redoLogFile, offset
    91  func (_m *DiskStore) DeleteSnapshot(table string, shard int, redoLogFile int64, offset uint32) error {
    92  	ret := _m.Called(table, shard, redoLogFile, offset)
    93  
    94  	var r0 error
    95  	if rf, ok := ret.Get(0).(func(string, int, int64, uint32) error); ok {
    96  		r0 = rf(table, shard, redoLogFile, offset)
    97  	} else {
    98  		r0 = ret.Error(0)
    99  	}
   100  
   101  	return r0
   102  }
   103  
   104  // DeleteTableShard provides a mock function with given fields: table, shard
   105  func (_m *DiskStore) DeleteTableShard(table string, shard int) error {
   106  	ret := _m.Called(table, shard)
   107  
   108  	var r0 error
   109  	if rf, ok := ret.Get(0).(func(string, int) error); ok {
   110  		r0 = rf(table, shard)
   111  	} else {
   112  		r0 = ret.Error(0)
   113  	}
   114  
   115  	return r0
   116  }
   117  
   118  // ListLogFiles provides a mock function with given fields: table, shard
   119  func (_m *DiskStore) ListLogFiles(table string, shard int) ([]int64, error) {
   120  	ret := _m.Called(table, shard)
   121  
   122  	var r0 []int64
   123  	if rf, ok := ret.Get(0).(func(string, int) []int64); ok {
   124  		r0 = rf(table, shard)
   125  	} else {
   126  		if ret.Get(0) != nil {
   127  			r0 = ret.Get(0).([]int64)
   128  		}
   129  	}
   130  
   131  	var r1 error
   132  	if rf, ok := ret.Get(1).(func(string, int) error); ok {
   133  		r1 = rf(table, shard)
   134  	} else {
   135  		r1 = ret.Error(1)
   136  	}
   137  
   138  	return r0, r1
   139  }
   140  
   141  // ListSnapshotBatches provides a mock function with given fields: table, shard, redoLogFile, offset
   142  func (_m *DiskStore) ListSnapshotBatches(table string, shard int, redoLogFile int64, offset uint32) ([]int, error) {
   143  	ret := _m.Called(table, shard, redoLogFile, offset)
   144  
   145  	var r0 []int
   146  	if rf, ok := ret.Get(0).(func(string, int, int64, uint32) []int); ok {
   147  		r0 = rf(table, shard, redoLogFile, offset)
   148  	} else {
   149  		if ret.Get(0) != nil {
   150  			r0 = ret.Get(0).([]int)
   151  		}
   152  	}
   153  
   154  	var r1 error
   155  	if rf, ok := ret.Get(1).(func(string, int, int64, uint32) error); ok {
   156  		r1 = rf(table, shard, redoLogFile, offset)
   157  	} else {
   158  		r1 = ret.Error(1)
   159  	}
   160  
   161  	return r0, r1
   162  }
   163  
   164  // ListSnapshotVectorPartyFiles provides a mock function with given fields: table, shard, redoLogFile, offset, batchID
   165  func (_m *DiskStore) ListSnapshotVectorPartyFiles(table string, shard int, redoLogFile int64, offset uint32, batchID int) ([]int, error) {
   166  	ret := _m.Called(table, shard, redoLogFile, offset, batchID)
   167  
   168  	var r0 []int
   169  	if rf, ok := ret.Get(0).(func(string, int, int64, uint32, int) []int); ok {
   170  		r0 = rf(table, shard, redoLogFile, offset, batchID)
   171  	} else {
   172  		if ret.Get(0) != nil {
   173  			r0 = ret.Get(0).([]int)
   174  		}
   175  	}
   176  
   177  	var r1 error
   178  	if rf, ok := ret.Get(1).(func(string, int, int64, uint32, int) error); ok {
   179  		r1 = rf(table, shard, redoLogFile, offset, batchID)
   180  	} else {
   181  		r1 = ret.Error(1)
   182  	}
   183  
   184  	return r0, r1
   185  }
   186  
   187  // OpenLogFileForAppend provides a mock function with given fields: table, shard, creationTime
   188  func (_m *DiskStore) OpenLogFileForAppend(table string, shard int, creationTime int64) (io.WriteCloser, error) {
   189  	ret := _m.Called(table, shard, creationTime)
   190  
   191  	var r0 io.WriteCloser
   192  	if rf, ok := ret.Get(0).(func(string, int, int64) io.WriteCloser); ok {
   193  		r0 = rf(table, shard, creationTime)
   194  	} else {
   195  		if ret.Get(0) != nil {
   196  			r0 = ret.Get(0).(io.WriteCloser)
   197  		}
   198  	}
   199  
   200  	var r1 error
   201  	if rf, ok := ret.Get(1).(func(string, int, int64) error); ok {
   202  		r1 = rf(table, shard, creationTime)
   203  	} else {
   204  		r1 = ret.Error(1)
   205  	}
   206  
   207  	return r0, r1
   208  }
   209  
   210  // OpenLogFileForReplay provides a mock function with given fields: table, shard, creationTime
   211  func (_m *DiskStore) OpenLogFileForReplay(table string, shard int, creationTime int64) (utils.ReaderSeekerCloser, error) {
   212  	ret := _m.Called(table, shard, creationTime)
   213  
   214  	var r0 utils.ReaderSeekerCloser
   215  	if rf, ok := ret.Get(0).(func(string, int, int64) utils.ReaderSeekerCloser); ok {
   216  		r0 = rf(table, shard, creationTime)
   217  	} else {
   218  		if ret.Get(0) != nil {
   219  			r0 = ret.Get(0).(utils.ReaderSeekerCloser)
   220  		}
   221  	}
   222  
   223  	var r1 error
   224  	if rf, ok := ret.Get(1).(func(string, int, int64) error); ok {
   225  		r1 = rf(table, shard, creationTime)
   226  	} else {
   227  		r1 = ret.Error(1)
   228  	}
   229  
   230  	return r0, r1
   231  }
   232  
   233  // OpenSnapshotVectorPartyFileForRead provides a mock function with given fields: table, shard, redoLogFile, offset, batchID, columnID
   234  func (_m *DiskStore) OpenSnapshotVectorPartyFileForRead(table string, shard int, redoLogFile int64, offset uint32, batchID int, columnID int) (io.ReadCloser, error) {
   235  	ret := _m.Called(table, shard, redoLogFile, offset, batchID, columnID)
   236  
   237  	var r0 io.ReadCloser
   238  	if rf, ok := ret.Get(0).(func(string, int, int64, uint32, int, int) io.ReadCloser); ok {
   239  		r0 = rf(table, shard, redoLogFile, offset, batchID, columnID)
   240  	} else {
   241  		if ret.Get(0) != nil {
   242  			r0 = ret.Get(0).(io.ReadCloser)
   243  		}
   244  	}
   245  
   246  	var r1 error
   247  	if rf, ok := ret.Get(1).(func(string, int, int64, uint32, int, int) error); ok {
   248  		r1 = rf(table, shard, redoLogFile, offset, batchID, columnID)
   249  	} else {
   250  		r1 = ret.Error(1)
   251  	}
   252  
   253  	return r0, r1
   254  }
   255  
   256  // OpenSnapshotVectorPartyFileForWrite provides a mock function with given fields: table, shard, redoLogFile, offset, batchID, columnID
   257  func (_m *DiskStore) OpenSnapshotVectorPartyFileForWrite(table string, shard int, redoLogFile int64, offset uint32, batchID int, columnID int) (io.WriteCloser, error) {
   258  	ret := _m.Called(table, shard, redoLogFile, offset, batchID, columnID)
   259  
   260  	var r0 io.WriteCloser
   261  	if rf, ok := ret.Get(0).(func(string, int, int64, uint32, int, int) io.WriteCloser); ok {
   262  		r0 = rf(table, shard, redoLogFile, offset, batchID, columnID)
   263  	} else {
   264  		if ret.Get(0) != nil {
   265  			r0 = ret.Get(0).(io.WriteCloser)
   266  		}
   267  	}
   268  
   269  	var r1 error
   270  	if rf, ok := ret.Get(1).(func(string, int, int64, uint32, int, int) error); ok {
   271  		r1 = rf(table, shard, redoLogFile, offset, batchID, columnID)
   272  	} else {
   273  		r1 = ret.Error(1)
   274  	}
   275  
   276  	return r0, r1
   277  }
   278  
   279  // OpenVectorPartyFileForRead provides a mock function with given fields: table, column, shard, batchID, batchVersion, seqNum
   280  func (_m *DiskStore) OpenVectorPartyFileForRead(table string, column int, shard int, batchID int, batchVersion uint32, seqNum uint32) (io.ReadCloser, error) {
   281  	ret := _m.Called(table, column, shard, batchID, batchVersion, seqNum)
   282  
   283  	var r0 io.ReadCloser
   284  	if rf, ok := ret.Get(0).(func(string, int, int, int, uint32, uint32) io.ReadCloser); ok {
   285  		r0 = rf(table, column, shard, batchID, batchVersion, seqNum)
   286  	} else {
   287  		if ret.Get(0) != nil {
   288  			r0 = ret.Get(0).(io.ReadCloser)
   289  		}
   290  	}
   291  
   292  	var r1 error
   293  	if rf, ok := ret.Get(1).(func(string, int, int, int, uint32, uint32) error); ok {
   294  		r1 = rf(table, column, shard, batchID, batchVersion, seqNum)
   295  	} else {
   296  		r1 = ret.Error(1)
   297  	}
   298  
   299  	return r0, r1
   300  }
   301  
   302  // OpenVectorPartyFileForWrite provides a mock function with given fields: table, column, shard, batchID, batchVersion, seqNum
   303  func (_m *DiskStore) OpenVectorPartyFileForWrite(table string, column int, shard int, batchID int, batchVersion uint32, seqNum uint32) (io.WriteCloser, error) {
   304  	ret := _m.Called(table, column, shard, batchID, batchVersion, seqNum)
   305  
   306  	var r0 io.WriteCloser
   307  	if rf, ok := ret.Get(0).(func(string, int, int, int, uint32, uint32) io.WriteCloser); ok {
   308  		r0 = rf(table, column, shard, batchID, batchVersion, seqNum)
   309  	} else {
   310  		if ret.Get(0) != nil {
   311  			r0 = ret.Get(0).(io.WriteCloser)
   312  		}
   313  	}
   314  
   315  	var r1 error
   316  	if rf, ok := ret.Get(1).(func(string, int, int, int, uint32, uint32) error); ok {
   317  		r1 = rf(table, column, shard, batchID, batchVersion, seqNum)
   318  	} else {
   319  		r1 = ret.Error(1)
   320  	}
   321  
   322  	return r0, r1
   323  }
   324  
   325  // TruncateLogFile provides a mock function with given fields: table, shard, creationTime, offset
   326  func (_m *DiskStore) TruncateLogFile(table string, shard int, creationTime int64, offset int64) error {
   327  	ret := _m.Called(table, shard, creationTime, offset)
   328  
   329  	var r0 error
   330  	if rf, ok := ret.Get(0).(func(string, int, int64, int64) error); ok {
   331  		r0 = rf(table, shard, creationTime, offset)
   332  	} else {
   333  		r0 = ret.Error(0)
   334  	}
   335  
   336  	return r0
   337  }