github.com/m3db/m3@v1.5.1-0.20231129193456-75a402aa583b/src/dbnode/storage/series/buffer_mock.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: ../../storage/series/buffer.go 3 4 // Copyright (c) 2022 Uber Technologies, Inc. 5 // 6 // Permission is hereby granted, free of charge, to any person obtaining a copy 7 // of this software and associated documentation files (the "Software"), to deal 8 // in the Software without restriction, including without limitation the rights 9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 // copies of the Software, and to permit persons to whom the Software is 11 // furnished to do so, subject to the following conditions: 12 // 13 // The above copyright notice and this permission notice shall be included in 14 // all copies or substantial portions of the Software. 15 // 16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 // THE SOFTWARE. 23 24 // Package series is a generated GoMock package. 25 package series 26 27 import ( 28 "reflect" 29 30 "github.com/m3db/m3/src/dbnode/namespace" 31 "github.com/m3db/m3/src/dbnode/persist" 32 "github.com/m3db/m3/src/dbnode/storage/block" 33 "github.com/m3db/m3/src/dbnode/x/xio" 34 "github.com/m3db/m3/src/x/context" 35 "github.com/m3db/m3/src/x/ident" 36 "github.com/m3db/m3/src/x/time" 37 38 "github.com/golang/mock/gomock" 39 ) 40 41 // MockdatabaseBuffer is a mock of databaseBuffer interface. 42 type MockdatabaseBuffer struct { 43 ctrl *gomock.Controller 44 recorder *MockdatabaseBufferMockRecorder 45 } 46 47 // MockdatabaseBufferMockRecorder is the mock recorder for MockdatabaseBuffer. 48 type MockdatabaseBufferMockRecorder struct { 49 mock *MockdatabaseBuffer 50 } 51 52 // NewMockdatabaseBuffer creates a new mock instance. 53 func NewMockdatabaseBuffer(ctrl *gomock.Controller) *MockdatabaseBuffer { 54 mock := &MockdatabaseBuffer{ctrl: ctrl} 55 mock.recorder = &MockdatabaseBufferMockRecorder{mock} 56 return mock 57 } 58 59 // EXPECT returns an object that allows the caller to indicate expected use. 60 func (m *MockdatabaseBuffer) EXPECT() *MockdatabaseBufferMockRecorder { 61 return m.recorder 62 } 63 64 // ColdFlushBlockStarts mocks base method. 65 func (m *MockdatabaseBuffer) ColdFlushBlockStarts(blockStates map[time.UnixNano]BlockState) OptimizedTimes { 66 m.ctrl.T.Helper() 67 ret := m.ctrl.Call(m, "ColdFlushBlockStarts", blockStates) 68 ret0, _ := ret[0].(OptimizedTimes) 69 return ret0 70 } 71 72 // ColdFlushBlockStarts indicates an expected call of ColdFlushBlockStarts. 73 func (mr *MockdatabaseBufferMockRecorder) ColdFlushBlockStarts(blockStates interface{}) *gomock.Call { 74 mr.mock.ctrl.T.Helper() 75 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ColdFlushBlockStarts", reflect.TypeOf((*MockdatabaseBuffer)(nil).ColdFlushBlockStarts), blockStates) 76 } 77 78 // FetchBlocks mocks base method. 79 func (m *MockdatabaseBuffer) FetchBlocks(ctx context.Context, starts []time.UnixNano, nsCtx namespace.Context) []block.FetchBlockResult { 80 m.ctrl.T.Helper() 81 ret := m.ctrl.Call(m, "FetchBlocks", ctx, starts, nsCtx) 82 ret0, _ := ret[0].([]block.FetchBlockResult) 83 return ret0 84 } 85 86 // FetchBlocks indicates an expected call of FetchBlocks. 87 func (mr *MockdatabaseBufferMockRecorder) FetchBlocks(ctx, starts, nsCtx interface{}) *gomock.Call { 88 mr.mock.ctrl.T.Helper() 89 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBlocks", reflect.TypeOf((*MockdatabaseBuffer)(nil).FetchBlocks), ctx, starts, nsCtx) 90 } 91 92 // FetchBlocksForColdFlush mocks base method. 93 func (m *MockdatabaseBuffer) FetchBlocksForColdFlush(ctx context.Context, start time.UnixNano, version int, nsCtx namespace.Context) (block.FetchBlockResult, error) { 94 m.ctrl.T.Helper() 95 ret := m.ctrl.Call(m, "FetchBlocksForColdFlush", ctx, start, version, nsCtx) 96 ret0, _ := ret[0].(block.FetchBlockResult) 97 ret1, _ := ret[1].(error) 98 return ret0, ret1 99 } 100 101 // FetchBlocksForColdFlush indicates an expected call of FetchBlocksForColdFlush. 102 func (mr *MockdatabaseBufferMockRecorder) FetchBlocksForColdFlush(ctx, start, version, nsCtx interface{}) *gomock.Call { 103 mr.mock.ctrl.T.Helper() 104 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBlocksForColdFlush", reflect.TypeOf((*MockdatabaseBuffer)(nil).FetchBlocksForColdFlush), ctx, start, version, nsCtx) 105 } 106 107 // FetchBlocksMetadata mocks base method. 108 func (m *MockdatabaseBuffer) FetchBlocksMetadata(ctx context.Context, start, end time.UnixNano, opts FetchBlocksMetadataOptions) (block.FetchBlockMetadataResults, error) { 109 m.ctrl.T.Helper() 110 ret := m.ctrl.Call(m, "FetchBlocksMetadata", ctx, start, end, opts) 111 ret0, _ := ret[0].(block.FetchBlockMetadataResults) 112 ret1, _ := ret[1].(error) 113 return ret0, ret1 114 } 115 116 // FetchBlocksMetadata indicates an expected call of FetchBlocksMetadata. 117 func (mr *MockdatabaseBufferMockRecorder) FetchBlocksMetadata(ctx, start, end, opts interface{}) *gomock.Call { 118 mr.mock.ctrl.T.Helper() 119 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBlocksMetadata", reflect.TypeOf((*MockdatabaseBuffer)(nil).FetchBlocksMetadata), ctx, start, end, opts) 120 } 121 122 // IsEmpty mocks base method. 123 func (m *MockdatabaseBuffer) IsEmpty() bool { 124 m.ctrl.T.Helper() 125 ret := m.ctrl.Call(m, "IsEmpty") 126 ret0, _ := ret[0].(bool) 127 return ret0 128 } 129 130 // IsEmpty indicates an expected call of IsEmpty. 131 func (mr *MockdatabaseBufferMockRecorder) IsEmpty() *gomock.Call { 132 mr.mock.ctrl.T.Helper() 133 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsEmpty", reflect.TypeOf((*MockdatabaseBuffer)(nil).IsEmpty)) 134 } 135 136 // Load mocks base method. 137 func (m *MockdatabaseBuffer) Load(bl block.DatabaseBlock, writeType WriteType) { 138 m.ctrl.T.Helper() 139 m.ctrl.Call(m, "Load", bl, writeType) 140 } 141 142 // Load indicates an expected call of Load. 143 func (mr *MockdatabaseBufferMockRecorder) Load(bl, writeType interface{}) *gomock.Call { 144 mr.mock.ctrl.T.Helper() 145 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Load", reflect.TypeOf((*MockdatabaseBuffer)(nil).Load), bl, writeType) 146 } 147 148 // MarkNonEmptyBlocks mocks base method. 149 func (m *MockdatabaseBuffer) MarkNonEmptyBlocks(nonEmptyBlockStarts map[time.UnixNano]struct{}) { 150 m.ctrl.T.Helper() 151 m.ctrl.Call(m, "MarkNonEmptyBlocks", nonEmptyBlockStarts) 152 } 153 154 // MarkNonEmptyBlocks indicates an expected call of MarkNonEmptyBlocks. 155 func (mr *MockdatabaseBufferMockRecorder) MarkNonEmptyBlocks(nonEmptyBlockStarts interface{}) *gomock.Call { 156 mr.mock.ctrl.T.Helper() 157 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkNonEmptyBlocks", reflect.TypeOf((*MockdatabaseBuffer)(nil).MarkNonEmptyBlocks), nonEmptyBlockStarts) 158 } 159 160 // MoveTo mocks base method. 161 func (m *MockdatabaseBuffer) MoveTo(buffer databaseBuffer, nsCtx namespace.Context) error { 162 m.ctrl.T.Helper() 163 ret := m.ctrl.Call(m, "MoveTo", buffer, nsCtx) 164 ret0, _ := ret[0].(error) 165 return ret0 166 } 167 168 // MoveTo indicates an expected call of MoveTo. 169 func (mr *MockdatabaseBufferMockRecorder) MoveTo(buffer, nsCtx interface{}) *gomock.Call { 170 mr.mock.ctrl.T.Helper() 171 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MoveTo", reflect.TypeOf((*MockdatabaseBuffer)(nil).MoveTo), buffer, nsCtx) 172 } 173 174 // ReadEncoded mocks base method. 175 func (m *MockdatabaseBuffer) ReadEncoded(ctx context.Context, start, end time.UnixNano, nsCtx namespace.Context) ([][]xio.BlockReader, error) { 176 m.ctrl.T.Helper() 177 ret := m.ctrl.Call(m, "ReadEncoded", ctx, start, end, nsCtx) 178 ret0, _ := ret[0].([][]xio.BlockReader) 179 ret1, _ := ret[1].(error) 180 return ret0, ret1 181 } 182 183 // ReadEncoded indicates an expected call of ReadEncoded. 184 func (mr *MockdatabaseBufferMockRecorder) ReadEncoded(ctx, start, end, nsCtx interface{}) *gomock.Call { 185 mr.mock.ctrl.T.Helper() 186 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadEncoded", reflect.TypeOf((*MockdatabaseBuffer)(nil).ReadEncoded), ctx, start, end, nsCtx) 187 } 188 189 // Reset mocks base method. 190 func (m *MockdatabaseBuffer) Reset(opts databaseBufferResetOptions) { 191 m.ctrl.T.Helper() 192 m.ctrl.Call(m, "Reset", opts) 193 } 194 195 // Reset indicates an expected call of Reset. 196 func (mr *MockdatabaseBufferMockRecorder) Reset(opts interface{}) *gomock.Call { 197 mr.mock.ctrl.T.Helper() 198 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reset", reflect.TypeOf((*MockdatabaseBuffer)(nil).Reset), opts) 199 } 200 201 // Snapshot mocks base method. 202 func (m *MockdatabaseBuffer) Snapshot(ctx context.Context, blockStart time.UnixNano, metadata persist.Metadata, persistFn persist.DataFn, nsCtx namespace.Context) (SnapshotResult, error) { 203 m.ctrl.T.Helper() 204 ret := m.ctrl.Call(m, "Snapshot", ctx, blockStart, metadata, persistFn, nsCtx) 205 ret0, _ := ret[0].(SnapshotResult) 206 ret1, _ := ret[1].(error) 207 return ret0, ret1 208 } 209 210 // Snapshot indicates an expected call of Snapshot. 211 func (mr *MockdatabaseBufferMockRecorder) Snapshot(ctx, blockStart, metadata, persistFn, nsCtx interface{}) *gomock.Call { 212 mr.mock.ctrl.T.Helper() 213 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Snapshot", reflect.TypeOf((*MockdatabaseBuffer)(nil).Snapshot), ctx, blockStart, metadata, persistFn, nsCtx) 214 } 215 216 // Stats mocks base method. 217 func (m *MockdatabaseBuffer) Stats() bufferStats { 218 m.ctrl.T.Helper() 219 ret := m.ctrl.Call(m, "Stats") 220 ret0, _ := ret[0].(bufferStats) 221 return ret0 222 } 223 224 // Stats indicates an expected call of Stats. 225 func (mr *MockdatabaseBufferMockRecorder) Stats() *gomock.Call { 226 mr.mock.ctrl.T.Helper() 227 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stats", reflect.TypeOf((*MockdatabaseBuffer)(nil).Stats)) 228 } 229 230 // Tick mocks base method. 231 func (m *MockdatabaseBuffer) Tick(versions ShardBlockStateSnapshot, nsCtx namespace.Context) bufferTickResult { 232 m.ctrl.T.Helper() 233 ret := m.ctrl.Call(m, "Tick", versions, nsCtx) 234 ret0, _ := ret[0].(bufferTickResult) 235 return ret0 236 } 237 238 // Tick indicates an expected call of Tick. 239 func (mr *MockdatabaseBufferMockRecorder) Tick(versions, nsCtx interface{}) *gomock.Call { 240 mr.mock.ctrl.T.Helper() 241 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tick", reflect.TypeOf((*MockdatabaseBuffer)(nil).Tick), versions, nsCtx) 242 } 243 244 // WarmFlush mocks base method. 245 func (m *MockdatabaseBuffer) WarmFlush(ctx context.Context, blockStart time.UnixNano, metadata persist.Metadata, persistFn persist.DataFn, nsCtx namespace.Context) (FlushOutcome, error) { 246 m.ctrl.T.Helper() 247 ret := m.ctrl.Call(m, "WarmFlush", ctx, blockStart, metadata, persistFn, nsCtx) 248 ret0, _ := ret[0].(FlushOutcome) 249 ret1, _ := ret[1].(error) 250 return ret0, ret1 251 } 252 253 // WarmFlush indicates an expected call of WarmFlush. 254 func (mr *MockdatabaseBufferMockRecorder) WarmFlush(ctx, blockStart, metadata, persistFn, nsCtx interface{}) *gomock.Call { 255 mr.mock.ctrl.T.Helper() 256 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WarmFlush", reflect.TypeOf((*MockdatabaseBuffer)(nil).WarmFlush), ctx, blockStart, metadata, persistFn, nsCtx) 257 } 258 259 // Write mocks base method. 260 func (m *MockdatabaseBuffer) Write(ctx context.Context, id ident.ID, timestamp time.UnixNano, value float64, unit time.Unit, annotation []byte, wOpts WriteOptions) (bool, WriteType, error) { 261 m.ctrl.T.Helper() 262 ret := m.ctrl.Call(m, "Write", ctx, id, timestamp, value, unit, annotation, wOpts) 263 ret0, _ := ret[0].(bool) 264 ret1, _ := ret[1].(WriteType) 265 ret2, _ := ret[2].(error) 266 return ret0, ret1, ret2 267 } 268 269 // Write indicates an expected call of Write. 270 func (mr *MockdatabaseBufferMockRecorder) Write(ctx, id, timestamp, value, unit, annotation, wOpts interface{}) *gomock.Call { 271 mr.mock.ctrl.T.Helper() 272 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockdatabaseBuffer)(nil).Write), ctx, id, timestamp, value, unit, annotation, wOpts) 273 }