Documentation ¶
Overview ¶
Package schema implements a framework to sync schema info from the metadata repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetadataEvent ¶
type MetadataEvent struct { Metadata ResourceSchema Typ EventType Kind EventKind }
MetadataEvent is the syncing message between metadata repo and this framework.
type Metrics ¶ added in v0.7.0
type Metrics struct {
// contains filtered or unexported fields
}
Metrics is a collection of metrics.
func NewMetrics ¶ added in v0.7.0
func NewMetrics(factory *observability.Factory) *Metrics
NewMetrics creates a new Metrics.
type Repository ¶
type Repository interface { Watcher() Init(schema.Kind) []int64 SendMetadataEvent(MetadataEvent) LoadGroup(name string) (Group, bool) LoadResource(metadata *commonv1.Metadata) (Resource, bool) Close() StopCh() <-chan struct{} }
Repository is the collection of several hierarchies groups by a "Group".
func NewPortableRepository ¶ added in v0.5.0
func NewPortableRepository( metadata metadata.Repo, l *logger.Logger, supplier ResourceSchemaSupplier, metrics *Metrics, ) Repository
NewPortableRepository return a new Repository without tsdb.
func NewRepository ¶
func NewRepository( metadata metadata.Repo, l *logger.Logger, resourceSupplier ResourceSupplier, metrics *Metrics, ) Repository
NewRepository return a new Repository.
type Resource ¶
type Resource interface { io.Closer IndexRules() []*databasev1.IndexRule TopN() []*databasev1.TopNAggregation Schema() ResourceSchema Delegated() io.Closer }
Resource allows access metadata from a local cache.
type ResourceSchema ¶
ResourceSchema allows get the metadata.
type ResourceSchemaSupplier ¶ added in v0.5.0
type ResourceSchemaSupplier interface { ResourceSchema(metadata *commonv1.Metadata) (ResourceSchema, error) OpenResource(shardNum uint32, supplier Supplier, spec Resource) (io.Closer, error) }
ResourceSchemaSupplier allows get a ResourceSchema from the metadata.
type ResourceSupplier ¶
type ResourceSupplier interface { ResourceSchemaSupplier OpenDB(groupSchema *commonv1.Group) (io.Closer, error) }
ResourceSupplier allows open a resource and its embedded tsdb.