block

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package block is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortFetchBlockResultByTimeAscending

func SortFetchBlockResultByTimeAscending(results []FetchBlockResult)

SortFetchBlockResultByTimeAscending sorts fetch block results in time ascending order

Types

type DatabaseBlock

type DatabaseBlock interface {

	// StartTime returns the start time of the block.
	StartTime() time.Time

	// BlockSize returns the duration of the block.
	BlockSize() time.Duration

	// SetLastReadTime sets the last read time of the block.
	SetLastReadTime(value time.Time)

	// LastReadTime returns the last read time of the block.
	LastReadTime() time.Time

	// Len returns the block length.
	Len() int

	// Checksum returns the block checksum.
	Checksum() (uint32, error)

	// Stream returns the encoded byte stream.
	Stream(blocker context.Context) (xio.BlockReader, error)

	// Merge will merge the current block with the specified block
	// when this block is read. Note: calling this twice
	// will simply overwrite the target for the block to merge with
	// rather than merging three blocks together.
	Merge(other DatabaseBlock) error

	// HasMergeTarget returns whether the block requires multiple blocks to be
	// merged during Stream().
	HasMergeTarget() bool

	// WasRetrievedFromDisk returns whether the block was retrieved from storage.
	WasRetrievedFromDisk() bool

	// Reset resets the block start time, duration, and the segment.
	Reset(startTime time.Time, blockSize time.Duration, segment ts.Segment, nsCtx namespace.Context)

	// ResetFromDisk resets the block start time, duration, segment, and id.
	ResetFromDisk(
		startTime time.Time,
		blockSize time.Duration,
		segment ts.Segment,
		id ident.ID,
		nsCtx namespace.Context,
	)

	// Discard closes the block, but returns the (unfinalized) segment.
	Discard() ts.Segment

	// Close closes the block.
	Close()

	// CloseIfFromDisk atomically checks if the disk was retrieved from disk, and
	// if so, closes it. It is meant as a layered protection for the WiredList
	// which should only close blocks that were retrieved from disk.
	CloseIfFromDisk() bool

	// SetOnEvictedFromWiredList sets the owner of the block
	SetOnEvictedFromWiredList(OnEvictedFromWiredList)

	// OnEvictedFromWiredList returns the owner of the block
	OnEvictedFromWiredList() OnEvictedFromWiredList
	// contains filtered or unexported methods
}

DatabaseBlock is the interface for a DatabaseBlock

func NewDatabaseBlock

func NewDatabaseBlock(
	start time.Time,
	blockSize time.Duration,
	segment ts.Segment,
	opts Options,
	nsCtx namespace.Context,
) DatabaseBlock

NewDatabaseBlock creates a new DatabaseBlock instance.

type DatabaseBlockAllocate

type DatabaseBlockAllocate func() DatabaseBlock

DatabaseBlockAllocate allocates a database block for a pool.

type DatabaseBlockPool

type DatabaseBlockPool interface {
	// Init initializes the pool.
	Init(alloc DatabaseBlockAllocate)

	// Get provides a database block from the pool.
	Get() DatabaseBlock

	// Put returns a database block to the pool.
	Put(block DatabaseBlock)
}

DatabaseBlockPool provides a pool for database blocks.

func NewDatabaseBlockPool

func NewDatabaseBlockPool(opts pool.ObjectPoolOptions) DatabaseBlockPool

NewDatabaseBlockPool creates a new pool for database blocks.

type DatabaseBlockRetriever

type DatabaseBlockRetriever interface {
	// CacheShardIndices will pre-parse the indexes for given shards
	// to improve times when streaming a block.
	CacheShardIndices(shards []uint32) error

	// Stream will stream a block for a given shard, id and start.
	Stream(
		ctx context.Context,
		shard uint32,
		id ident.ID,
		blockStart time.Time,
		onRetrieve OnRetrieveBlock,
		nsCtx namespace.Context,
	) (xio.BlockReader, error)
}

DatabaseBlockRetriever is a block retriever.

type DatabaseBlockRetrieverManager

type DatabaseBlockRetrieverManager interface {
	Retriever(nsMetadata namespace.Metadata) (DatabaseBlockRetriever, error)
}

DatabaseBlockRetrieverManager creates and holds block retrievers for different namespaces.

func NewDatabaseBlockRetrieverManager

func NewDatabaseBlockRetrieverManager(
	newDatabaseBlockRetrieverFn NewDatabaseBlockRetrieverFn,
) DatabaseBlockRetrieverManager

NewDatabaseBlockRetrieverManager creates a new manager for constructing and providing existing database block retrievers

type DatabaseSeriesBlocks

type DatabaseSeriesBlocks interface {
	// Len returns the number of blocks contained in the collection.
	Len() int

	// AddBlock adds a data block.
	AddBlock(block DatabaseBlock)

	// AddSeries adds a raw series.
	AddSeries(other DatabaseSeriesBlocks)

	// MinTime returns the min time of the blocks contained.
	MinTime() time.Time

	// MaxTime returns the max time of the blocks contained.
	MaxTime() time.Time

	// BlockAt returns the block at a given time if any.
	BlockAt(t time.Time) (DatabaseBlock, bool)

	// AllBlocks returns all the blocks in the series.
	AllBlocks() map[xtime.UnixNano]DatabaseBlock

	// RemoveBlockAt removes the block at a given time if any.
	RemoveBlockAt(t time.Time)

	// RemoveAll removes all blocks.
	RemoveAll()

	// Reset resets the DatabaseSeriesBlocks so they can be re-used
	Reset()

	// Close closes all the blocks.
	Close()
}

DatabaseSeriesBlocks represents a collection of data blocks.

func NewDatabaseSeriesBlocks

func NewDatabaseSeriesBlocks(capacity int) DatabaseSeriesBlocks

NewDatabaseSeriesBlocks creates a databaseSeriesBlocks instance.

type DatabaseShardBlockRetriever

type DatabaseShardBlockRetriever interface {
	// Stream will stream a block for a given id and start.
	Stream(
		ctx context.Context,
		id ident.ID,
		blockStart time.Time,
		onRetrieve OnRetrieveBlock,
		nsCtx namespace.Context,
	) (xio.BlockReader, error)
}

DatabaseShardBlockRetriever is a block retriever bound to a shard.

func NewDatabaseShardBlockRetriever

func NewDatabaseShardBlockRetriever(
	shard uint32,
	r DatabaseBlockRetriever,
) DatabaseShardBlockRetriever

NewDatabaseShardBlockRetriever creates a new shard database block retriever given an existing database block retriever

type DatabaseShardBlockRetrieverManager

type DatabaseShardBlockRetrieverManager interface {
	ShardRetriever(shard uint32) DatabaseShardBlockRetriever
}

DatabaseShardBlockRetrieverManager creates and holds shard block retrievers binding shards to an existing retriever.

func NewDatabaseShardBlockRetrieverManager

func NewDatabaseShardBlockRetrieverManager(
	r DatabaseBlockRetriever,
) DatabaseShardBlockRetrieverManager

NewDatabaseShardBlockRetrieverManager creates and holds shard block retrievers binding shards to an existing retriever.

type FetchBlockMetadataResult

type FetchBlockMetadataResult struct {
	Start    time.Time
	Size     int64
	Checksum *uint32
	LastRead time.Time
	Err      error
}

FetchBlockMetadataResult captures the block start time, the block size, and any errors encountered

func NewFetchBlockMetadataResult

func NewFetchBlockMetadataResult(
	start time.Time,
	size int64,
	checksum *uint32,
	lastRead time.Time,
	err error,
) FetchBlockMetadataResult

NewFetchBlockMetadataResult creates a new fetch block metadata result.

type FetchBlockMetadataResults

type FetchBlockMetadataResults interface {
	// Add adds a result to the slice
	Add(res FetchBlockMetadataResult)

	// Results returns the result slice
	Results() []FetchBlockMetadataResult

	// SortByTimeAscending sorts the results in time ascending order
	Sort()

	// Reset resets the results
	Reset()

	// Close performs cleanup
	Close()
}

FetchBlockMetadataResults captures a collection of FetchBlockMetadataResult

func NewFetchBlockMetadataResults

func NewFetchBlockMetadataResults() FetchBlockMetadataResults

NewFetchBlockMetadataResults creates a non-pooled fetchBlockMetadataResults

type FetchBlockMetadataResultsPool

type FetchBlockMetadataResultsPool interface {
	// Get returns an FetchBlockMetadataResults
	Get() FetchBlockMetadataResults

	// Put puts an FetchBlockMetadataResults back to pool
	Put(res FetchBlockMetadataResults)
}

FetchBlockMetadataResultsPool provides a pool for fetchBlockMetadataResults

func NewFetchBlockMetadataResultsPool

func NewFetchBlockMetadataResultsPool(opts pool.ObjectPoolOptions, capacity int) FetchBlockMetadataResultsPool

NewFetchBlockMetadataResultsPool creates a new fetchBlockMetadataResultsPool

type FetchBlockResult

type FetchBlockResult struct {
	Start  time.Time
	Blocks []xio.BlockReader
	Err    error
}

FetchBlockResult captures the block start time, the readers for the underlying streams, the corresponding checksum and any errors encountered.

func NewFetchBlockResult

func NewFetchBlockResult(
	start time.Time,
	blocks []xio.BlockReader,
	err error,
) FetchBlockResult

NewFetchBlockResult creates a new fetch block result

type FetchBlocksMetadataOptions

type FetchBlocksMetadataOptions struct {
	IncludeSizes     bool
	IncludeChecksums bool
	IncludeLastRead  bool
}

FetchBlocksMetadataOptions are options used when fetching blocks metadata.

type FetchBlocksMetadataResult

type FetchBlocksMetadataResult struct {
	ID     ident.ID
	Tags   ident.TagIterator
	Blocks FetchBlockMetadataResults
}

FetchBlocksMetadataResult captures the fetch results for multiple blocks.

func NewFetchBlocksMetadataResult

func NewFetchBlocksMetadataResult(
	id ident.ID,
	tags ident.TagIterator,
	blocks FetchBlockMetadataResults,
) FetchBlocksMetadataResult

NewFetchBlocksMetadataResult creates new database blocks metadata

type FetchBlocksMetadataResults

type FetchBlocksMetadataResults interface {
	// Add adds a result to the slice
	Add(res FetchBlocksMetadataResult)

	// Results returns the result slice
	Results() []FetchBlocksMetadataResult

	// Reset resets the results
	Reset()

	// Close performs cleanup
	Close()
}

FetchBlocksMetadataResults captures a collection of FetchBlocksMetadataResult

func NewFetchBlocksMetadataResults

func NewFetchBlocksMetadataResults() FetchBlocksMetadataResults

NewFetchBlocksMetadataResults creates a non-pooled FetchBlocksMetadataResults

type FetchBlocksMetadataResultsPool

type FetchBlocksMetadataResultsPool interface {
	// Get returns an fetchBlocksMetadataResults
	Get() FetchBlocksMetadataResults

	// Put puts an fetchBlocksMetadataResults back to pool
	Put(res FetchBlocksMetadataResults)
}

FetchBlocksMetadataResultsPool provides a pool for fetchBlocksMetadataResults

func NewFetchBlocksMetadataResultsPool

func NewFetchBlocksMetadataResultsPool(opts pool.ObjectPoolOptions, capacity int) FetchBlocksMetadataResultsPool

NewFetchBlocksMetadataResultsPool creates a new fetchBlocksMetadataResultsPool

type FilteredBlocksMetadataIter

type FilteredBlocksMetadataIter interface {
	// Next returns the next item if available
	Next() bool

	// Current returns the current id and block metadata
	Current() (ident.ID, Metadata)

	//  Error returns an error if encountered
	Err() error
}

FilteredBlocksMetadataIter iterates over a list of blocks metadata results with filtering applied

func NewFilteredBlocksMetadataIter

func NewFilteredBlocksMetadataIter(
	res FetchBlocksMetadataResults,
) FilteredBlocksMetadataIter

NewFilteredBlocksMetadataIter creates a new filtered blocks metadata iterator, there's no pooling of the tags returned currently. Only the repair process uses this currently which is unoptimized.

type LeaseDescriptor

type LeaseDescriptor struct {
	Namespace  ident.ID
	Shard      uint32
	BlockStart time.Time
}

LeaseDescriptor describes a lease (like an ID).

type LeaseManager

type LeaseManager interface {
	// RegisterLeaser registers the leaser to receive UpdateOpenLease()
	// calls when leases need to be updated.
	RegisterLeaser(leaser Leaser) error
	// UnregisterLeaser unregisters the leaser from receiving UpdateOpenLease()
	// calls.
	UnregisterLeaser(leaser Leaser) error
	// OpenLease opens a lease.
	OpenLease(
		leaser Leaser,
		descriptor LeaseDescriptor,
		state LeaseState,
	) error
	// OpenLatestLease opens a lease for the latest LeaseState for a given
	// LeaseDescriptor.
	OpenLatestLease(leaser Leaser, descriptor LeaseDescriptor) (LeaseState, error)
	// UpdateOpenLeases propagate a call to UpdateOpenLease() to each registered
	// leaser.
	UpdateOpenLeases(
		descriptor LeaseDescriptor,
		state LeaseState,
	) (UpdateLeasesResult, error)
	// SetLeaseVerifier sets the LeaseVerifier (for delayed initialization).
	SetLeaseVerifier(leaseVerifier LeaseVerifier) error
}

LeaseManager is a manager of block leases and leasers.

func NewLeaseManager

func NewLeaseManager(verifier LeaseVerifier) LeaseManager

NewLeaseManager creates a new lease manager with a provided lease verifier (to ensure leases are valid when made).

type LeaseState

type LeaseState struct {
	Volume int
}

LeaseState is the current state of a lease which can be requested to be updated.

type LeaseVerifier

type LeaseVerifier interface {
	// VerifyLease is called to determine if the requested lease is valid.
	VerifyLease(
		descriptor LeaseDescriptor,
		state LeaseState,
	) error

	// LatestState returns the latest LeaseState for a given descriptor.
	LatestState(descriptor LeaseDescriptor) (LeaseState, error)
}

LeaseVerifier verifies that a lease is valid.

type Leaser

type Leaser interface {
	// UpdateOpenLease is called on the Leaser when the latest state
	// has changed and the leaser needs to update their lease. The leaser
	// should update its state (releasing any resources as necessary and
	// optionally acquiring new ones related to the updated lease) accordingly,
	// but it should *not* call LeaseManager.OpenLease() with the provided
	// descriptor and state.
	//
	// UpdateOpenLease will never be called concurrently on the same Leaser. Each
	// call to UpdateOpenLease() must return before the next one will begin.
	UpdateOpenLease(
		descriptor LeaseDescriptor,
		state LeaseState,
	) (UpdateOpenLeaseResult, error)
}

Leaser is a block leaser.

type Metadata

type Metadata struct {
	ID       ident.ID
	Tags     ident.Tags
	Start    time.Time
	Size     int64
	Checksum *uint32
	LastRead time.Time
}

Metadata captures block metadata

func NewMetadata

func NewMetadata(
	id ident.ID,
	tags ident.Tags,
	start time.Time,
	size int64,
	checksum *uint32,
	lastRead time.Time,
) Metadata

NewMetadata creates a new block metadata

func (*Metadata) Finalize

func (m *Metadata) Finalize()

Finalize will finalize the ID and Tags on the metadata.

type MockDatabaseBlock

type MockDatabaseBlock struct {
	// contains filtered or unexported fields
}

MockDatabaseBlock is a mock of DatabaseBlock interface

func NewMockDatabaseBlock

func NewMockDatabaseBlock(ctrl *gomock.Controller) *MockDatabaseBlock

NewMockDatabaseBlock creates a new mock instance

func (*MockDatabaseBlock) BlockSize

func (m *MockDatabaseBlock) BlockSize() time.Duration

BlockSize mocks base method

func (*MockDatabaseBlock) Checksum

func (m *MockDatabaseBlock) Checksum() (uint32, error)

Checksum mocks base method

func (*MockDatabaseBlock) Close

func (m *MockDatabaseBlock) Close()

Close mocks base method

func (*MockDatabaseBlock) CloseIfFromDisk

func (m *MockDatabaseBlock) CloseIfFromDisk() bool

CloseIfFromDisk mocks base method

func (*MockDatabaseBlock) Discard

func (m *MockDatabaseBlock) Discard() ts.Segment

Discard mocks base method

func (*MockDatabaseBlock) EXPECT

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

func (*MockDatabaseBlock) HasMergeTarget

func (m *MockDatabaseBlock) HasMergeTarget() bool

HasMergeTarget mocks base method

func (*MockDatabaseBlock) LastReadTime

func (m *MockDatabaseBlock) LastReadTime() time.Time

LastReadTime mocks base method

func (*MockDatabaseBlock) Len

func (m *MockDatabaseBlock) Len() int

Len mocks base method

func (*MockDatabaseBlock) Merge

func (m *MockDatabaseBlock) Merge(other DatabaseBlock) error

Merge mocks base method

func (*MockDatabaseBlock) OnEvictedFromWiredList

func (m *MockDatabaseBlock) OnEvictedFromWiredList() OnEvictedFromWiredList

OnEvictedFromWiredList mocks base method

func (*MockDatabaseBlock) Reset

func (m *MockDatabaseBlock) Reset(startTime time.Time, blockSize time.Duration, segment ts.Segment, nsCtx namespace.Context)

Reset mocks base method

func (*MockDatabaseBlock) ResetFromDisk

func (m *MockDatabaseBlock) ResetFromDisk(startTime time.Time, blockSize time.Duration, segment ts.Segment, id ident.ID, nsCtx namespace.Context)

ResetFromDisk mocks base method

func (*MockDatabaseBlock) SetLastReadTime

func (m *MockDatabaseBlock) SetLastReadTime(value time.Time)

SetLastReadTime mocks base method

func (*MockDatabaseBlock) SetOnEvictedFromWiredList

func (m *MockDatabaseBlock) SetOnEvictedFromWiredList(arg0 OnEvictedFromWiredList)

SetOnEvictedFromWiredList mocks base method

func (*MockDatabaseBlock) StartTime

func (m *MockDatabaseBlock) StartTime() time.Time

StartTime mocks base method

func (*MockDatabaseBlock) Stream

func (m *MockDatabaseBlock) Stream(blocker context.Context) (xio.BlockReader, error)

Stream mocks base method

func (*MockDatabaseBlock) WasRetrievedFromDisk

func (m *MockDatabaseBlock) WasRetrievedFromDisk() bool

WasRetrievedFromDisk mocks base method

type MockDatabaseBlockMockRecorder

type MockDatabaseBlockMockRecorder struct {
	// contains filtered or unexported fields
}

MockDatabaseBlockMockRecorder is the mock recorder for MockDatabaseBlock

func (*MockDatabaseBlockMockRecorder) BlockSize

func (mr *MockDatabaseBlockMockRecorder) BlockSize() *gomock.Call

BlockSize indicates an expected call of BlockSize

func (*MockDatabaseBlockMockRecorder) Checksum

func (mr *MockDatabaseBlockMockRecorder) Checksum() *gomock.Call

Checksum indicates an expected call of Checksum

func (*MockDatabaseBlockMockRecorder) Close

Close indicates an expected call of Close

func (*MockDatabaseBlockMockRecorder) CloseIfFromDisk

func (mr *MockDatabaseBlockMockRecorder) CloseIfFromDisk() *gomock.Call

CloseIfFromDisk indicates an expected call of CloseIfFromDisk

func (*MockDatabaseBlockMockRecorder) Discard

func (mr *MockDatabaseBlockMockRecorder) Discard() *gomock.Call

Discard indicates an expected call of Discard

func (*MockDatabaseBlockMockRecorder) HasMergeTarget

func (mr *MockDatabaseBlockMockRecorder) HasMergeTarget() *gomock.Call

HasMergeTarget indicates an expected call of HasMergeTarget

func (*MockDatabaseBlockMockRecorder) LastReadTime

func (mr *MockDatabaseBlockMockRecorder) LastReadTime() *gomock.Call

LastReadTime indicates an expected call of LastReadTime

func (*MockDatabaseBlockMockRecorder) Len

Len indicates an expected call of Len

func (*MockDatabaseBlockMockRecorder) Merge

func (mr *MockDatabaseBlockMockRecorder) Merge(other interface{}) *gomock.Call

Merge indicates an expected call of Merge

func (*MockDatabaseBlockMockRecorder) OnEvictedFromWiredList

func (mr *MockDatabaseBlockMockRecorder) OnEvictedFromWiredList() *gomock.Call

OnEvictedFromWiredList indicates an expected call of OnEvictedFromWiredList

func (*MockDatabaseBlockMockRecorder) Reset

func (mr *MockDatabaseBlockMockRecorder) Reset(startTime, blockSize, segment, nsCtx interface{}) *gomock.Call

Reset indicates an expected call of Reset

func (*MockDatabaseBlockMockRecorder) ResetFromDisk

func (mr *MockDatabaseBlockMockRecorder) ResetFromDisk(startTime, blockSize, segment, id, nsCtx interface{}) *gomock.Call

ResetFromDisk indicates an expected call of ResetFromDisk

func (*MockDatabaseBlockMockRecorder) SetLastReadTime

func (mr *MockDatabaseBlockMockRecorder) SetLastReadTime(value interface{}) *gomock.Call

SetLastReadTime indicates an expected call of SetLastReadTime

func (*MockDatabaseBlockMockRecorder) SetOnEvictedFromWiredList

func (mr *MockDatabaseBlockMockRecorder) SetOnEvictedFromWiredList(arg0 interface{}) *gomock.Call

SetOnEvictedFromWiredList indicates an expected call of SetOnEvictedFromWiredList

func (*MockDatabaseBlockMockRecorder) StartTime

func (mr *MockDatabaseBlockMockRecorder) StartTime() *gomock.Call

StartTime indicates an expected call of StartTime

func (*MockDatabaseBlockMockRecorder) Stream

func (mr *MockDatabaseBlockMockRecorder) Stream(blocker interface{}) *gomock.Call

Stream indicates an expected call of Stream

func (*MockDatabaseBlockMockRecorder) WasRetrievedFromDisk

func (mr *MockDatabaseBlockMockRecorder) WasRetrievedFromDisk() *gomock.Call

WasRetrievedFromDisk indicates an expected call of WasRetrievedFromDisk

type MockDatabaseBlockPool

type MockDatabaseBlockPool struct {
	// contains filtered or unexported fields
}

MockDatabaseBlockPool is a mock of DatabaseBlockPool interface

func NewMockDatabaseBlockPool

func NewMockDatabaseBlockPool(ctrl *gomock.Controller) *MockDatabaseBlockPool

NewMockDatabaseBlockPool creates a new mock instance

func (*MockDatabaseBlockPool) EXPECT

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

func (*MockDatabaseBlockPool) Get

Get mocks base method

func (*MockDatabaseBlockPool) Init

Init mocks base method

func (*MockDatabaseBlockPool) Put

func (m *MockDatabaseBlockPool) Put(block DatabaseBlock)

Put mocks base method

type MockDatabaseBlockPoolMockRecorder

type MockDatabaseBlockPoolMockRecorder struct {
	// contains filtered or unexported fields
}

MockDatabaseBlockPoolMockRecorder is the mock recorder for MockDatabaseBlockPool

func (*MockDatabaseBlockPoolMockRecorder) Get

Get indicates an expected call of Get

func (*MockDatabaseBlockPoolMockRecorder) Init

func (mr *MockDatabaseBlockPoolMockRecorder) Init(alloc interface{}) *gomock.Call

Init indicates an expected call of Init

func (*MockDatabaseBlockPoolMockRecorder) Put

func (mr *MockDatabaseBlockPoolMockRecorder) Put(block interface{}) *gomock.Call

Put indicates an expected call of Put

type MockDatabaseBlockRetriever

type MockDatabaseBlockRetriever struct {
	// contains filtered or unexported fields
}

MockDatabaseBlockRetriever is a mock of DatabaseBlockRetriever interface

func NewMockDatabaseBlockRetriever

func NewMockDatabaseBlockRetriever(ctrl *gomock.Controller) *MockDatabaseBlockRetriever

NewMockDatabaseBlockRetriever creates a new mock instance

func (*MockDatabaseBlockRetriever) CacheShardIndices

func (m *MockDatabaseBlockRetriever) CacheShardIndices(shards []uint32) error

CacheShardIndices mocks base method

func (*MockDatabaseBlockRetriever) EXPECT

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

func (*MockDatabaseBlockRetriever) Stream

func (m *MockDatabaseBlockRetriever) Stream(ctx context.Context, shard uint32, id ident.ID, blockStart time.Time, onRetrieve OnRetrieveBlock, nsCtx namespace.Context) (xio.BlockReader, error)

Stream mocks base method

type MockDatabaseBlockRetrieverManager

type MockDatabaseBlockRetrieverManager struct {
	// contains filtered or unexported fields
}

MockDatabaseBlockRetrieverManager is a mock of DatabaseBlockRetrieverManager interface

func NewMockDatabaseBlockRetrieverManager

func NewMockDatabaseBlockRetrieverManager(ctrl *gomock.Controller) *MockDatabaseBlockRetrieverManager

NewMockDatabaseBlockRetrieverManager creates a new mock instance

func (*MockDatabaseBlockRetrieverManager) EXPECT

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

func (*MockDatabaseBlockRetrieverManager) Retriever

Retriever mocks base method

type MockDatabaseBlockRetrieverManagerMockRecorder

type MockDatabaseBlockRetrieverManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockDatabaseBlockRetrieverManagerMockRecorder is the mock recorder for MockDatabaseBlockRetrieverManager

func (*MockDatabaseBlockRetrieverManagerMockRecorder) Retriever

func (mr *MockDatabaseBlockRetrieverManagerMockRecorder) Retriever(nsMetadata interface{}) *gomock.Call

Retriever indicates an expected call of Retriever

type MockDatabaseBlockRetrieverMockRecorder

type MockDatabaseBlockRetrieverMockRecorder struct {
	// contains filtered or unexported fields
}

MockDatabaseBlockRetrieverMockRecorder is the mock recorder for MockDatabaseBlockRetriever

func (*MockDatabaseBlockRetrieverMockRecorder) CacheShardIndices

func (mr *MockDatabaseBlockRetrieverMockRecorder) CacheShardIndices(shards interface{}) *gomock.Call

CacheShardIndices indicates an expected call of CacheShardIndices

func (*MockDatabaseBlockRetrieverMockRecorder) Stream

func (mr *MockDatabaseBlockRetrieverMockRecorder) Stream(ctx, shard, id, blockStart, onRetrieve, nsCtx interface{}) *gomock.Call

Stream indicates an expected call of Stream

type MockDatabaseSeriesBlocks

type MockDatabaseSeriesBlocks struct {
	// contains filtered or unexported fields
}

MockDatabaseSeriesBlocks is a mock of DatabaseSeriesBlocks interface

func NewMockDatabaseSeriesBlocks

func NewMockDatabaseSeriesBlocks(ctrl *gomock.Controller) *MockDatabaseSeriesBlocks

NewMockDatabaseSeriesBlocks creates a new mock instance

func (*MockDatabaseSeriesBlocks) AddBlock

func (m *MockDatabaseSeriesBlocks) AddBlock(block DatabaseBlock)

AddBlock mocks base method

func (*MockDatabaseSeriesBlocks) AddSeries

func (m *MockDatabaseSeriesBlocks) AddSeries(other DatabaseSeriesBlocks)

AddSeries mocks base method

func (*MockDatabaseSeriesBlocks) AllBlocks

AllBlocks mocks base method

func (*MockDatabaseSeriesBlocks) BlockAt

BlockAt mocks base method

func (*MockDatabaseSeriesBlocks) Close

func (m *MockDatabaseSeriesBlocks) Close()

Close mocks base method

func (*MockDatabaseSeriesBlocks) EXPECT

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

func (*MockDatabaseSeriesBlocks) Len

func (m *MockDatabaseSeriesBlocks) Len() int

Len mocks base method

func (*MockDatabaseSeriesBlocks) MaxTime

func (m *MockDatabaseSeriesBlocks) MaxTime() time.Time

MaxTime mocks base method

func (*MockDatabaseSeriesBlocks) MinTime

func (m *MockDatabaseSeriesBlocks) MinTime() time.Time

MinTime mocks base method

func (*MockDatabaseSeriesBlocks) RemoveAll

func (m *MockDatabaseSeriesBlocks) RemoveAll()

RemoveAll mocks base method

func (*MockDatabaseSeriesBlocks) RemoveBlockAt

func (m *MockDatabaseSeriesBlocks) RemoveBlockAt(t time.Time)

RemoveBlockAt mocks base method

func (*MockDatabaseSeriesBlocks) Reset

func (m *MockDatabaseSeriesBlocks) Reset()

Reset mocks base method

type MockDatabaseSeriesBlocksMockRecorder

type MockDatabaseSeriesBlocksMockRecorder struct {
	// contains filtered or unexported fields
}

MockDatabaseSeriesBlocksMockRecorder is the mock recorder for MockDatabaseSeriesBlocks

func (*MockDatabaseSeriesBlocksMockRecorder) AddBlock

func (mr *MockDatabaseSeriesBlocksMockRecorder) AddBlock(block interface{}) *gomock.Call

AddBlock indicates an expected call of AddBlock

func (*MockDatabaseSeriesBlocksMockRecorder) AddSeries

func (mr *MockDatabaseSeriesBlocksMockRecorder) AddSeries(other interface{}) *gomock.Call

AddSeries indicates an expected call of AddSeries

func (*MockDatabaseSeriesBlocksMockRecorder) AllBlocks

AllBlocks indicates an expected call of AllBlocks

func (*MockDatabaseSeriesBlocksMockRecorder) BlockAt

func (mr *MockDatabaseSeriesBlocksMockRecorder) BlockAt(t interface{}) *gomock.Call

BlockAt indicates an expected call of BlockAt

func (*MockDatabaseSeriesBlocksMockRecorder) Close

Close indicates an expected call of Close

func (*MockDatabaseSeriesBlocksMockRecorder) Len

Len indicates an expected call of Len

func (*MockDatabaseSeriesBlocksMockRecorder) MaxTime

MaxTime indicates an expected call of MaxTime

func (*MockDatabaseSeriesBlocksMockRecorder) MinTime

MinTime indicates an expected call of MinTime

func (*MockDatabaseSeriesBlocksMockRecorder) RemoveAll

RemoveAll indicates an expected call of RemoveAll

func (*MockDatabaseSeriesBlocksMockRecorder) RemoveBlockAt

func (mr *MockDatabaseSeriesBlocksMockRecorder) RemoveBlockAt(t interface{}) *gomock.Call

RemoveBlockAt indicates an expected call of RemoveBlockAt

func (*MockDatabaseSeriesBlocksMockRecorder) Reset

Reset indicates an expected call of Reset

type MockDatabaseShardBlockRetriever

type MockDatabaseShardBlockRetriever struct {
	// contains filtered or unexported fields
}

MockDatabaseShardBlockRetriever is a mock of DatabaseShardBlockRetriever interface

func NewMockDatabaseShardBlockRetriever

func NewMockDatabaseShardBlockRetriever(ctrl *gomock.Controller) *MockDatabaseShardBlockRetriever

NewMockDatabaseShardBlockRetriever creates a new mock instance

func (*MockDatabaseShardBlockRetriever) EXPECT

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

func (*MockDatabaseShardBlockRetriever) Stream

func (m *MockDatabaseShardBlockRetriever) Stream(ctx context.Context, id ident.ID, blockStart time.Time, onRetrieve OnRetrieveBlock, nsCtx namespace.Context) (xio.BlockReader, error)

Stream mocks base method

type MockDatabaseShardBlockRetrieverManager

type MockDatabaseShardBlockRetrieverManager struct {
	// contains filtered or unexported fields
}

MockDatabaseShardBlockRetrieverManager is a mock of DatabaseShardBlockRetrieverManager interface

func NewMockDatabaseShardBlockRetrieverManager

func NewMockDatabaseShardBlockRetrieverManager(ctrl *gomock.Controller) *MockDatabaseShardBlockRetrieverManager

NewMockDatabaseShardBlockRetrieverManager creates a new mock instance

func (*MockDatabaseShardBlockRetrieverManager) EXPECT

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

func (*MockDatabaseShardBlockRetrieverManager) ShardRetriever

ShardRetriever mocks base method

type MockDatabaseShardBlockRetrieverManagerMockRecorder

type MockDatabaseShardBlockRetrieverManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockDatabaseShardBlockRetrieverManagerMockRecorder is the mock recorder for MockDatabaseShardBlockRetrieverManager

func (*MockDatabaseShardBlockRetrieverManagerMockRecorder) ShardRetriever

func (mr *MockDatabaseShardBlockRetrieverManagerMockRecorder) ShardRetriever(shard interface{}) *gomock.Call

ShardRetriever indicates an expected call of ShardRetriever

type MockDatabaseShardBlockRetrieverMockRecorder

type MockDatabaseShardBlockRetrieverMockRecorder struct {
	// contains filtered or unexported fields
}

MockDatabaseShardBlockRetrieverMockRecorder is the mock recorder for MockDatabaseShardBlockRetriever

func (*MockDatabaseShardBlockRetrieverMockRecorder) Stream

func (mr *MockDatabaseShardBlockRetrieverMockRecorder) Stream(ctx, id, blockStart, onRetrieve, nsCtx interface{}) *gomock.Call

Stream indicates an expected call of Stream

type MockFetchBlockMetadataResults

type MockFetchBlockMetadataResults struct {
	// contains filtered or unexported fields
}

MockFetchBlockMetadataResults is a mock of FetchBlockMetadataResults interface

func NewMockFetchBlockMetadataResults

func NewMockFetchBlockMetadataResults(ctrl *gomock.Controller) *MockFetchBlockMetadataResults

NewMockFetchBlockMetadataResults creates a new mock instance

func (*MockFetchBlockMetadataResults) Add

Add mocks base method

func (*MockFetchBlockMetadataResults) Close

func (m *MockFetchBlockMetadataResults) Close()

Close mocks base method

func (*MockFetchBlockMetadataResults) EXPECT

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

func (*MockFetchBlockMetadataResults) Reset

func (m *MockFetchBlockMetadataResults) Reset()

Reset mocks base method

func (*MockFetchBlockMetadataResults) Results

Results mocks base method

func (*MockFetchBlockMetadataResults) Sort

Sort mocks base method

type MockFetchBlockMetadataResultsMockRecorder

type MockFetchBlockMetadataResultsMockRecorder struct {
	// contains filtered or unexported fields
}

MockFetchBlockMetadataResultsMockRecorder is the mock recorder for MockFetchBlockMetadataResults

func (*MockFetchBlockMetadataResultsMockRecorder) Add

func (mr *MockFetchBlockMetadataResultsMockRecorder) Add(res interface{}) *gomock.Call

Add indicates an expected call of Add

func (*MockFetchBlockMetadataResultsMockRecorder) Close

Close indicates an expected call of Close

func (*MockFetchBlockMetadataResultsMockRecorder) Reset

Reset indicates an expected call of Reset

func (*MockFetchBlockMetadataResultsMockRecorder) Results

Results indicates an expected call of Results

func (*MockFetchBlockMetadataResultsMockRecorder) Sort

Sort indicates an expected call of Sort

type MockFetchBlockMetadataResultsPool

type MockFetchBlockMetadataResultsPool struct {
	// contains filtered or unexported fields
}

MockFetchBlockMetadataResultsPool is a mock of FetchBlockMetadataResultsPool interface

func NewMockFetchBlockMetadataResultsPool

func NewMockFetchBlockMetadataResultsPool(ctrl *gomock.Controller) *MockFetchBlockMetadataResultsPool

NewMockFetchBlockMetadataResultsPool creates a new mock instance

func (*MockFetchBlockMetadataResultsPool) EXPECT

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

func (*MockFetchBlockMetadataResultsPool) Get

Get mocks base method

func (*MockFetchBlockMetadataResultsPool) Put

Put mocks base method

type MockFetchBlockMetadataResultsPoolMockRecorder

type MockFetchBlockMetadataResultsPoolMockRecorder struct {
	// contains filtered or unexported fields
}

MockFetchBlockMetadataResultsPoolMockRecorder is the mock recorder for MockFetchBlockMetadataResultsPool

func (*MockFetchBlockMetadataResultsPoolMockRecorder) Get

Get indicates an expected call of Get

func (*MockFetchBlockMetadataResultsPoolMockRecorder) Put

func (mr *MockFetchBlockMetadataResultsPoolMockRecorder) Put(res interface{}) *gomock.Call

Put indicates an expected call of Put

type MockFetchBlocksMetadataResults

type MockFetchBlocksMetadataResults struct {
	// contains filtered or unexported fields
}

MockFetchBlocksMetadataResults is a mock of FetchBlocksMetadataResults interface

func NewMockFetchBlocksMetadataResults

func NewMockFetchBlocksMetadataResults(ctrl *gomock.Controller) *MockFetchBlocksMetadataResults

NewMockFetchBlocksMetadataResults creates a new mock instance

func (*MockFetchBlocksMetadataResults) Add

Add mocks base method

func (*MockFetchBlocksMetadataResults) Close

func (m *MockFetchBlocksMetadataResults) Close()

Close mocks base method

func (*MockFetchBlocksMetadataResults) EXPECT

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

func (*MockFetchBlocksMetadataResults) Reset

func (m *MockFetchBlocksMetadataResults) Reset()

Reset mocks base method

func (*MockFetchBlocksMetadataResults) Results

Results mocks base method

type MockFetchBlocksMetadataResultsMockRecorder

type MockFetchBlocksMetadataResultsMockRecorder struct {
	// contains filtered or unexported fields
}

MockFetchBlocksMetadataResultsMockRecorder is the mock recorder for MockFetchBlocksMetadataResults

func (*MockFetchBlocksMetadataResultsMockRecorder) Add

func (mr *MockFetchBlocksMetadataResultsMockRecorder) Add(res interface{}) *gomock.Call

Add indicates an expected call of Add

func (*MockFetchBlocksMetadataResultsMockRecorder) Close

Close indicates an expected call of Close

func (*MockFetchBlocksMetadataResultsMockRecorder) Reset

Reset indicates an expected call of Reset

func (*MockFetchBlocksMetadataResultsMockRecorder) Results

Results indicates an expected call of Results

type MockFetchBlocksMetadataResultsPool

type MockFetchBlocksMetadataResultsPool struct {
	// contains filtered or unexported fields
}

MockFetchBlocksMetadataResultsPool is a mock of FetchBlocksMetadataResultsPool interface

func NewMockFetchBlocksMetadataResultsPool

func NewMockFetchBlocksMetadataResultsPool(ctrl *gomock.Controller) *MockFetchBlocksMetadataResultsPool

NewMockFetchBlocksMetadataResultsPool creates a new mock instance

func (*MockFetchBlocksMetadataResultsPool) EXPECT

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

func (*MockFetchBlocksMetadataResultsPool) Get

Get mocks base method

func (*MockFetchBlocksMetadataResultsPool) Put

Put mocks base method

type MockFetchBlocksMetadataResultsPoolMockRecorder

type MockFetchBlocksMetadataResultsPoolMockRecorder struct {
	// contains filtered or unexported fields
}

MockFetchBlocksMetadataResultsPoolMockRecorder is the mock recorder for MockFetchBlocksMetadataResultsPool

func (*MockFetchBlocksMetadataResultsPoolMockRecorder) Get

Get indicates an expected call of Get

func (*MockFetchBlocksMetadataResultsPoolMockRecorder) Put

Put indicates an expected call of Put

type MockFilteredBlocksMetadataIter

type MockFilteredBlocksMetadataIter struct {
	// contains filtered or unexported fields
}

MockFilteredBlocksMetadataIter is a mock of FilteredBlocksMetadataIter interface

func NewMockFilteredBlocksMetadataIter

func NewMockFilteredBlocksMetadataIter(ctrl *gomock.Controller) *MockFilteredBlocksMetadataIter

NewMockFilteredBlocksMetadataIter creates a new mock instance

func (*MockFilteredBlocksMetadataIter) Current

Current mocks base method

func (*MockFilteredBlocksMetadataIter) EXPECT

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

func (*MockFilteredBlocksMetadataIter) Err

Err mocks base method

func (*MockFilteredBlocksMetadataIter) Next

Next mocks base method

type MockFilteredBlocksMetadataIterMockRecorder

type MockFilteredBlocksMetadataIterMockRecorder struct {
	// contains filtered or unexported fields
}

MockFilteredBlocksMetadataIterMockRecorder is the mock recorder for MockFilteredBlocksMetadataIter

func (*MockFilteredBlocksMetadataIterMockRecorder) Current

Current indicates an expected call of Current

func (*MockFilteredBlocksMetadataIterMockRecorder) Err

Err indicates an expected call of Err

func (*MockFilteredBlocksMetadataIterMockRecorder) Next

Next indicates an expected call of Next

type MockLeaseManager

type MockLeaseManager struct {
	// contains filtered or unexported fields
}

MockLeaseManager is a mock of LeaseManager interface

func NewMockLeaseManager

func NewMockLeaseManager(ctrl *gomock.Controller) *MockLeaseManager

NewMockLeaseManager creates a new mock instance

func (*MockLeaseManager) EXPECT

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

func (*MockLeaseManager) OpenLatestLease

func (m *MockLeaseManager) OpenLatestLease(leaser Leaser, descriptor LeaseDescriptor) (LeaseState, error)

OpenLatestLease mocks base method

func (*MockLeaseManager) OpenLease

func (m *MockLeaseManager) OpenLease(leaser Leaser, descriptor LeaseDescriptor, state LeaseState) error

OpenLease mocks base method

func (*MockLeaseManager) RegisterLeaser

func (m *MockLeaseManager) RegisterLeaser(leaser Leaser) error

RegisterLeaser mocks base method

func (*MockLeaseManager) SetLeaseVerifier

func (m *MockLeaseManager) SetLeaseVerifier(leaseVerifier LeaseVerifier) error

SetLeaseVerifier mocks base method

func (*MockLeaseManager) UnregisterLeaser

func (m *MockLeaseManager) UnregisterLeaser(leaser Leaser) error

UnregisterLeaser mocks base method

func (*MockLeaseManager) UpdateOpenLeases

func (m *MockLeaseManager) UpdateOpenLeases(descriptor LeaseDescriptor, state LeaseState) (UpdateLeasesResult, error)

UpdateOpenLeases mocks base method

type MockLeaseManagerMockRecorder

type MockLeaseManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockLeaseManagerMockRecorder is the mock recorder for MockLeaseManager

func (*MockLeaseManagerMockRecorder) OpenLatestLease

func (mr *MockLeaseManagerMockRecorder) OpenLatestLease(leaser, descriptor interface{}) *gomock.Call

OpenLatestLease indicates an expected call of OpenLatestLease

func (*MockLeaseManagerMockRecorder) OpenLease

func (mr *MockLeaseManagerMockRecorder) OpenLease(leaser, descriptor, state interface{}) *gomock.Call

OpenLease indicates an expected call of OpenLease

func (*MockLeaseManagerMockRecorder) RegisterLeaser

func (mr *MockLeaseManagerMockRecorder) RegisterLeaser(leaser interface{}) *gomock.Call

RegisterLeaser indicates an expected call of RegisterLeaser

func (*MockLeaseManagerMockRecorder) SetLeaseVerifier

func (mr *MockLeaseManagerMockRecorder) SetLeaseVerifier(leaseVerifier interface{}) *gomock.Call

SetLeaseVerifier indicates an expected call of SetLeaseVerifier

func (*MockLeaseManagerMockRecorder) UnregisterLeaser

func (mr *MockLeaseManagerMockRecorder) UnregisterLeaser(leaser interface{}) *gomock.Call

UnregisterLeaser indicates an expected call of UnregisterLeaser

func (*MockLeaseManagerMockRecorder) UpdateOpenLeases

func (mr *MockLeaseManagerMockRecorder) UpdateOpenLeases(descriptor, state interface{}) *gomock.Call

UpdateOpenLeases indicates an expected call of UpdateOpenLeases

type MockLeaseVerifier

type MockLeaseVerifier struct {
	// contains filtered or unexported fields
}

MockLeaseVerifier is a mock of LeaseVerifier interface

func NewMockLeaseVerifier

func NewMockLeaseVerifier(ctrl *gomock.Controller) *MockLeaseVerifier

NewMockLeaseVerifier creates a new mock instance

func (*MockLeaseVerifier) EXPECT

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

func (*MockLeaseVerifier) LatestState

func (m *MockLeaseVerifier) LatestState(descriptor LeaseDescriptor) (LeaseState, error)

LatestState mocks base method

func (*MockLeaseVerifier) VerifyLease

func (m *MockLeaseVerifier) VerifyLease(descriptor LeaseDescriptor, state LeaseState) error

VerifyLease mocks base method

type MockLeaseVerifierMockRecorder

type MockLeaseVerifierMockRecorder struct {
	// contains filtered or unexported fields
}

MockLeaseVerifierMockRecorder is the mock recorder for MockLeaseVerifier

func (*MockLeaseVerifierMockRecorder) LatestState

func (mr *MockLeaseVerifierMockRecorder) LatestState(descriptor interface{}) *gomock.Call

LatestState indicates an expected call of LatestState

func (*MockLeaseVerifierMockRecorder) VerifyLease

func (mr *MockLeaseVerifierMockRecorder) VerifyLease(descriptor, state interface{}) *gomock.Call

VerifyLease indicates an expected call of VerifyLease

type MockLeaser

type MockLeaser struct {
	// contains filtered or unexported fields
}

MockLeaser is a mock of Leaser interface

func NewMockLeaser

func NewMockLeaser(ctrl *gomock.Controller) *MockLeaser

NewMockLeaser creates a new mock instance

func (*MockLeaser) EXPECT

func (m *MockLeaser) EXPECT() *MockLeaserMockRecorder

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

func (*MockLeaser) UpdateOpenLease

func (m *MockLeaser) UpdateOpenLease(descriptor LeaseDescriptor, state LeaseState) (UpdateOpenLeaseResult, error)

UpdateOpenLease mocks base method

type MockLeaserMockRecorder

type MockLeaserMockRecorder struct {
	// contains filtered or unexported fields
}

MockLeaserMockRecorder is the mock recorder for MockLeaser

func (*MockLeaserMockRecorder) UpdateOpenLease

func (mr *MockLeaserMockRecorder) UpdateOpenLease(descriptor, state interface{}) *gomock.Call

UpdateOpenLease indicates an expected call of UpdateOpenLease

type MockOnEvictedFromWiredList

type MockOnEvictedFromWiredList struct {
	// contains filtered or unexported fields
}

MockOnEvictedFromWiredList is a mock of OnEvictedFromWiredList interface

func NewMockOnEvictedFromWiredList

func NewMockOnEvictedFromWiredList(ctrl *gomock.Controller) *MockOnEvictedFromWiredList

NewMockOnEvictedFromWiredList creates a new mock instance

func (*MockOnEvictedFromWiredList) EXPECT

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

func (*MockOnEvictedFromWiredList) OnEvictedFromWiredList

func (m *MockOnEvictedFromWiredList) OnEvictedFromWiredList(id ident.ID, blockStart time.Time)

OnEvictedFromWiredList mocks base method

type MockOnEvictedFromWiredListMockRecorder

type MockOnEvictedFromWiredListMockRecorder struct {
	// contains filtered or unexported fields
}

MockOnEvictedFromWiredListMockRecorder is the mock recorder for MockOnEvictedFromWiredList

func (*MockOnEvictedFromWiredListMockRecorder) OnEvictedFromWiredList

func (mr *MockOnEvictedFromWiredListMockRecorder) OnEvictedFromWiredList(id, blockStart interface{}) *gomock.Call

OnEvictedFromWiredList indicates an expected call of OnEvictedFromWiredList

type MockOnReadBlock

type MockOnReadBlock struct {
	// contains filtered or unexported fields
}

MockOnReadBlock is a mock of OnReadBlock interface

func NewMockOnReadBlock

func NewMockOnReadBlock(ctrl *gomock.Controller) *MockOnReadBlock

NewMockOnReadBlock creates a new mock instance

func (*MockOnReadBlock) EXPECT

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

func (*MockOnReadBlock) OnReadBlock

func (m *MockOnReadBlock) OnReadBlock(b DatabaseBlock)

OnReadBlock mocks base method

type MockOnReadBlockMockRecorder

type MockOnReadBlockMockRecorder struct {
	// contains filtered or unexported fields
}

MockOnReadBlockMockRecorder is the mock recorder for MockOnReadBlock

func (*MockOnReadBlockMockRecorder) OnReadBlock

func (mr *MockOnReadBlockMockRecorder) OnReadBlock(b interface{}) *gomock.Call

OnReadBlock indicates an expected call of OnReadBlock

type MockOnRetrieveBlock

type MockOnRetrieveBlock struct {
	// contains filtered or unexported fields
}

MockOnRetrieveBlock is a mock of OnRetrieveBlock interface

func NewMockOnRetrieveBlock

func NewMockOnRetrieveBlock(ctrl *gomock.Controller) *MockOnRetrieveBlock

NewMockOnRetrieveBlock creates a new mock instance

func (*MockOnRetrieveBlock) EXPECT

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

func (*MockOnRetrieveBlock) OnRetrieveBlock

func (m *MockOnRetrieveBlock) OnRetrieveBlock(id ident.ID, tags ident.TagIterator, startTime time.Time, segment ts.Segment, nsCtx namespace.Context)

OnRetrieveBlock mocks base method

type MockOnRetrieveBlockMockRecorder

type MockOnRetrieveBlockMockRecorder struct {
	// contains filtered or unexported fields
}

MockOnRetrieveBlockMockRecorder is the mock recorder for MockOnRetrieveBlock

func (*MockOnRetrieveBlockMockRecorder) OnRetrieveBlock

func (mr *MockOnRetrieveBlockMockRecorder) OnRetrieveBlock(id, tags, startTime, segment, nsCtx interface{}) *gomock.Call

OnRetrieveBlock indicates an expected call of OnRetrieveBlock

type MockOptions

type MockOptions struct {
	// contains filtered or unexported fields
}

MockOptions is a mock of Options interface

func NewMockOptions

func NewMockOptions(ctrl *gomock.Controller) *MockOptions

NewMockOptions creates a new mock instance

func (*MockOptions) BytesPool

func (m *MockOptions) BytesPool() pool.CheckedBytesPool

BytesPool mocks base method

func (*MockOptions) ClockOptions

func (m *MockOptions) ClockOptions() clock.Options

ClockOptions mocks base method

func (*MockOptions) CloseContextWorkers

func (m *MockOptions) CloseContextWorkers() sync.WorkerPool

CloseContextWorkers mocks base method

func (*MockOptions) ContextPool

func (m *MockOptions) ContextPool() context.Pool

ContextPool mocks base method

func (*MockOptions) DatabaseBlockAllocSize

func (m *MockOptions) DatabaseBlockAllocSize() int

DatabaseBlockAllocSize mocks base method

func (*MockOptions) DatabaseBlockPool

func (m *MockOptions) DatabaseBlockPool() DatabaseBlockPool

DatabaseBlockPool mocks base method

func (*MockOptions) EXPECT

func (m *MockOptions) EXPECT() *MockOptionsMockRecorder

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

func (*MockOptions) EncoderPool

func (m *MockOptions) EncoderPool() encoding.EncoderPool

EncoderPool mocks base method

func (*MockOptions) MultiReaderIteratorPool

func (m *MockOptions) MultiReaderIteratorPool() encoding.MultiReaderIteratorPool

MultiReaderIteratorPool mocks base method

func (*MockOptions) ReaderIteratorPool

func (m *MockOptions) ReaderIteratorPool() encoding.ReaderIteratorPool

ReaderIteratorPool mocks base method

func (*MockOptions) SegmentReaderPool

func (m *MockOptions) SegmentReaderPool() xio.SegmentReaderPool

SegmentReaderPool mocks base method

func (*MockOptions) SetBytesPool

func (m *MockOptions) SetBytesPool(value pool.CheckedBytesPool) Options

SetBytesPool mocks base method

func (*MockOptions) SetClockOptions

func (m *MockOptions) SetClockOptions(value clock.Options) Options

SetClockOptions mocks base method

func (*MockOptions) SetCloseContextWorkers

func (m *MockOptions) SetCloseContextWorkers(value sync.WorkerPool) Options

SetCloseContextWorkers mocks base method

func (*MockOptions) SetContextPool

func (m *MockOptions) SetContextPool(value context.Pool) Options

SetContextPool mocks base method

func (*MockOptions) SetDatabaseBlockAllocSize

func (m *MockOptions) SetDatabaseBlockAllocSize(value int) Options

SetDatabaseBlockAllocSize mocks base method

func (*MockOptions) SetDatabaseBlockPool

func (m *MockOptions) SetDatabaseBlockPool(value DatabaseBlockPool) Options

SetDatabaseBlockPool mocks base method

func (*MockOptions) SetEncoderPool

func (m *MockOptions) SetEncoderPool(value encoding.EncoderPool) Options

SetEncoderPool mocks base method

func (*MockOptions) SetMultiReaderIteratorPool

func (m *MockOptions) SetMultiReaderIteratorPool(value encoding.MultiReaderIteratorPool) Options

SetMultiReaderIteratorPool mocks base method

func (*MockOptions) SetReaderIteratorPool

func (m *MockOptions) SetReaderIteratorPool(value encoding.ReaderIteratorPool) Options

SetReaderIteratorPool mocks base method

func (*MockOptions) SetSegmentReaderPool

func (m *MockOptions) SetSegmentReaderPool(value xio.SegmentReaderPool) Options

SetSegmentReaderPool mocks base method

func (*MockOptions) SetWiredList

func (m *MockOptions) SetWiredList(value *WiredList) Options

SetWiredList mocks base method

func (*MockOptions) WiredList

func (m *MockOptions) WiredList() *WiredList

WiredList mocks base method

type MockOptionsMockRecorder

type MockOptionsMockRecorder struct {
	// contains filtered or unexported fields
}

MockOptionsMockRecorder is the mock recorder for MockOptions

func (*MockOptionsMockRecorder) BytesPool

func (mr *MockOptionsMockRecorder) BytesPool() *gomock.Call

BytesPool indicates an expected call of BytesPool

func (*MockOptionsMockRecorder) ClockOptions

func (mr *MockOptionsMockRecorder) ClockOptions() *gomock.Call

ClockOptions indicates an expected call of ClockOptions

func (*MockOptionsMockRecorder) CloseContextWorkers

func (mr *MockOptionsMockRecorder) CloseContextWorkers() *gomock.Call

CloseContextWorkers indicates an expected call of CloseContextWorkers

func (*MockOptionsMockRecorder) ContextPool

func (mr *MockOptionsMockRecorder) ContextPool() *gomock.Call

ContextPool indicates an expected call of ContextPool

func (*MockOptionsMockRecorder) DatabaseBlockAllocSize

func (mr *MockOptionsMockRecorder) DatabaseBlockAllocSize() *gomock.Call

DatabaseBlockAllocSize indicates an expected call of DatabaseBlockAllocSize

func (*MockOptionsMockRecorder) DatabaseBlockPool

func (mr *MockOptionsMockRecorder) DatabaseBlockPool() *gomock.Call

DatabaseBlockPool indicates an expected call of DatabaseBlockPool

func (*MockOptionsMockRecorder) EncoderPool

func (mr *MockOptionsMockRecorder) EncoderPool() *gomock.Call

EncoderPool indicates an expected call of EncoderPool

func (*MockOptionsMockRecorder) MultiReaderIteratorPool

func (mr *MockOptionsMockRecorder) MultiReaderIteratorPool() *gomock.Call

MultiReaderIteratorPool indicates an expected call of MultiReaderIteratorPool

func (*MockOptionsMockRecorder) ReaderIteratorPool

func (mr *MockOptionsMockRecorder) ReaderIteratorPool() *gomock.Call

ReaderIteratorPool indicates an expected call of ReaderIteratorPool

func (*MockOptionsMockRecorder) SegmentReaderPool

func (mr *MockOptionsMockRecorder) SegmentReaderPool() *gomock.Call

SegmentReaderPool indicates an expected call of SegmentReaderPool

func (*MockOptionsMockRecorder) SetBytesPool

func (mr *MockOptionsMockRecorder) SetBytesPool(value interface{}) *gomock.Call

SetBytesPool indicates an expected call of SetBytesPool

func (*MockOptionsMockRecorder) SetClockOptions

func (mr *MockOptionsMockRecorder) SetClockOptions(value interface{}) *gomock.Call

SetClockOptions indicates an expected call of SetClockOptions

func (*MockOptionsMockRecorder) SetCloseContextWorkers

func (mr *MockOptionsMockRecorder) SetCloseContextWorkers(value interface{}) *gomock.Call

SetCloseContextWorkers indicates an expected call of SetCloseContextWorkers

func (*MockOptionsMockRecorder) SetContextPool

func (mr *MockOptionsMockRecorder) SetContextPool(value interface{}) *gomock.Call

SetContextPool indicates an expected call of SetContextPool

func (*MockOptionsMockRecorder) SetDatabaseBlockAllocSize

func (mr *MockOptionsMockRecorder) SetDatabaseBlockAllocSize(value interface{}) *gomock.Call

SetDatabaseBlockAllocSize indicates an expected call of SetDatabaseBlockAllocSize

func (*MockOptionsMockRecorder) SetDatabaseBlockPool

func (mr *MockOptionsMockRecorder) SetDatabaseBlockPool(value interface{}) *gomock.Call

SetDatabaseBlockPool indicates an expected call of SetDatabaseBlockPool

func (*MockOptionsMockRecorder) SetEncoderPool

func (mr *MockOptionsMockRecorder) SetEncoderPool(value interface{}) *gomock.Call

SetEncoderPool indicates an expected call of SetEncoderPool

func (*MockOptionsMockRecorder) SetMultiReaderIteratorPool

func (mr *MockOptionsMockRecorder) SetMultiReaderIteratorPool(value interface{}) *gomock.Call

SetMultiReaderIteratorPool indicates an expected call of SetMultiReaderIteratorPool

func (*MockOptionsMockRecorder) SetReaderIteratorPool

func (mr *MockOptionsMockRecorder) SetReaderIteratorPool(value interface{}) *gomock.Call

SetReaderIteratorPool indicates an expected call of SetReaderIteratorPool

func (*MockOptionsMockRecorder) SetSegmentReaderPool

func (mr *MockOptionsMockRecorder) SetSegmentReaderPool(value interface{}) *gomock.Call

SetSegmentReaderPool indicates an expected call of SetSegmentReaderPool

func (*MockOptionsMockRecorder) SetWiredList

func (mr *MockOptionsMockRecorder) SetWiredList(value interface{}) *gomock.Call

SetWiredList indicates an expected call of SetWiredList

func (*MockOptionsMockRecorder) WiredList

func (mr *MockOptionsMockRecorder) WiredList() *gomock.Call

WiredList indicates an expected call of WiredList

type MockdatabaseBlock

type MockdatabaseBlock struct {
	// contains filtered or unexported fields
}

MockdatabaseBlock is a mock of databaseBlock interface

func NewMockdatabaseBlock

func NewMockdatabaseBlock(ctrl *gomock.Controller) *MockdatabaseBlock

NewMockdatabaseBlock creates a new mock instance

func (*MockdatabaseBlock) EXPECT

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

type MockdatabaseBlockMockRecorder

type MockdatabaseBlockMockRecorder struct {
	// contains filtered or unexported fields
}

MockdatabaseBlockMockRecorder is the mock recorder for MockdatabaseBlock

type NewDatabaseBlockFn

type NewDatabaseBlockFn func() DatabaseBlock

NewDatabaseBlockFn creates a new database block.

type NewDatabaseBlockRetrieverFn

type NewDatabaseBlockRetrieverFn func(
	md namespace.Metadata,
) (DatabaseBlockRetriever, error)

NewDatabaseBlockRetrieverFn is a method for constructing new database block retrievers

type NoopLeaseManager

type NoopLeaseManager struct{}

NoopLeaseManager is a no-op implementation of LeaseManager.

func (*NoopLeaseManager) OpenLatestLease

func (n *NoopLeaseManager) OpenLatestLease(
	leaser Leaser,
	descriptor LeaseDescriptor,
) (LeaseState, error)

func (*NoopLeaseManager) OpenLease

func (n *NoopLeaseManager) OpenLease(
	leaser Leaser,
	descriptor LeaseDescriptor,
	state LeaseState,
) error

func (*NoopLeaseManager) RegisterLeaser

func (n *NoopLeaseManager) RegisterLeaser(leaser Leaser) error

func (*NoopLeaseManager) SetLeaseVerifier

func (n *NoopLeaseManager) SetLeaseVerifier(leaseVerifier LeaseVerifier) error

func (*NoopLeaseManager) UnregisterLeaser

func (n *NoopLeaseManager) UnregisterLeaser(leaser Leaser) error

func (*NoopLeaseManager) UpdateOpenLeases

func (n *NoopLeaseManager) UpdateOpenLeases(
	descriptor LeaseDescriptor,
	state LeaseState,
) (UpdateLeasesResult, error)

type OnEvictedFromWiredList

type OnEvictedFromWiredList interface {
	// OnEvictedFromWiredList is called when a block is evicted from the wired list.
	OnEvictedFromWiredList(id ident.ID, blockStart time.Time)
}

OnEvictedFromWiredList is implemented by a struct that wants to be notified when a block is evicted from the wired list.

type OnReadBlock

type OnReadBlock interface {
	OnReadBlock(b DatabaseBlock)
}

OnReadBlock is an interface to callback on when a block is read.

type OnRetrieveBlock

type OnRetrieveBlock interface {
	OnRetrieveBlock(
		id ident.ID,
		tags ident.TagIterator,
		startTime time.Time,
		segment ts.Segment,
		nsCtx namespace.Context,
	)
}

OnRetrieveBlock is an interface to callback on when a block is retrieved.

type OnRetrieveBlockFn

type OnRetrieveBlockFn func(
	id ident.ID,
	tags ident.TagIterator,
	startTime time.Time,
	segment ts.Segment,
	nsCtx namespace.Context,
)

OnRetrieveBlockFn is a function implementation for the OnRetrieveBlock interface.

func (OnRetrieveBlockFn) OnRetrieveBlock

func (fn OnRetrieveBlockFn) OnRetrieveBlock(
	id ident.ID,
	tags ident.TagIterator,
	startTime time.Time,
	segment ts.Segment,
	nsCtx namespace.Context,
)

OnRetrieveBlock implements the OnRetrieveBlock interface.

type Options

type Options interface {
	// SetClockOptions sets the clock options
	SetClockOptions(value clock.Options) Options

	// ClockOptions returns the clock options
	ClockOptions() clock.Options

	// SetDatabaseBlockAllocSize sets the databaseBlockAllocSize
	SetDatabaseBlockAllocSize(value int) Options

	// DatabaseBlockAllocSize returns the databaseBlockAllocSize
	DatabaseBlockAllocSize() int

	// SetCloseContextWorkers sets the workers for closing contexts
	SetCloseContextWorkers(value xsync.WorkerPool) Options

	// CloseContextWorkers returns the workers for closing contexts
	CloseContextWorkers() xsync.WorkerPool

	// SetDatabaseBlockPool sets the databaseBlockPool
	SetDatabaseBlockPool(value DatabaseBlockPool) Options

	// DatabaseBlockPool returns the databaseBlockPool
	DatabaseBlockPool() DatabaseBlockPool

	// SetContextPool sets the contextPool
	SetContextPool(value context.Pool) Options

	// ContextPool returns the contextPool
	ContextPool() context.Pool

	// SetEncoderPool sets the contextPool
	SetEncoderPool(value encoding.EncoderPool) Options

	// EncoderPool returns the contextPool
	EncoderPool() encoding.EncoderPool

	// SetReaderIteratorPool sets the readerIteratorPool
	SetReaderIteratorPool(value encoding.ReaderIteratorPool) Options

	// ReaderIteratorPool returns the readerIteratorPool
	ReaderIteratorPool() encoding.ReaderIteratorPool

	// SetMultiReaderIteratorPool sets the multiReaderIteratorPool
	SetMultiReaderIteratorPool(value encoding.MultiReaderIteratorPool) Options

	// MultiReaderIteratorPool returns the multiReaderIteratorPool
	MultiReaderIteratorPool() encoding.MultiReaderIteratorPool

	// SetSegmentReaderPool sets the contextPool
	SetSegmentReaderPool(value xio.SegmentReaderPool) Options

	// SegmentReaderPool returns the contextPool
	SegmentReaderPool() xio.SegmentReaderPool

	// SetBytesPool sets the bytesPool
	SetBytesPool(value pool.CheckedBytesPool) Options

	// BytesPool returns the bytesPool
	BytesPool() pool.CheckedBytesPool

	// SetWiredList sets the database block wired list
	SetWiredList(value *WiredList) Options

	// WiredList returns the database block wired list
	WiredList() *WiredList
}

Options represents the options for a database block

func NewOptions

func NewOptions() Options

NewOptions creates new database block options

type ReplicaMetadata

type ReplicaMetadata struct {
	Metadata

	Host topology.Host
}

ReplicaMetadata captures block metadata along with corresponding peer identifier for a single replica of a block

type RetrievableBlockMetadata

type RetrievableBlockMetadata struct {
	ID       ident.ID
	Length   int
	Checksum uint32
}

RetrievableBlockMetadata describes a retrievable block.

type UpdateLeasesResult

type UpdateLeasesResult struct {
	LeasersUpdatedLease int
	LeasersNoOpenLease  int
}

UpdateLeasesResult is the result of a call to update leases.

type UpdateOpenLeaseResult

type UpdateOpenLeaseResult uint

UpdateOpenLeaseResult is the result of processing an update lease.

const (
	// UpdateOpenLease is used to communicate a lease updated successfully.
	UpdateOpenLease UpdateOpenLeaseResult = iota
	// NoOpenLease is used to communicate there is no related open lease.
	NoOpenLease
)

type WiredList

type WiredList struct {
	sync.Mutex
	// contains filtered or unexported fields
}

WiredList is a database block wired list.

func NewWiredList

func NewWiredList(opts WiredListOptions) *WiredList

NewWiredList returns a new database block wired list.

func (*WiredList) BlockingUpdate

func (l *WiredList) BlockingUpdate(v DatabaseBlock)

BlockingUpdate places the block into the channel of blocks which are waiting to notify the wired list that they were accessed. All updates must be processed through this channel to force synchronization.

We use a channel and a background processing goroutine to reduce blocking / lock contention.

func (*WiredList) NonBlockingUpdate

func (l *WiredList) NonBlockingUpdate(v DatabaseBlock) bool

NonBlockingUpdate will attempt to put the block in the events channel, but will not block if the channel is full. Used in cases where a blocking update could trigger deadlock with the WiredList itself.

func (*WiredList) SetRuntimeOptions

func (l *WiredList) SetRuntimeOptions(value runtime.Options)

SetRuntimeOptions sets the current runtime options to be consumed by the wired list

func (*WiredList) Start

func (l *WiredList) Start() error

Start starts processing the wired list

func (*WiredList) Stop

func (l *WiredList) Stop() error

Stop stops processing the wired list

type WiredListOptions

type WiredListOptions struct {
	RuntimeOptionsManager runtime.OptionsManager
	InstrumentOptions     instrument.Options
	ClockOptions          clock.Options
	EventsChannelSize     int
}

WiredListOptions is the options struct for the WiredList constructor.

Jump to

Keyboard shortcuts

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