github.com/rohankumardubey/aresdb@v0.0.2-0.20190517170215-e54e3ca06b9c/metastore/mocks/metastore.go (about) 1 // Code generated by mockery v1.0.0 2 package mocks 3 4 import "github.com/uber/aresdb/metastore/common" 5 import ( 6 "github.com/stretchr/testify/mock" 7 ) 8 9 // MetaStore is an autogenerated mock type for the MetaStore type 10 type MetaStore struct { 11 mock.Mock 12 } 13 14 // AddArchiveBatchVersion provides a mock function with given fields: table, shard, batchID, version, seqNum, batchSize 15 func (_m *MetaStore) AddArchiveBatchVersion(table string, shard int, batchID int, version uint32, seqNum uint32, batchSize int) error { 16 ret := _m.Called(table, shard, batchID, version, seqNum, batchSize) 17 18 var r0 error 19 if rf, ok := ret.Get(0).(func(string, int, int, uint32, uint32, int) error); ok { 20 r0 = rf(table, shard, batchID, version, seqNum, batchSize) 21 } else { 22 r0 = ret.Error(0) 23 } 24 25 return r0 26 } 27 28 // AddColumn provides a mock function with given fields: table, column, appendToArchivingSortOrder 29 func (_m *MetaStore) AddColumn(table string, column common.Column, appendToArchivingSortOrder bool) error { 30 ret := _m.Called(table, column, appendToArchivingSortOrder) 31 32 var r0 error 33 if rf, ok := ret.Get(0).(func(string, common.Column, bool) error); ok { 34 r0 = rf(table, column, appendToArchivingSortOrder) 35 } else { 36 r0 = ret.Error(0) 37 } 38 39 return r0 40 } 41 42 // CreateTable provides a mock function with given fields: table 43 func (_m *MetaStore) CreateTable(table *common.Table) error { 44 ret := _m.Called(table) 45 46 var r0 error 47 if rf, ok := ret.Get(0).(func(*common.Table) error); ok { 48 r0 = rf(table) 49 } else { 50 r0 = ret.Error(0) 51 } 52 53 return r0 54 } 55 56 // DeleteColumn provides a mock function with given fields: table, column 57 func (_m *MetaStore) DeleteColumn(table string, column string) error { 58 ret := _m.Called(table, column) 59 60 var r0 error 61 if rf, ok := ret.Get(0).(func(string, string) error); ok { 62 r0 = rf(table, column) 63 } else { 64 r0 = ret.Error(0) 65 } 66 67 return r0 68 } 69 70 // DeleteTable provides a mock function with given fields: name 71 func (_m *MetaStore) DeleteTable(name string) error { 72 ret := _m.Called(name) 73 74 var r0 error 75 if rf, ok := ret.Get(0).(func(string) error); ok { 76 r0 = rf(name) 77 } else { 78 r0 = ret.Error(0) 79 } 80 81 return r0 82 } 83 84 // ExtendEnumDict provides a mock function with given fields: table, column, enumCases 85 func (_m *MetaStore) ExtendEnumDict(table string, column string, enumCases []string) ([]int, error) { 86 ret := _m.Called(table, column, enumCases) 87 88 var r0 []int 89 if rf, ok := ret.Get(0).(func(string, string, []string) []int); ok { 90 r0 = rf(table, column, enumCases) 91 } else { 92 if ret.Get(0) != nil { 93 r0 = ret.Get(0).([]int) 94 } 95 } 96 97 var r1 error 98 if rf, ok := ret.Get(1).(func(string, string, []string) error); ok { 99 r1 = rf(table, column, enumCases) 100 } else { 101 r1 = ret.Error(1) 102 } 103 104 return r0, r1 105 } 106 107 // GetArchiveBatchVersion provides a mock function with given fields: table, shard, batchID, cutoff 108 func (_m *MetaStore) GetArchiveBatchVersion(table string, shard int, batchID int, cutoff uint32) (uint32, uint32, int, error) { 109 ret := _m.Called(table, shard, batchID, cutoff) 110 111 var r0 uint32 112 if rf, ok := ret.Get(0).(func(string, int, int, uint32) uint32); ok { 113 r0 = rf(table, shard, batchID, cutoff) 114 } else { 115 r0 = ret.Get(0).(uint32) 116 } 117 118 var r1 uint32 119 if rf, ok := ret.Get(1).(func(string, int, int, uint32) uint32); ok { 120 r1 = rf(table, shard, batchID, cutoff) 121 } else { 122 r1 = ret.Get(1).(uint32) 123 } 124 125 var r2 int 126 if rf, ok := ret.Get(2).(func(string, int, int, uint32) int); ok { 127 r2 = rf(table, shard, batchID, cutoff) 128 } else { 129 r2 = ret.Get(2).(int) 130 } 131 132 var r3 error 133 if rf, ok := ret.Get(3).(func(string, int, int, uint32) error); ok { 134 r3 = rf(table, shard, batchID, cutoff) 135 } else { 136 r3 = ret.Error(3) 137 } 138 139 return r0, r1, r2, r3 140 } 141 142 // GetArchivingCutoff provides a mock function with given fields: table, shard 143 func (_m *MetaStore) GetArchivingCutoff(table string, shard int) (uint32, error) { 144 ret := _m.Called(table, shard) 145 146 var r0 uint32 147 if rf, ok := ret.Get(0).(func(string, int) uint32); ok { 148 r0 = rf(table, shard) 149 } else { 150 r0 = ret.Get(0).(uint32) 151 } 152 153 var r1 error 154 if rf, ok := ret.Get(1).(func(string, int) error); ok { 155 r1 = rf(table, shard) 156 } else { 157 r1 = ret.Error(1) 158 } 159 160 return r0, r1 161 } 162 163 // GetBackfillProgressInfo provides a mock function with given fields: table, shard 164 func (_m *MetaStore) GetBackfillProgressInfo(table string, shard int) (int64, uint32, error) { 165 ret := _m.Called(table, shard) 166 167 var r0 int64 168 if rf, ok := ret.Get(0).(func(string, int) int64); ok { 169 r0 = rf(table, shard) 170 } else { 171 r0 = ret.Get(0).(int64) 172 } 173 174 var r1 uint32 175 if rf, ok := ret.Get(1).(func(string, int) uint32); ok { 176 r1 = rf(table, shard) 177 } else { 178 r1 = ret.Get(1).(uint32) 179 } 180 181 var r2 error 182 if rf, ok := ret.Get(2).(func(string, int) error); ok { 183 r2 = rf(table, shard) 184 } else { 185 r2 = ret.Error(2) 186 } 187 188 return r0, r1, r2 189 } 190 191 // GetEnumDict provides a mock function with given fields: table, column 192 func (_m *MetaStore) GetEnumDict(table string, column string) ([]string, error) { 193 ret := _m.Called(table, column) 194 195 var r0 []string 196 if rf, ok := ret.Get(0).(func(string, string) []string); ok { 197 r0 = rf(table, column) 198 } else { 199 if ret.Get(0) != nil { 200 r0 = ret.Get(0).([]string) 201 } 202 } 203 204 var r1 error 205 if rf, ok := ret.Get(1).(func(string, string) error); ok { 206 r1 = rf(table, column) 207 } else { 208 r1 = ret.Error(1) 209 } 210 211 return r0, r1 212 } 213 214 // GetOwnedShards provides a mock function with given fields: table 215 func (_m *MetaStore) GetOwnedShards(table string) ([]int, error) { 216 ret := _m.Called(table) 217 218 var r0 []int 219 if rf, ok := ret.Get(0).(func(string) []int); ok { 220 r0 = rf(table) 221 } else { 222 if ret.Get(0) != nil { 223 r0 = ret.Get(0).([]int) 224 } 225 } 226 227 var r1 error 228 if rf, ok := ret.Get(1).(func(string) error); ok { 229 r1 = rf(table) 230 } else { 231 r1 = ret.Error(1) 232 } 233 234 return r0, r1 235 } 236 237 // GetSnapshotProgress provides a mock function with given fields: table, shard 238 func (_m *MetaStore) GetSnapshotProgress(table string, shard int) (int64, uint32, int32, uint32, error) { 239 ret := _m.Called(table, shard) 240 241 var r0 int64 242 if rf, ok := ret.Get(0).(func(string, int) int64); ok { 243 r0 = rf(table, shard) 244 } else { 245 r0 = ret.Get(0).(int64) 246 } 247 248 var r1 uint32 249 if rf, ok := ret.Get(1).(func(string, int) uint32); ok { 250 r1 = rf(table, shard) 251 } else { 252 r1 = ret.Get(1).(uint32) 253 } 254 255 var r2 int32 256 if rf, ok := ret.Get(2).(func(string, int) int32); ok { 257 r2 = rf(table, shard) 258 } else { 259 r2 = ret.Get(2).(int32) 260 } 261 262 var r3 uint32 263 if rf, ok := ret.Get(3).(func(string, int) uint32); ok { 264 r3 = rf(table, shard) 265 } else { 266 r3 = ret.Get(3).(uint32) 267 } 268 269 var r4 error 270 if rf, ok := ret.Get(4).(func(string, int) error); ok { 271 r4 = rf(table, shard) 272 } else { 273 r4 = ret.Error(4) 274 } 275 276 return r0, r1, r2, r3, r4 277 } 278 279 // GetTable provides a mock function with given fields: name 280 func (_m *MetaStore) GetTable(name string) (*common.Table, error) { 281 ret := _m.Called(name) 282 283 var r0 *common.Table 284 if rf, ok := ret.Get(0).(func(string) *common.Table); ok { 285 r0 = rf(name) 286 } else { 287 if ret.Get(0) != nil { 288 r0 = ret.Get(0).(*common.Table) 289 } 290 } 291 292 var r1 error 293 if rf, ok := ret.Get(1).(func(string) error); ok { 294 r1 = rf(name) 295 } else { 296 r1 = ret.Error(1) 297 } 298 299 return r0, r1 300 } 301 302 // ListTables provides a mock function with given fields: 303 func (_m *MetaStore) ListTables() ([]string, error) { 304 ret := _m.Called() 305 306 var r0 []string 307 if rf, ok := ret.Get(0).(func() []string); ok { 308 r0 = rf() 309 } else { 310 if ret.Get(0) != nil { 311 r0 = ret.Get(0).([]string) 312 } 313 } 314 315 var r1 error 316 if rf, ok := ret.Get(1).(func() error); ok { 317 r1 = rf() 318 } else { 319 r1 = ret.Error(1) 320 } 321 322 return r0, r1 323 } 324 325 // PurgeArchiveBatches provides a mock function with given fields: table, shard, batchIDStart, batchIDEnd 326 func (_m *MetaStore) PurgeArchiveBatches(table string, shard int, batchIDStart int, batchIDEnd int) error { 327 ret := _m.Called(table, shard, batchIDStart, batchIDEnd) 328 329 var r0 error 330 if rf, ok := ret.Get(0).(func(string, int, int, int) error); ok { 331 r0 = rf(table, shard, batchIDStart, batchIDEnd) 332 } else { 333 r0 = ret.Error(0) 334 } 335 336 return r0 337 } 338 339 // UpdateArchivingCutoff provides a mock function with given fields: table, shard, cutoff 340 func (_m *MetaStore) UpdateArchivingCutoff(table string, shard int, cutoff uint32) error { 341 ret := _m.Called(table, shard, cutoff) 342 343 var r0 error 344 if rf, ok := ret.Get(0).(func(string, int, uint32) error); ok { 345 r0 = rf(table, shard, cutoff) 346 } else { 347 r0 = ret.Error(0) 348 } 349 350 return r0 351 } 352 353 // UpdateBackfillProgress provides a mock function with given fields: table, shard, redoLogFile, offset 354 func (_m *MetaStore) UpdateBackfillProgress(table string, shard int, redoLogFile int64, offset uint32) error { 355 ret := _m.Called(table, shard, redoLogFile, offset) 356 357 var r0 error 358 if rf, ok := ret.Get(0).(func(string, int, int64, uint32) error); ok { 359 r0 = rf(table, shard, redoLogFile, offset) 360 } else { 361 r0 = ret.Error(0) 362 } 363 364 return r0 365 } 366 367 // UpdateColumn provides a mock function with given fields: table, column, config 368 func (_m *MetaStore) UpdateColumn(table string, column string, config common.ColumnConfig) error { 369 ret := _m.Called(table, column, config) 370 371 var r0 error 372 if rf, ok := ret.Get(0).(func(string, string, common.ColumnConfig) error); ok { 373 r0 = rf(table, column, config) 374 } else { 375 r0 = ret.Error(0) 376 } 377 378 return r0 379 } 380 381 // UpdateSnapshotProgress provides a mock function with given fields: table, shard, redoLogFile, upsertBatchOffset, lastReadBatchID, lastReadBatchOffset 382 func (_m *MetaStore) UpdateSnapshotProgress(table string, shard int, redoLogFile int64, upsertBatchOffset uint32, lastReadBatchID int32, lastReadBatchOffset uint32) error { 383 ret := _m.Called(table, shard, redoLogFile, upsertBatchOffset, lastReadBatchID, lastReadBatchOffset) 384 385 var r0 error 386 if rf, ok := ret.Get(0).(func(string, int, int64, uint32, int32, uint32) error); ok { 387 r0 = rf(table, shard, redoLogFile, upsertBatchOffset, lastReadBatchID, lastReadBatchOffset) 388 } else { 389 r0 = ret.Error(0) 390 } 391 392 return r0 393 } 394 395 // UpdateTable provides a mock function with given fields: table 396 func (_m *MetaStore) UpdateTable(table common.Table) error { 397 ret := _m.Called(table) 398 399 var r0 error 400 if rf, ok := ret.Get(0).(func(common.Table) error); ok { 401 r0 = rf(table) 402 } else { 403 r0 = ret.Error(0) 404 } 405 406 return r0 407 } 408 409 // UpdateTableConfig provides a mock function with given fields: table, config 410 func (_m *MetaStore) UpdateTableConfig(table string, config common.TableConfig) error { 411 ret := _m.Called(table, config) 412 413 var r0 error 414 if rf, ok := ret.Get(0).(func(string, common.TableConfig) error); ok { 415 r0 = rf(table, config) 416 } else { 417 r0 = ret.Error(0) 418 } 419 420 return r0 421 } 422 423 // WatchEnumDictEvents provides a mock function with given fields: table, column, startCase 424 func (_m *MetaStore) WatchEnumDictEvents(table string, column string, startCase int) (<-chan string, chan<- struct{}, error) { 425 ret := _m.Called(table, column, startCase) 426 427 var r0 <-chan string 428 if rf, ok := ret.Get(0).(func(string, string, int) <-chan string); ok { 429 r0 = rf(table, column, startCase) 430 } else { 431 if ret.Get(0) != nil { 432 r0 = ret.Get(0).(<-chan string) 433 } 434 } 435 436 var r1 chan<- struct{} 437 if rf, ok := ret.Get(1).(func(string, string, int) chan<- struct{}); ok { 438 r1 = rf(table, column, startCase) 439 } else { 440 if ret.Get(1) != nil { 441 r1 = ret.Get(1).(chan<- struct{}) 442 } 443 } 444 445 var r2 error 446 if rf, ok := ret.Get(2).(func(string, string, int) error); ok { 447 r2 = rf(table, column, startCase) 448 } else { 449 r2 = ret.Error(2) 450 } 451 452 return r0, r1, r2 453 } 454 455 // WatchShardOwnershipEvents provides a mock function with given fields: 456 func (_m *MetaStore) WatchShardOwnershipEvents() (<-chan common.ShardOwnership, chan<- struct{}, error) { 457 ret := _m.Called() 458 459 var r0 <-chan common.ShardOwnership 460 if rf, ok := ret.Get(0).(func() <-chan common.ShardOwnership); ok { 461 r0 = rf() 462 } else { 463 if ret.Get(0) != nil { 464 r0 = ret.Get(0).(<-chan common.ShardOwnership) 465 } 466 } 467 468 var r1 chan<- struct{} 469 if rf, ok := ret.Get(1).(func() chan<- struct{}); ok { 470 r1 = rf() 471 } else { 472 if ret.Get(1) != nil { 473 r1 = ret.Get(1).(chan<- struct{}) 474 } 475 } 476 477 var r2 error 478 if rf, ok := ret.Get(2).(func() error); ok { 479 r2 = rf() 480 } else { 481 r2 = ret.Error(2) 482 } 483 484 return r0, r1, r2 485 } 486 487 // WatchTableListEvents provides a mock function with given fields: 488 func (_m *MetaStore) WatchTableListEvents() (<-chan []string, chan<- struct{}, error) { 489 ret := _m.Called() 490 491 var r0 <-chan []string 492 if rf, ok := ret.Get(0).(func() <-chan []string); ok { 493 r0 = rf() 494 } else { 495 if ret.Get(0) != nil { 496 r0 = ret.Get(0).(<-chan []string) 497 } 498 } 499 500 var r1 chan<- struct{} 501 if rf, ok := ret.Get(1).(func() chan<- struct{}); ok { 502 r1 = rf() 503 } else { 504 if ret.Get(1) != nil { 505 r1 = ret.Get(1).(chan<- struct{}) 506 } 507 } 508 509 var r2 error 510 if rf, ok := ret.Get(2).(func() error); ok { 511 r2 = rf() 512 } else { 513 r2 = ret.Error(2) 514 } 515 516 return r0, r1, r2 517 } 518 519 // WatchTableSchemaEvents provides a mock function with given fields: 520 func (_m *MetaStore) WatchTableSchemaEvents() (<-chan *common.Table, chan<- struct{}, error) { 521 ret := _m.Called() 522 523 var r0 <-chan *common.Table 524 if rf, ok := ret.Get(0).(func() <-chan *common.Table); ok { 525 r0 = rf() 526 } else { 527 if ret.Get(0) != nil { 528 r0 = ret.Get(0).(<-chan *common.Table) 529 } 530 } 531 532 var r1 chan<- struct{} 533 if rf, ok := ret.Get(1).(func() chan<- struct{}); ok { 534 r1 = rf() 535 } else { 536 if ret.Get(1) != nil { 537 r1 = ret.Get(1).(chan<- struct{}) 538 } 539 } 540 541 var r2 error 542 if rf, ok := ret.Get(2).(func() error); ok { 543 r2 = rf() 544 } else { 545 r2 = ret.Error(2) 546 } 547 548 return r0, r1, r2 549 }