Documentation ¶
Index ¶
- type Entry
- func (entry *Entry) DecrementReaderWriterCount()
- func (entry *Entry) IncrementReaderWriterCount()
- func (entry *Entry) IndexedForBlockStart(indexBlockStart xtime.UnixNano) bool
- func (entry *Entry) NeedsIndexUpdate(indexBlockStartForWrite xtime.UnixNano) bool
- func (entry *Entry) OnIndexFinalize(blockStartNanos xtime.UnixNano)
- func (entry *Entry) OnIndexPrepare()
- func (entry *Entry) OnIndexSuccess(blockStartNanos xtime.UnixNano)
- func (entry *Entry) ReaderWriterCount() int32
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 ¶
IndexedForBlockStart returns a bool to indicate if the Entry has been successfully indexed for the given index blockstart.
func (*Entry) NeedsIndexUpdate ¶
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 ¶
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 ¶
OnIndexSuccess marks the given block start as successfully indexed.
func (*Entry) ReaderWriterCount ¶
ReaderWriterCount returns the current ref count on the Entry.