Documentation ¶
Overview ¶
Package ts is a generated GoMock package.
Index ¶
- type Annotation
- type BatchWrite
- type BatchWriter
- type Datapoint
- type EncodedTags
- type FinalizeAnnotationFn
- type FinalizeEncodedTagsFn
- type MockBatchWriter
- func (m *MockBatchWriter) Add(originalIndex int, id ident.ID, timestamp time.Time, value float64, ...) error
- func (m *MockBatchWriter) AddTagged(originalIndex int, id ident.ID, tags ident.TagIterator, ...) error
- func (m *MockBatchWriter) EXPECT() *MockBatchWriterMockRecorder
- func (m *MockBatchWriter) SetFinalizeAnnotationFn(f FinalizeAnnotationFn)
- func (m *MockBatchWriter) SetFinalizeEncodedTagsFn(f FinalizeEncodedTagsFn)
- type MockBatchWriterMockRecorder
- func (mr *MockBatchWriterMockRecorder) Add(originalIndex, id, timestamp, value, unit, annotation interface{}) *gomock.Call
- func (mr *MockBatchWriterMockRecorder) AddTagged(...) *gomock.Call
- func (mr *MockBatchWriterMockRecorder) SetFinalizeAnnotationFn(f interface{}) *gomock.Call
- func (mr *MockBatchWriterMockRecorder) SetFinalizeEncodedTagsFn(f interface{}) *gomock.Call
- type MockWriteBatch
- func (m *MockWriteBatch) Add(originalIndex int, id ident.ID, timestamp time.Time, value float64, ...) error
- func (m *MockWriteBatch) AddTagged(originalIndex int, id ident.ID, tags ident.TagIterator, ...) error
- func (m *MockWriteBatch) EXPECT() *MockWriteBatchMockRecorder
- func (m *MockWriteBatch) Finalize()
- func (m *MockWriteBatch) Iter() []BatchWrite
- func (m *MockWriteBatch) Reset(batchSize int, ns ident.ID)
- func (m *MockWriteBatch) SetFinalizeAnnotationFn(f FinalizeAnnotationFn)
- func (m *MockWriteBatch) SetFinalizeEncodedTagsFn(f FinalizeEncodedTagsFn)
- func (m *MockWriteBatch) SetOutcome(idx int, series Series, err error)
- func (m *MockWriteBatch) SetSkipWrite(idx int)
- type MockWriteBatchMockRecorder
- func (mr *MockWriteBatchMockRecorder) Add(originalIndex, id, timestamp, value, unit, annotation interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) AddTagged(...) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) Finalize() *gomock.Call
- func (mr *MockWriteBatchMockRecorder) Iter() *gomock.Call
- func (mr *MockWriteBatchMockRecorder) Reset(batchSize, ns interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetFinalizeAnnotationFn(f interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetFinalizeEncodedTagsFn(f interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetOutcome(idx, series, err interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetSkipWrite(idx interface{}) *gomock.Call
- type Segment
- type SegmentFlags
- type Series
- type Write
- type WriteBatch
- type WriteBatchPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation []byte
Annotation represents information used to annotate datapoints.
type BatchWrite ¶
type BatchWrite struct { // Used by the commitlog. If this is false, the commitlog should not write // the series at this index. SkipWrite bool // Used by the commitlog (series needed to be updated by the shard // object first, cannot use the Series provided by the caller as it // is missing important fields like Tags.) Write Write // Not used by the commitlog, provided by the caller (since the request // is usually coming from over the wire) and is superseded by the Tags // in Write.Series which will get set by the Shard object. TagIter ident.TagIterator // EncodedTags is used by the commit log, but also held onto as a reference // here so that it can be returned to the pool after the write to commit log // completes (since the Write.Series gets overwritten in SetOutcome so can't // use the reference there for returning to the pool). EncodedTags EncodedTags // Used to help the caller tie errors back to an index in their // own collection. OriginalIndex int // Used by the commitlog. Err error }
BatchWrite represents a write that was added to the BatchWriter.
type BatchWriter ¶
type BatchWriter interface { Add( originalIndex int, id ident.ID, timestamp time.Time, value float64, unit xtime.Unit, annotation []byte, ) error AddTagged( originalIndex int, id ident.ID, tags ident.TagIterator, encodedTags EncodedTags, timestamp time.Time, value float64, unit xtime.Unit, annotation []byte, ) error SetFinalizeEncodedTagsFn(f FinalizeEncodedTagsFn) SetFinalizeAnnotationFn(f FinalizeAnnotationFn) }
BatchWriter is the interface that is used for preparing a batch of writes.
type FinalizeAnnotationFn ¶
type FinalizeAnnotationFn func(b []byte)
FinalizeAnnotationFn is a function that will be called for each annotation once the WriteBatch itself is finalized.
type FinalizeEncodedTagsFn ¶
type FinalizeEncodedTagsFn func(b []byte)
FinalizeEncodedTagsFn is a function that will be called for each encoded tags once the WriteBatch itself is finalized.
type MockBatchWriter ¶
type MockBatchWriter struct {
// contains filtered or unexported fields
}
MockBatchWriter is a mock of BatchWriter interface
func NewMockBatchWriter ¶
func NewMockBatchWriter(ctrl *gomock.Controller) *MockBatchWriter
NewMockBatchWriter creates a new mock instance
func (*MockBatchWriter) Add ¶
func (m *MockBatchWriter) Add(originalIndex int, id ident.ID, timestamp time.Time, value float64, unit time0.Unit, annotation []byte) error
Add mocks base method
func (*MockBatchWriter) AddTagged ¶
func (m *MockBatchWriter) AddTagged(originalIndex int, id ident.ID, tags ident.TagIterator, encodedTags EncodedTags, timestamp time.Time, value float64, unit time0.Unit, annotation []byte) error
AddTagged mocks base method
func (*MockBatchWriter) EXPECT ¶
func (m *MockBatchWriter) EXPECT() *MockBatchWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockBatchWriter) SetFinalizeAnnotationFn ¶
func (m *MockBatchWriter) SetFinalizeAnnotationFn(f FinalizeAnnotationFn)
SetFinalizeAnnotationFn mocks base method
func (*MockBatchWriter) SetFinalizeEncodedTagsFn ¶
func (m *MockBatchWriter) SetFinalizeEncodedTagsFn(f FinalizeEncodedTagsFn)
SetFinalizeEncodedTagsFn mocks base method
type MockBatchWriterMockRecorder ¶
type MockBatchWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockBatchWriterMockRecorder is the mock recorder for MockBatchWriter
func (*MockBatchWriterMockRecorder) Add ¶
func (mr *MockBatchWriterMockRecorder) Add(originalIndex, id, timestamp, value, unit, annotation interface{}) *gomock.Call
Add indicates an expected call of Add
func (*MockBatchWriterMockRecorder) AddTagged ¶
func (mr *MockBatchWriterMockRecorder) AddTagged(originalIndex, id, tags, encodedTags, timestamp, value, unit, annotation interface{}) *gomock.Call
AddTagged indicates an expected call of AddTagged
func (*MockBatchWriterMockRecorder) SetFinalizeAnnotationFn ¶
func (mr *MockBatchWriterMockRecorder) SetFinalizeAnnotationFn(f interface{}) *gomock.Call
SetFinalizeAnnotationFn indicates an expected call of SetFinalizeAnnotationFn
func (*MockBatchWriterMockRecorder) SetFinalizeEncodedTagsFn ¶
func (mr *MockBatchWriterMockRecorder) SetFinalizeEncodedTagsFn(f interface{}) *gomock.Call
SetFinalizeEncodedTagsFn indicates an expected call of SetFinalizeEncodedTagsFn
type MockWriteBatch ¶
type MockWriteBatch struct {
// contains filtered or unexported fields
}
MockWriteBatch is a mock of WriteBatch interface
func NewMockWriteBatch ¶
func NewMockWriteBatch(ctrl *gomock.Controller) *MockWriteBatch
NewMockWriteBatch creates a new mock instance
func (*MockWriteBatch) Add ¶
func (m *MockWriteBatch) Add(originalIndex int, id ident.ID, timestamp time.Time, value float64, unit time0.Unit, annotation []byte) error
Add mocks base method
func (*MockWriteBatch) AddTagged ¶
func (m *MockWriteBatch) AddTagged(originalIndex int, id ident.ID, tags ident.TagIterator, encodedTags EncodedTags, timestamp time.Time, value float64, unit time0.Unit, annotation []byte) error
AddTagged mocks base method
func (*MockWriteBatch) EXPECT ¶
func (m *MockWriteBatch) EXPECT() *MockWriteBatchMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockWriteBatch) Reset ¶
func (m *MockWriteBatch) Reset(batchSize int, ns ident.ID)
Reset mocks base method
func (*MockWriteBatch) SetFinalizeAnnotationFn ¶
func (m *MockWriteBatch) SetFinalizeAnnotationFn(f FinalizeAnnotationFn)
SetFinalizeAnnotationFn mocks base method
func (*MockWriteBatch) SetFinalizeEncodedTagsFn ¶
func (m *MockWriteBatch) SetFinalizeEncodedTagsFn(f FinalizeEncodedTagsFn)
SetFinalizeEncodedTagsFn mocks base method
func (*MockWriteBatch) SetOutcome ¶
func (m *MockWriteBatch) SetOutcome(idx int, series Series, err error)
SetOutcome mocks base method
func (*MockWriteBatch) SetSkipWrite ¶
func (m *MockWriteBatch) SetSkipWrite(idx int)
SetSkipWrite mocks base method
type MockWriteBatchMockRecorder ¶
type MockWriteBatchMockRecorder struct {
// contains filtered or unexported fields
}
MockWriteBatchMockRecorder is the mock recorder for MockWriteBatch
func (*MockWriteBatchMockRecorder) Add ¶
func (mr *MockWriteBatchMockRecorder) Add(originalIndex, id, timestamp, value, unit, annotation interface{}) *gomock.Call
Add indicates an expected call of Add
func (*MockWriteBatchMockRecorder) AddTagged ¶
func (mr *MockWriteBatchMockRecorder) AddTagged(originalIndex, id, tags, encodedTags, timestamp, value, unit, annotation interface{}) *gomock.Call
AddTagged indicates an expected call of AddTagged
func (*MockWriteBatchMockRecorder) Finalize ¶
func (mr *MockWriteBatchMockRecorder) Finalize() *gomock.Call
Finalize indicates an expected call of Finalize
func (*MockWriteBatchMockRecorder) Iter ¶
func (mr *MockWriteBatchMockRecorder) Iter() *gomock.Call
Iter indicates an expected call of Iter
func (*MockWriteBatchMockRecorder) Reset ¶
func (mr *MockWriteBatchMockRecorder) Reset(batchSize, ns interface{}) *gomock.Call
Reset indicates an expected call of Reset
func (*MockWriteBatchMockRecorder) SetFinalizeAnnotationFn ¶
func (mr *MockWriteBatchMockRecorder) SetFinalizeAnnotationFn(f interface{}) *gomock.Call
SetFinalizeAnnotationFn indicates an expected call of SetFinalizeAnnotationFn
func (*MockWriteBatchMockRecorder) SetFinalizeEncodedTagsFn ¶
func (mr *MockWriteBatchMockRecorder) SetFinalizeEncodedTagsFn(f interface{}) *gomock.Call
SetFinalizeEncodedTagsFn indicates an expected call of SetFinalizeEncodedTagsFn
func (*MockWriteBatchMockRecorder) SetOutcome ¶
func (mr *MockWriteBatchMockRecorder) SetOutcome(idx, series, err interface{}) *gomock.Call
SetOutcome indicates an expected call of SetOutcome
func (*MockWriteBatchMockRecorder) SetSkipWrite ¶
func (mr *MockWriteBatchMockRecorder) SetSkipWrite(idx interface{}) *gomock.Call
SetSkipWrite indicates an expected call of SetSkipWrite
type Segment ¶
type Segment struct { // Head is the head of the segment. Head checked.Bytes // Tail is the tail of the segment. Tail checked.Bytes // SegmentFlags declares whether to finalize when finalizing the segment. Flags SegmentFlags }
Segment represents a binary blob consisting of two byte slices and declares whether they should be finalized when the segment is finalized.
func NewSegment ¶
func NewSegment( head, tail checked.Bytes, flags SegmentFlags, ) Segment
NewSegment will create a new segment and increment the refs to head and tail if they are non-nil. When finalized the segment will also finalize the byte slices if FinalizeBytes is passed.
func (*Segment) Clone ¶
func (s *Segment) Clone(pool pool.CheckedBytesPool) Segment
Clone will create a copy of this segment with an optional bytes pool.
func (*Segment) Equal ¶
Equal returns if this segment is equal to another. WARNING: This should only be used in code paths not executed often as it allocates bytes to concat each segment head and tail together before comparing the contents.
type SegmentFlags ¶
type SegmentFlags uint8
SegmentFlags describes the option to finalize or not finalize bytes in a Segment.
const ( // FinalizeNone specifies to finalize neither of the bytes FinalizeNone SegmentFlags = 1 << 0 // FinalizeHead specifies to finalize the head bytes FinalizeHead SegmentFlags = 1 << 1 // FinalizeTail specifies to finalize the tail bytes FinalizeTail SegmentFlags = 1 << 2 )
type Series ¶
type Series struct { // UniqueIndex is the unique index assigned to this series (only valid // on a per-process basis). UniqueIndex uint64 // Namespace is the namespace the series belongs to. Namespace ident.ID // ID is the series identifier. ID ident.ID // Tags are the series tags. Tags ident.Tags // EncodedTags are the series encoded tags, if set then call sites can // avoid needing to encoded the tags from the series tags provided. EncodedTags EncodedTags // Shard is the shard the series belongs to. Shard uint32 }
Series describes a series.
type Write ¶
type Write struct { Series Series Datapoint Datapoint Unit xtime.Unit Annotation Annotation }
Write is a write for the commitlog.
type WriteBatch ¶
type WriteBatch interface { BatchWriter // Can't use a real iterator pattern here as it slows things down. Iter() []BatchWrite SetOutcome(idx int, series Series, err error) SetSkipWrite(idx int) Reset(batchSize int, ns ident.ID) Finalize() // contains filtered or unexported methods }
WriteBatch is the interface that supports adding writes to the batch, as well as iterating through the batched writes and resetting the struct (for pooling).
func NewWriteBatch ¶
func NewWriteBatch( batchSize int, ns ident.ID, finalizeFn func(WriteBatch), ) WriteBatch
NewWriteBatch creates a new WriteBatch.
type WriteBatchPool ¶
type WriteBatchPool struct {
// contains filtered or unexported fields
}
WriteBatchPool is a pool of WriteBatch.
func NewWriteBatchPool ¶
func NewWriteBatchPool( opts pool.ObjectPoolOptions, initialBatchSizeOverride, maxBatchSizeOverride *int, ) *WriteBatchPool
NewWriteBatchPool constructs a new WriteBatchPool.
func (*WriteBatchPool) Get ¶
func (p *WriteBatchPool) Get() WriteBatch
Get retrieves a WriteBatch from the pool.
func (*WriteBatchPool) Put ¶
func (p *WriteBatchPool) Put(w WriteBatch)
Put stores a WriteBatch in the pool.