Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIncompatibleSegmentStorage = errors.New("supplied segment storage doesn't report errors")
ErrIncompatibleSegmentStorage is returned when the supplied storage that not have the required methods
var ErrIncompatibleSplitStorage = errors.New("supplied split storage doesn't report errors")
ErrIncompatibleSplitStorage is returned when the supplied storage that not have the required methods
Functions ¶
This section is empty.
Types ¶
type ActiveSegmentTracker ¶
type ActiveSegmentTracker struct {
// contains filtered or unexported fields
}
ActiveSegmentTracker accepts updates and keeps track of segment names & cardinality
func NewActiveSegmentTracker ¶
func NewActiveSegmentTracker(initialSize int) *ActiveSegmentTracker
NewActiveSegmentTracker constructs a new segment tracker
func (*ActiveSegmentTracker) NamesAndCount ¶
func (t *ActiveSegmentTracker) NamesAndCount() map[string]int
NamesAndCount returns a map of segment names to key count
type ObservableSegmentStorage ¶
type ObservableSegmentStorage interface {
storage.SegmentStorage
NamesAndCount() map[string]int
}
ObservableSegmentStorage builds on top of the SegmentStorage interface adding some observability methods
type ObservableSegmentStorageImpl ¶
type ObservableSegmentStorageImpl struct {
// contains filtered or unexported fields
}
ObservableSegmentStorageImpl is an implementation of the ObservableSegmentStorage interface
func NewObservableSegmentStorage ¶
func NewObservableSegmentStorage( logger logging.LoggerInterface, splitStorage storage.SplitStorage, toWrap storage.SegmentStorage, ) (*ObservableSegmentStorageImpl, error)
NewObservableSegmentStorage constructs and observable segment storage
func (*ObservableSegmentStorageImpl) NamesAndCount ¶
func (s *ObservableSegmentStorageImpl) NamesAndCount() map[string]int
NamesAndCount returns a map of segment names with the number of keys
func (*ObservableSegmentStorageImpl) Update ¶
func (s *ObservableSegmentStorageImpl) Update(name string, toAdd *set.ThreadUnsafeSet, toRemove *set.ThreadUnsafeSet, changeNumber int64) error
Update updates the local segment cache and forwards the call to he underlying storage
type ObservableSplitStorage ¶
type ObservableSplitStorage interface {
storage.SplitStorage
Count() int
}
ObservableSplitStorage is an interface extender that adds the method `Count` to the split storage
type ObservableSplitStorageImpl ¶
type ObservableSplitStorageImpl struct {
// contains filtered or unexported fields
}
ObservableSplitStorageImpl is an implementaion of the ObservableSplitStorage inteface that wraps an existing storage caches and caches splitnames in-memory (in case the underlying one is non-local, ie: redis)
func NewObservableSplitStorage ¶
func NewObservableSplitStorage(toWrap storage.SplitStorage, logger logging.LoggerInterface) (*ObservableSplitStorageImpl, error)
NewObservableSplitStorage constructs a NewObservableSplitStorage
func (*ObservableSplitStorageImpl) Count ¶
func (s *ObservableSplitStorageImpl) Count() int
Count returns the number of active splits
func (*ObservableSplitStorageImpl) SplitNames ¶
func (s *ObservableSplitStorageImpl) SplitNames() []string
SplitNames returns a list of cached splits