Documentation ¶
Overview ¶
Package writes is a generated GoMock package.
Index ¶
- type BatchWrite
- type BatchWriter
- type FinalizeAnnotationFn
- type FinalizeEncodedTagsFn
- type MockBatchWriter
- func (m *MockBatchWriter) Add(originalIndex int, id ident.ID, timestamp time.UnixNano, value float64, ...) error
- func (m *MockBatchWriter) AddTagged(originalIndex int, id ident.ID, encodedTags ts.EncodedTags, ...) 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(originalIndex, id, encodedTags, timestamp, value, unit, annotation interface{}) *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.UnixNano, value float64, ...) error
- func (m *MockWriteBatch) AddTagged(originalIndex int, id ident.ID, encodedTags ts.EncodedTags, ...) error
- func (m *MockWriteBatch) EXPECT() *MockWriteBatchMockRecorder
- func (m *MockWriteBatch) Finalize()
- func (m *MockWriteBatch) Iter() []BatchWrite
- func (m *MockWriteBatch) PendingIndex() []PendingIndexInsert
- func (m *MockWriteBatch) Reset(batchSize int, ns ident.ID)
- func (m *MockWriteBatch) SetError(idx int, err error)
- func (m *MockWriteBatch) SetFinalizeAnnotationFn(f FinalizeAnnotationFn)
- func (m *MockWriteBatch) SetFinalizeEncodedTagsFn(f FinalizeEncodedTagsFn)
- func (m *MockWriteBatch) SetPendingIndex(idx int, pending PendingIndexInsert)
- func (m *MockWriteBatch) SetSeries(idx int, series ts.Series)
- 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(originalIndex, id, encodedTags, timestamp, value, unit, annotation interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) Finalize() *gomock.Call
- func (mr *MockWriteBatchMockRecorder) Iter() *gomock.Call
- func (mr *MockWriteBatchMockRecorder) PendingIndex() *gomock.Call
- func (mr *MockWriteBatchMockRecorder) Reset(batchSize, ns interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetError(idx, err interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetFinalizeAnnotationFn(f interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetFinalizeEncodedTagsFn(f interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetPendingIndex(idx, pending interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetSeries(idx, series interface{}) *gomock.Call
- func (mr *MockWriteBatchMockRecorder) SetSkipWrite(idx interface{}) *gomock.Call
- type PendingIndexInsert
- type Write
- type WriteBatch
- type WriteBatchPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 // PendingIndex returns whether a write has a pending index. PendingIndex 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 // 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 ts.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 xtime.UnixNano, value float64, unit xtime.Unit, annotation []byte, ) error AddTagged( originalIndex int, id ident.ID, encodedTags ts.EncodedTags, timestamp xtime.UnixNano, 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.UnixNano, value float64, unit time.Unit, annotation []byte) error
Add mocks base method.
func (*MockBatchWriter) AddTagged ¶
func (m *MockBatchWriter) AddTagged(originalIndex int, id ident.ID, encodedTags ts.EncodedTags, timestamp time.UnixNano, value float64, unit time.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, 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.UnixNano, value float64, unit time.Unit, annotation []byte) error
Add mocks base method.
func (*MockWriteBatch) AddTagged ¶
func (m *MockWriteBatch) AddTagged(originalIndex int, id ident.ID, encodedTags ts.EncodedTags, timestamp time.UnixNano, value float64, unit time.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) PendingIndex ¶
func (m *MockWriteBatch) PendingIndex() []PendingIndexInsert
PendingIndex mocks base method.
func (*MockWriteBatch) Reset ¶
func (m *MockWriteBatch) Reset(batchSize int, ns ident.ID)
Reset mocks base method.
func (*MockWriteBatch) SetError ¶
func (m *MockWriteBatch) SetError(idx int, err error)
SetError 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) SetPendingIndex ¶
func (m *MockWriteBatch) SetPendingIndex(idx int, pending PendingIndexInsert)
SetPendingIndex mocks base method.
func (*MockWriteBatch) SetSeries ¶
func (m *MockWriteBatch) SetSeries(idx int, series ts.Series)
SetSeries 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, 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) PendingIndex ¶
func (mr *MockWriteBatchMockRecorder) PendingIndex() *gomock.Call
PendingIndex indicates an expected call of PendingIndex.
func (*MockWriteBatchMockRecorder) Reset ¶
func (mr *MockWriteBatchMockRecorder) Reset(batchSize, ns interface{}) *gomock.Call
Reset indicates an expected call of Reset.
func (*MockWriteBatchMockRecorder) SetError ¶
func (mr *MockWriteBatchMockRecorder) SetError(idx, err interface{}) *gomock.Call
SetError indicates an expected call of SetError.
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) SetPendingIndex ¶
func (mr *MockWriteBatchMockRecorder) SetPendingIndex(idx, pending interface{}) *gomock.Call
SetPendingIndex indicates an expected call of SetPendingIndex.
func (*MockWriteBatchMockRecorder) SetSeries ¶
func (mr *MockWriteBatchMockRecorder) SetSeries(idx, series interface{}) *gomock.Call
SetSeries indicates an expected call of SetSeries.
func (*MockWriteBatchMockRecorder) SetSkipWrite ¶
func (mr *MockWriteBatchMockRecorder) SetSkipWrite(idx interface{}) *gomock.Call
SetSkipWrite indicates an expected call of SetSkipWrite.
type PendingIndexInsert ¶
type PendingIndexInsert struct { Entry index.WriteBatchEntry Document doc.Metadata }
PendingIndexInsert is a pending index insert.
type Write ¶
type Write struct { Series ts.Series Datapoint ts.Datapoint Unit xtime.Unit Annotation ts.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 SetPendingIndex(idx int, pending PendingIndexInsert) PendingIndex() []PendingIndexInsert SetError(idx int, err error) SetSeries(idx int, series ts.Series) 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( initialBatchSize 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, initialBatchSize int, 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.