Documentation
¶
Index ¶
- func Compare(storageObj, legacyObj runtime.Object) bool
- func StartPeriodicDataSyncer(ctx context.Context, cfg *SyncerConfig, metrics *DualWriterMetrics) error
- type DualWriteBuilder
- type DualWriter
- type DualWriterMetrics
- type DualWriterMode
- type NamespacedKVStore
- type ServerLockService
- type Storage
- type SyncerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare asserts on the equality of objects returned from both stores (object storage and legacy storage)
func StartPeriodicDataSyncer ¶
func StartPeriodicDataSyncer(ctx context.Context, cfg *SyncerConfig, metrics *DualWriterMetrics) error
StartPeriodicDataSyncer starts a background job that will execute the DataSyncer, syncing the data from the hosted grafana backend into the unified storage backend. This is run in the grafana instance.
Types ¶
type DualWriteBuilder ¶
type DualWriteBuilder func(gr schema.GroupResource, legacy Storage, unified Storage) (Storage, error)
Function that will create a dual writer
type DualWriter ¶
type DualWriter interface { Storage Mode() DualWriterMode }
type DualWriterMetrics ¶
type DualWriterMetrics struct {
// contains filtered or unexported fields
}
func NewDualWriterMetrics ¶
func NewDualWriterMetrics(reg prometheus.Registerer) *DualWriterMetrics
type DualWriterMode ¶
type DualWriterMode int
const ( // Mode0 represents writing to and reading from solely LegacyStorage. This mode is enabled when the // Unified Storage is disabled. All reads and writes are made to LegacyStorage. None are made to Storage. Mode0 DualWriterMode = iota // Mode1 represents writing to and reading from LegacyStorage for all primary functionality while additionally // reading and writing to Storage on a best effort basis for the sake of collecting metrics. Mode1 // Mode2 is the dual writing mode that represents writing to LegacyStorage and Storage and reading from LegacyStorage. // The objects written to storage will include any labels and annotations. // When reading values, the results will be from LegacyStorage. Mode2 // Mode3 represents writing to LegacyStorage and Storage and reading from Storage. // NOTE: Requesting mode3 will only happen when after a background sync job succeeds Mode3 // Mode4 represents writing and reading from Storage. // NOTE: Requesting mode4 will only happen when after a background sync job succeeds Mode4 // Mode5 uses storage regardless of the background sync state Mode5 )
func SetDualWritingMode ¶
func SetDualWritingMode( ctx context.Context, kvs NamespacedKVStore, cfg *SyncerConfig, metrics *DualWriterMetrics, ) (DualWriterMode, error)
type NamespacedKVStore ¶
type ServerLockService ¶
type Storage ¶
type Storage interface { rest.Storage rest.Scoper rest.TableConvertor rest.SingularNameProvider rest.Getter rest.Lister rest.CreaterUpdater rest.GracefulDeleter rest.CollectionDeleter }
Storage is a storage implementation that satisfies the same interfaces as genericregistry.Store.
type SyncerConfig ¶
type SyncerConfig struct { Kind string RequestInfo *request.RequestInfo Mode DualWriterMode LegacyStorage Storage Storage Storage ServerLockService ServerLockService SkipDataSync bool DataSyncerInterval time.Duration DataSyncerRecordsLimit int }
func (*SyncerConfig) Validate ¶
func (s *SyncerConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.