lookup

package
v0.15.17-hotfix.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package lookup is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Series series.DatabaseSeries
	Index  uint64
	// contains filtered or unexported fields
}

Entry is the entry in the shard ident.ID -> series map. It has additional members to track lifecycle and minimize indexing overhead. NB: users are expected to use `NewEntry` to construct these objects.

func NewEntry

func NewEntry(series series.DatabaseSeries, index uint64) *Entry

NewEntry returns a new Entry.

func (*Entry) DecrementReaderWriterCount

func (entry *Entry) DecrementReaderWriterCount()

DecrementReaderWriterCount decrements the ref count on the Entry.

func (*Entry) IncrementReaderWriterCount

func (entry *Entry) IncrementReaderWriterCount()

IncrementReaderWriterCount increments the ref count on the Entry.

func (*Entry) IndexedForBlockStart

func (entry *Entry) IndexedForBlockStart(indexBlockStart xtime.UnixNano) bool

IndexedForBlockStart returns a bool to indicate if the Entry has been successfully indexed for the given index blockstart.

func (*Entry) NeedsIndexUpdate

func (entry *Entry) NeedsIndexUpdate(indexBlockStartForWrite xtime.UnixNano) bool

NeedsIndexUpdate returns a bool to indicate if the Entry needs to be indexed for the provided blockStart. It only allows a single index attempt at a time for a single entry. NB(prateek): NeedsIndexUpdate is a CAS, i.e. when this method returns true, it also sets state on the entry to indicate that a write for the given blockStart is going to be sent to the index, and other go routines should not attempt the same write. Callers are expected to ensure they follow this guideline. Further, every call to NeedsIndexUpdate which returns true needs to have a corresponding OnIndexFinalze() call. This is required for correct lifecycle maintenance.

func (*Entry) OnIndexFinalize

func (entry *Entry) OnIndexFinalize(blockStartNanos xtime.UnixNano)

OnIndexFinalize marks any attempt for the given block start as finished and decrements the entry ref count.

func (*Entry) OnIndexPrepare

func (entry *Entry) OnIndexPrepare()

OnIndexPrepare prepares the Entry to be handed off to the indexing sub-system. NB(prateek): we retain the ref count on the entry while the indexing is pending, the callback executed on the entry once the indexing is completed releases this reference.

func (*Entry) OnIndexSuccess

func (entry *Entry) OnIndexSuccess(blockStartNanos xtime.UnixNano)

OnIndexSuccess marks the given block start as successfully indexed.

func (*Entry) OnReleaseReadWriteRef added in v0.15.0

func (entry *Entry) OnReleaseReadWriteRef()

OnReleaseReadWriteRef decrements a read/write ref, it's named differently to decouple the concrete task needed when a ref is released and the intent to release the ref (simpler for caller readability/reasoning).

func (*Entry) ReaderWriterCount

func (entry *Entry) ReaderWriterCount() int32

ReaderWriterCount returns the current ref count on the Entry.

type MockOnReleaseReadWriteRef added in v0.15.0

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

MockOnReleaseReadWriteRef is a mock of OnReleaseReadWriteRef interface

func NewMockOnReleaseReadWriteRef added in v0.15.0

func NewMockOnReleaseReadWriteRef(ctrl *gomock.Controller) *MockOnReleaseReadWriteRef

NewMockOnReleaseReadWriteRef creates a new mock instance

func (*MockOnReleaseReadWriteRef) EXPECT added in v0.15.0

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

func (*MockOnReleaseReadWriteRef) OnReleaseReadWriteRef added in v0.15.0

func (m *MockOnReleaseReadWriteRef) OnReleaseReadWriteRef()

OnReleaseReadWriteRef mocks base method

type MockOnReleaseReadWriteRefMockRecorder added in v0.15.0

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

MockOnReleaseReadWriteRefMockRecorder is the mock recorder for MockOnReleaseReadWriteRef

func (*MockOnReleaseReadWriteRefMockRecorder) OnReleaseReadWriteRef added in v0.15.0

func (mr *MockOnReleaseReadWriteRefMockRecorder) OnReleaseReadWriteRef() *gomock.Call

OnReleaseReadWriteRef indicates an expected call of OnReleaseReadWriteRef

type OnReleaseReadWriteRef added in v0.15.0

type OnReleaseReadWriteRef interface {
	OnReleaseReadWriteRef()
}

OnReleaseReadWriteRef is a callback that can release a strongly held series read/write ref.

Jump to

Keyboard shortcuts

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