lookup

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

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 is finished.

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) ReaderWriterCount

func (entry *Entry) ReaderWriterCount() int32

ReaderWriterCount returns the current ref count on the Entry.

Jump to

Keyboard shortcuts

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