Documentation ¶
Overview ¶
Package bootstrap is a generated GoMock package.
Index ¶
- type Bootstrapper
- type BootstrapperProvider
- type MockBootstrapper
- func (m *MockBootstrapper) BootstrapData(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, ...) (result.DataBootstrapResult, error)
- func (m *MockBootstrapper) BootstrapIndex(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, ...) (result.IndexBootstrapResult, error)
- func (m *MockBootstrapper) Can(strategy Strategy) bool
- func (m *MockBootstrapper) EXPECT() *MockBootstrapperMockRecorder
- func (m *MockBootstrapper) String() string
- type MockBootstrapperMockRecorder
- func (mr *MockBootstrapperMockRecorder) BootstrapData(ns, shardsTimeRanges, opts interface{}) *gomock.Call
- func (mr *MockBootstrapperMockRecorder) BootstrapIndex(ns, shardsTimeRanges, opts interface{}) *gomock.Call
- func (mr *MockBootstrapperMockRecorder) Can(strategy interface{}) *gomock.Call
- func (mr *MockBootstrapperMockRecorder) String() *gomock.Call
- type MockBootstrapperProvider
- type MockBootstrapperProviderMockRecorder
- type MockProcess
- type MockProcessMockRecorder
- type MockProcessOptions
- type MockProcessOptionsMockRecorder
- type MockProcessProvider
- type MockProcessProviderMockRecorder
- type MockRunOptions
- type MockRunOptionsMockRecorder
- func (mr *MockRunOptionsMockRecorder) CacheSeriesMetadata() *gomock.Call
- func (mr *MockRunOptionsMockRecorder) Incremental() *gomock.Call
- func (mr *MockRunOptionsMockRecorder) SetCacheSeriesMetadata(value interface{}) *gomock.Call
- func (mr *MockRunOptionsMockRecorder) SetIncremental(value interface{}) *gomock.Call
- type MockSource
- func (m *MockSource) AvailableData(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges) result.ShardTimeRanges
- func (m *MockSource) AvailableIndex(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges) result.ShardTimeRanges
- func (m *MockSource) Can(strategy Strategy) bool
- func (m *MockSource) EXPECT() *MockSourceMockRecorder
- func (m *MockSource) ReadData(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, ...) (result.DataBootstrapResult, error)
- func (m *MockSource) ReadIndex(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, ...) (result.IndexBootstrapResult, error)
- type MockSourceMockRecorder
- func (mr *MockSourceMockRecorder) AvailableData(ns, shardsTimeRanges interface{}) *gomock.Call
- func (mr *MockSourceMockRecorder) AvailableIndex(ns, shardsTimeRanges interface{}) *gomock.Call
- func (mr *MockSourceMockRecorder) Can(strategy interface{}) *gomock.Call
- func (mr *MockSourceMockRecorder) ReadData(ns, shardsTimeRanges, opts interface{}) *gomock.Call
- func (mr *MockSourceMockRecorder) ReadIndex(ns, shardsTimeRanges, opts interface{}) *gomock.Call
- type Process
- type ProcessOptions
- type ProcessProvider
- type ProcessResult
- type RunOptions
- type Source
- type Strategy
- type TargetRange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootstrapper ¶
type Bootstrapper interface { // String returns the name of the bootstrapper String() string // Can returns whether a specific bootstrapper strategy can be applied. Can(strategy Strategy) bool // BootstrapData performs bootstrapping of data for the given time ranges, returning the bootstrapped // series data and the time ranges it's unable to fulfill in parallel. A bootstrapper // should only return an error should it want to entirely cancel the bootstrapping of the // node, i.e. non-recoverable situation like not being able to read from the filesystem. BootstrapData( ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions, ) (result.DataBootstrapResult, error) // BootstrapIndex performs bootstrapping of index blocks for the given time ranges, returning // the bootstrapped index blocks and the time ranges it's unable to fulfill in parallel. A bootstrapper // should only return an error should it want to entirely cancel the bootstrapping of the // node, i.e. non-recoverable situation like not being able to read from the filesystem. BootstrapIndex( ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions, ) (result.IndexBootstrapResult, error) }
Bootstrapper is the interface for different bootstrapping mechanisms. Note that a bootstrapper can and will be reused so it is important to not rely on state stored in the bootstrapper itself with the mindset that it will always be set to default values from the constructor.
type BootstrapperProvider ¶
type BootstrapperProvider interface { // String returns the name of the bootstrapper. String() string // Provide constructs a bootstrapper. Provide() (Bootstrapper, error) }
BootstrapperProvider constructs a bootstrapper.
type MockBootstrapper ¶
type MockBootstrapper struct {
// contains filtered or unexported fields
}
MockBootstrapper is a mock of Bootstrapper interface
func NewMockBootstrapper ¶
func NewMockBootstrapper(ctrl *gomock.Controller) *MockBootstrapper
NewMockBootstrapper creates a new mock instance
func (*MockBootstrapper) BootstrapData ¶
func (m *MockBootstrapper) BootstrapData(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions) (result.DataBootstrapResult, error)
BootstrapData mocks base method
func (*MockBootstrapper) BootstrapIndex ¶
func (m *MockBootstrapper) BootstrapIndex(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions) (result.IndexBootstrapResult, error)
BootstrapIndex mocks base method
func (*MockBootstrapper) Can ¶
func (m *MockBootstrapper) Can(strategy Strategy) bool
Can mocks base method
func (*MockBootstrapper) EXPECT ¶
func (m *MockBootstrapper) EXPECT() *MockBootstrapperMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockBootstrapper) String ¶
func (m *MockBootstrapper) String() string
String mocks base method
type MockBootstrapperMockRecorder ¶
type MockBootstrapperMockRecorder struct {
// contains filtered or unexported fields
}
MockBootstrapperMockRecorder is the mock recorder for MockBootstrapper
func (*MockBootstrapperMockRecorder) BootstrapData ¶
func (mr *MockBootstrapperMockRecorder) BootstrapData(ns, shardsTimeRanges, opts interface{}) *gomock.Call
BootstrapData indicates an expected call of BootstrapData
func (*MockBootstrapperMockRecorder) BootstrapIndex ¶
func (mr *MockBootstrapperMockRecorder) BootstrapIndex(ns, shardsTimeRanges, opts interface{}) *gomock.Call
BootstrapIndex indicates an expected call of BootstrapIndex
func (*MockBootstrapperMockRecorder) Can ¶
func (mr *MockBootstrapperMockRecorder) Can(strategy interface{}) *gomock.Call
Can indicates an expected call of Can
func (*MockBootstrapperMockRecorder) String ¶
func (mr *MockBootstrapperMockRecorder) String() *gomock.Call
String indicates an expected call of String
type MockBootstrapperProvider ¶
type MockBootstrapperProvider struct {
// contains filtered or unexported fields
}
MockBootstrapperProvider is a mock of BootstrapperProvider interface
func NewMockBootstrapperProvider ¶
func NewMockBootstrapperProvider(ctrl *gomock.Controller) *MockBootstrapperProvider
NewMockBootstrapperProvider creates a new mock instance
func (*MockBootstrapperProvider) EXPECT ¶
func (m *MockBootstrapperProvider) EXPECT() *MockBootstrapperProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockBootstrapperProvider) Provide ¶
func (m *MockBootstrapperProvider) Provide() (Bootstrapper, error)
Provide mocks base method
func (*MockBootstrapperProvider) String ¶
func (m *MockBootstrapperProvider) String() string
String mocks base method
type MockBootstrapperProviderMockRecorder ¶
type MockBootstrapperProviderMockRecorder struct {
// contains filtered or unexported fields
}
MockBootstrapperProviderMockRecorder is the mock recorder for MockBootstrapperProvider
func (*MockBootstrapperProviderMockRecorder) Provide ¶
func (mr *MockBootstrapperProviderMockRecorder) Provide() *gomock.Call
Provide indicates an expected call of Provide
func (*MockBootstrapperProviderMockRecorder) String ¶
func (mr *MockBootstrapperProviderMockRecorder) String() *gomock.Call
String indicates an expected call of String
type MockProcess ¶
type MockProcess struct {
// contains filtered or unexported fields
}
MockProcess is a mock of Process interface
func NewMockProcess ¶
func NewMockProcess(ctrl *gomock.Controller) *MockProcess
NewMockProcess creates a new mock instance
func (*MockProcess) EXPECT ¶
func (m *MockProcess) EXPECT() *MockProcessMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockProcess) Run ¶
func (m *MockProcess) Run(start time.Time, ns namespace.Metadata, shards []uint32) (ProcessResult, error)
Run mocks base method
type MockProcessMockRecorder ¶
type MockProcessMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessMockRecorder is the mock recorder for MockProcess
func (*MockProcessMockRecorder) Run ¶
func (mr *MockProcessMockRecorder) Run(start, ns, shards interface{}) *gomock.Call
Run indicates an expected call of Run
type MockProcessOptions ¶
type MockProcessOptions struct {
// contains filtered or unexported fields
}
MockProcessOptions is a mock of ProcessOptions interface
func NewMockProcessOptions ¶
func NewMockProcessOptions(ctrl *gomock.Controller) *MockProcessOptions
NewMockProcessOptions creates a new mock instance
func (*MockProcessOptions) CacheSeriesMetadata ¶
func (m *MockProcessOptions) CacheSeriesMetadata() bool
CacheSeriesMetadata mocks base method
func (*MockProcessOptions) EXPECT ¶
func (m *MockProcessOptions) EXPECT() *MockProcessOptionsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockProcessOptions) SetCacheSeriesMetadata ¶
func (m *MockProcessOptions) SetCacheSeriesMetadata(value bool) ProcessOptions
SetCacheSeriesMetadata mocks base method
type MockProcessOptionsMockRecorder ¶
type MockProcessOptionsMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessOptionsMockRecorder is the mock recorder for MockProcessOptions
func (*MockProcessOptionsMockRecorder) CacheSeriesMetadata ¶
func (mr *MockProcessOptionsMockRecorder) CacheSeriesMetadata() *gomock.Call
CacheSeriesMetadata indicates an expected call of CacheSeriesMetadata
func (*MockProcessOptionsMockRecorder) SetCacheSeriesMetadata ¶
func (mr *MockProcessOptionsMockRecorder) SetCacheSeriesMetadata(value interface{}) *gomock.Call
SetCacheSeriesMetadata indicates an expected call of SetCacheSeriesMetadata
type MockProcessProvider ¶
type MockProcessProvider struct {
// contains filtered or unexported fields
}
MockProcessProvider is a mock of ProcessProvider interface
func NewMockProcessProvider ¶
func NewMockProcessProvider(ctrl *gomock.Controller) *MockProcessProvider
NewMockProcessProvider creates a new mock instance
func (*MockProcessProvider) BootstrapperProvider ¶
func (m *MockProcessProvider) BootstrapperProvider() BootstrapperProvider
BootstrapperProvider mocks base method
func (*MockProcessProvider) EXPECT ¶
func (m *MockProcessProvider) EXPECT() *MockProcessProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockProcessProvider) Provide ¶
func (m *MockProcessProvider) Provide() (Process, error)
Provide mocks base method
func (*MockProcessProvider) SetBootstrapperProvider ¶
func (m *MockProcessProvider) SetBootstrapperProvider(bootstrapper BootstrapperProvider)
SetBootstrapperProvider mocks base method
type MockProcessProviderMockRecorder ¶
type MockProcessProviderMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessProviderMockRecorder is the mock recorder for MockProcessProvider
func (*MockProcessProviderMockRecorder) BootstrapperProvider ¶
func (mr *MockProcessProviderMockRecorder) BootstrapperProvider() *gomock.Call
BootstrapperProvider indicates an expected call of BootstrapperProvider
func (*MockProcessProviderMockRecorder) Provide ¶
func (mr *MockProcessProviderMockRecorder) Provide() *gomock.Call
Provide indicates an expected call of Provide
func (*MockProcessProviderMockRecorder) SetBootstrapperProvider ¶
func (mr *MockProcessProviderMockRecorder) SetBootstrapperProvider(bootstrapper interface{}) *gomock.Call
SetBootstrapperProvider indicates an expected call of SetBootstrapperProvider
type MockRunOptions ¶
type MockRunOptions struct {
// contains filtered or unexported fields
}
MockRunOptions is a mock of RunOptions interface
func NewMockRunOptions ¶
func NewMockRunOptions(ctrl *gomock.Controller) *MockRunOptions
NewMockRunOptions creates a new mock instance
func (*MockRunOptions) CacheSeriesMetadata ¶
func (m *MockRunOptions) CacheSeriesMetadata() bool
CacheSeriesMetadata mocks base method
func (*MockRunOptions) EXPECT ¶
func (m *MockRunOptions) EXPECT() *MockRunOptionsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRunOptions) Incremental ¶
func (m *MockRunOptions) Incremental() bool
Incremental mocks base method
func (*MockRunOptions) SetCacheSeriesMetadata ¶
func (m *MockRunOptions) SetCacheSeriesMetadata(value bool) RunOptions
SetCacheSeriesMetadata mocks base method
func (*MockRunOptions) SetIncremental ¶
func (m *MockRunOptions) SetIncremental(value bool) RunOptions
SetIncremental mocks base method
type MockRunOptionsMockRecorder ¶
type MockRunOptionsMockRecorder struct {
// contains filtered or unexported fields
}
MockRunOptionsMockRecorder is the mock recorder for MockRunOptions
func (*MockRunOptionsMockRecorder) CacheSeriesMetadata ¶
func (mr *MockRunOptionsMockRecorder) CacheSeriesMetadata() *gomock.Call
CacheSeriesMetadata indicates an expected call of CacheSeriesMetadata
func (*MockRunOptionsMockRecorder) Incremental ¶
func (mr *MockRunOptionsMockRecorder) Incremental() *gomock.Call
Incremental indicates an expected call of Incremental
func (*MockRunOptionsMockRecorder) SetCacheSeriesMetadata ¶
func (mr *MockRunOptionsMockRecorder) SetCacheSeriesMetadata(value interface{}) *gomock.Call
SetCacheSeriesMetadata indicates an expected call of SetCacheSeriesMetadata
func (*MockRunOptionsMockRecorder) SetIncremental ¶
func (mr *MockRunOptionsMockRecorder) SetIncremental(value interface{}) *gomock.Call
SetIncremental indicates an expected call of SetIncremental
type MockSource ¶
type MockSource struct {
// contains filtered or unexported fields
}
MockSource is a mock of Source interface
func NewMockSource ¶
func NewMockSource(ctrl *gomock.Controller) *MockSource
NewMockSource creates a new mock instance
func (*MockSource) AvailableData ¶
func (m *MockSource) AvailableData(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges) result.ShardTimeRanges
AvailableData mocks base method
func (*MockSource) AvailableIndex ¶
func (m *MockSource) AvailableIndex(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges) result.ShardTimeRanges
AvailableIndex mocks base method
func (*MockSource) EXPECT ¶
func (m *MockSource) EXPECT() *MockSourceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSource) ReadData ¶
func (m *MockSource) ReadData(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions) (result.DataBootstrapResult, error)
ReadData mocks base method
func (*MockSource) ReadIndex ¶
func (m *MockSource) ReadIndex(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions) (result.IndexBootstrapResult, error)
ReadIndex mocks base method
type MockSourceMockRecorder ¶
type MockSourceMockRecorder struct {
// contains filtered or unexported fields
}
MockSourceMockRecorder is the mock recorder for MockSource
func (*MockSourceMockRecorder) AvailableData ¶
func (mr *MockSourceMockRecorder) AvailableData(ns, shardsTimeRanges interface{}) *gomock.Call
AvailableData indicates an expected call of AvailableData
func (*MockSourceMockRecorder) AvailableIndex ¶
func (mr *MockSourceMockRecorder) AvailableIndex(ns, shardsTimeRanges interface{}) *gomock.Call
AvailableIndex indicates an expected call of AvailableIndex
func (*MockSourceMockRecorder) Can ¶
func (mr *MockSourceMockRecorder) Can(strategy interface{}) *gomock.Call
Can indicates an expected call of Can
func (*MockSourceMockRecorder) ReadData ¶
func (mr *MockSourceMockRecorder) ReadData(ns, shardsTimeRanges, opts interface{}) *gomock.Call
ReadData indicates an expected call of ReadData
func (*MockSourceMockRecorder) ReadIndex ¶
func (mr *MockSourceMockRecorder) ReadIndex(ns, shardsTimeRanges, opts interface{}) *gomock.Call
ReadIndex indicates an expected call of ReadIndex
type Process ¶
type Process interface { // Run runs the bootstrap process, returning the bootstrap result and any error encountered. Run(start time.Time, ns namespace.Metadata, shards []uint32) (ProcessResult, error) }
Process represents the bootstrap process. Note that a bootstrap process can and will be reused so it is important to not rely on state stored in the bootstrap itself with the mindset that it will always be set to default values from the constructor.
type ProcessOptions ¶
type ProcessOptions interface { // SetCacheSeriesMetadata sets whether bootstrappers created by this // provider should cache series metadata between runs. SetCacheSeriesMetadata(value bool) ProcessOptions // CacheSeriesMetadata returns whether bootstrappers created by this // provider should cache series metadata between runs. CacheSeriesMetadata() bool }
ProcessOptions is a set of options for a bootstrap provider.
func NewProcessOptions ¶
func NewProcessOptions() ProcessOptions
NewProcessOptions creates new bootstrap run options
type ProcessProvider ¶
type ProcessProvider interface { // SetBootstrapper sets the bootstrapper provider to use when running the // process. SetBootstrapperProvider(bootstrapper BootstrapperProvider) // Bootstrapper returns the current bootstrappe provider to use when // running the process. BootstrapperProvider() BootstrapperProvider // Provide constructs a bootstrap process. Provide() (Process, error) }
ProcessProvider constructs a bootstrap process that can execute a bootstrap run.
func NewNoOpProcessProvider ¶
func NewNoOpProcessProvider() ProcessProvider
NewNoOpProcessProvider creates a no-op bootstrap process proivder.
func NewProcessProvider ¶
func NewProcessProvider( bootstrapperProvider BootstrapperProvider, processOpts ProcessOptions, resultOpts result.Options, ) ProcessProvider
NewProcessProvider creates a new bootstrap process provider.
type ProcessResult ¶
type ProcessResult struct { DataResult result.DataBootstrapResult IndexResult result.IndexBootstrapResult }
ProcessResult is the result of a bootstrap process.
type RunOptions ¶
type RunOptions interface { // SetIncremental sets whether this bootstrap should be an incremental // that saves intermediate results to durable storage or not. SetIncremental(value bool) RunOptions // Incremental returns whether this bootstrap should be an incremental // that saves intermediate results to durable storage or not. Incremental() bool // SetCacheSeriesMetadata sets whether bootstrappers created by this // provider should cache series metadata between runs. SetCacheSeriesMetadata(value bool) RunOptions // CacheSeriesMetadata returns whether bootstrappers created by this // provider should cache series metadata between runs. CacheSeriesMetadata() bool }
RunOptions is a set of options for a bootstrap run.
func NewRunOptions ¶
func NewRunOptions() RunOptions
NewRunOptions creates new bootstrap run options
type Source ¶
type Source interface { // Can returns whether a specific bootstrapper strategy can be applied. Can(strategy Strategy) bool // AvailableData returns what time ranges are available for bootstrapping a given set of shards. AvailableData( ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, ) result.ShardTimeRanges // ReadData returns raw series for a given set of shards & specified time ranges and // the time ranges it's unable to fulfill. A bootstrapper source should only return // an error should it want to entirely cancel the bootstrapping of the node, // i.e. non-recoverable situation like not being able to read from the filesystem. ReadData( ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions, ) (result.DataBootstrapResult, error) // AvailableIndex returns what time ranges are available for bootstrapping. AvailableIndex( ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, ) result.ShardTimeRanges // ReadIndex returns series index blocks. ReadIndex( ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions, ) (result.IndexBootstrapResult, error) }
Source represents a bootstrap source. Note that a source can and will be reused so it is important to not rely on state stored in the source itself with the mindset that it will always be set to default values from the constructor.
type TargetRange ¶
type TargetRange struct { // Range is the time range to bootstrap for. Range xtime.Range // RunOptions is the bootstrap run options specific to the target range. RunOptions RunOptions }
TargetRange is a bootstrap target range.