bootstrap

package
v0.9.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 14 Imported by: 18

Documentation

Overview

Package bootstrap is a generated GoMock package.

Index

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

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

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

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBootstrapperProvider) Provide

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

Provide indicates an expected call of Provide

func (*MockBootstrapperProviderMockRecorder) String

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

EXPECT returns an object that allows the caller to indicate expected use

func (*MockProcessOptions) Origin added in v0.4.6

func (m *MockProcessOptions) Origin() topology.Host

Origin mocks base method

func (*MockProcessOptions) SetCacheSeriesMetadata

func (m *MockProcessOptions) SetCacheSeriesMetadata(value bool) ProcessOptions

SetCacheSeriesMetadata mocks base method

func (*MockProcessOptions) SetOrigin added in v0.4.6

func (m *MockProcessOptions) SetOrigin(value topology.Host) ProcessOptions

SetOrigin mocks base method

func (*MockProcessOptions) SetTopologyMapProvider added in v0.4.6

func (m *MockProcessOptions) SetTopologyMapProvider(value topology.MapProvider) ProcessOptions

SetTopologyMapProvider mocks base method

func (*MockProcessOptions) TopologyMapProvider added in v0.4.6

func (m *MockProcessOptions) TopologyMapProvider() topology.MapProvider

TopologyMapProvider mocks base method

func (*MockProcessOptions) Validate added in v0.4.4

func (m *MockProcessOptions) Validate() error

Validate 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) Origin added in v0.4.6

Origin indicates an expected call of Origin

func (*MockProcessOptionsMockRecorder) SetCacheSeriesMetadata

func (mr *MockProcessOptionsMockRecorder) SetCacheSeriesMetadata(value interface{}) *gomock.Call

SetCacheSeriesMetadata indicates an expected call of SetCacheSeriesMetadata

func (*MockProcessOptionsMockRecorder) SetOrigin added in v0.4.6

func (mr *MockProcessOptionsMockRecorder) SetOrigin(value interface{}) *gomock.Call

SetOrigin indicates an expected call of SetOrigin

func (*MockProcessOptionsMockRecorder) SetTopologyMapProvider added in v0.4.6

func (mr *MockProcessOptionsMockRecorder) SetTopologyMapProvider(value interface{}) *gomock.Call

SetTopologyMapProvider indicates an expected call of SetTopologyMapProvider

func (*MockProcessOptionsMockRecorder) TopologyMapProvider added in v0.4.6

func (mr *MockProcessOptionsMockRecorder) TopologyMapProvider() *gomock.Call

TopologyMapProvider indicates an expected call of TopologyMapProvider

func (*MockProcessOptionsMockRecorder) Validate added in v0.4.4

func (mr *MockProcessOptionsMockRecorder) Validate() *gomock.Call

Validate indicates an expected call of Validate

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

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

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

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRunOptions) InitialTopologyState added in v0.4.4

func (m *MockRunOptions) InitialTopologyState() *topology.StateSnapshot

InitialTopologyState mocks base method

func (*MockRunOptions) PersistConfig added in v0.4.4

func (m *MockRunOptions) PersistConfig() PersistConfig

PersistConfig mocks base method

func (*MockRunOptions) SetCacheSeriesMetadata

func (m *MockRunOptions) SetCacheSeriesMetadata(value bool) RunOptions

SetCacheSeriesMetadata mocks base method

func (*MockRunOptions) SetInitialTopologyState added in v0.4.4

func (m *MockRunOptions) SetInitialTopologyState(value *topology.StateSnapshot) RunOptions

SetInitialTopologyState mocks base method

func (*MockRunOptions) SetPersistConfig added in v0.4.4

func (m *MockRunOptions) SetPersistConfig(value PersistConfig) RunOptions

SetPersistConfig 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) InitialTopologyState added in v0.4.4

func (mr *MockRunOptionsMockRecorder) InitialTopologyState() *gomock.Call

InitialTopologyState indicates an expected call of InitialTopologyState

func (*MockRunOptionsMockRecorder) PersistConfig added in v0.4.4

func (mr *MockRunOptionsMockRecorder) PersistConfig() *gomock.Call

PersistConfig indicates an expected call of PersistConfig

func (*MockRunOptionsMockRecorder) SetCacheSeriesMetadata

func (mr *MockRunOptionsMockRecorder) SetCacheSeriesMetadata(value interface{}) *gomock.Call

SetCacheSeriesMetadata indicates an expected call of SetCacheSeriesMetadata

func (*MockRunOptionsMockRecorder) SetInitialTopologyState added in v0.4.4

func (mr *MockRunOptionsMockRecorder) SetInitialTopologyState(value interface{}) *gomock.Call

SetInitialTopologyState indicates an expected call of SetInitialTopologyState

func (*MockRunOptionsMockRecorder) SetPersistConfig added in v0.4.4

func (mr *MockRunOptionsMockRecorder) SetPersistConfig(value interface{}) *gomock.Call

SetPersistConfig indicates an expected call of SetPersistConfig

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, runOpts RunOptions) (result.ShardTimeRanges, error)

AvailableData mocks base method

func (*MockSource) AvailableIndex

func (m *MockSource) AvailableIndex(ns namespace.Metadata, shardsTimeRanges result.ShardTimeRanges, opts RunOptions) (result.ShardTimeRanges, error)

AvailableIndex mocks base method

func (*MockSource) Can

func (m *MockSource) Can(strategy Strategy) bool

Can 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, runOpts 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, runOpts interface{}) *gomock.Call

AvailableData indicates an expected call of AvailableData

func (*MockSourceMockRecorder) AvailableIndex

func (mr *MockSourceMockRecorder) AvailableIndex(ns, shardsTimeRanges, opts 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, runOpts 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 PersistConfig added in v0.4.4

type PersistConfig struct {
	// If enabled bootstrappers are allowed to write out bootstrapped data
	// to disk on their own instead of just returning result in-memory.
	Enabled bool
	// If enabled, what type of persistence files should be generated during
	// the process.
	FileSetType persist.FileSetType
}

PersistConfig is the configuration for a bootstrap with persistence.

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

	// SetTopologyMapProvider sets the TopologyMapProvider.
	SetTopologyMapProvider(value topology.MapProvider) ProcessOptions

	// TopologyMapProvider returns the TopologyMapProvider.
	TopologyMapProvider() topology.MapProvider

	// SetOrigin sets the origin.
	SetOrigin(value topology.Host) ProcessOptions

	// Origin returns the origin.
	Origin() topology.Host

	// Validate validates that the ProcessOptions are correct.
	Validate() error
}

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, error)

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 {
	// SetPersistConfig sets persistence configuration for this bootstrap.
	SetPersistConfig(value PersistConfig) RunOptions

	// PersistConfig returns the persistence configuration for this bootstrap.
	PersistConfig() PersistConfig

	// 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

	// SetInitialTopologyState sets the initial topology state as it was
	// measured before the bootstrap process began.
	SetInitialTopologyState(value *topology.StateSnapshot) RunOptions

	// InitialTopologyState returns the initial topology as it was measured
	// before the bootstrap process began.
	InitialTopologyState() *topology.StateSnapshot
}

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,
		runOpts RunOptions,
	) (result.ShardTimeRanges, error)

	// 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,
		runOpts RunOptions,
	) (result.DataBootstrapResult, error)

	// AvailableIndex returns what time ranges are available for bootstrapping.
	AvailableIndex(
		ns namespace.Metadata,
		shardsTimeRanges result.ShardTimeRanges,
		opts RunOptions,
	) (result.ShardTimeRanges, error)

	// 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 Strategy

type Strategy int

Strategy describes a bootstrap strategy.

const (
	// BootstrapSequential describes whether a bootstrap can use the sequential bootstrap strategy.
	BootstrapSequential Strategy = iota
	// BootstrapParallel describes whether a bootstrap can use the parallel bootstrap strategy.
	BootstrapParallel
)

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.

Directories

Path Synopsis
fs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL