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 Group ¶
type Group interface {
GetSchema() *commonv1.Group
StoreResource(resourceSchema ResourceSchema) (Resource, error)
LoadResource(name string) (Resource, bool)
}
Group is the root node, allowing get resources from its sub nodes.
type MetadataEvent ¶
MetadataEvent is the syncing message between metadata repo and this framework.
type Repository ¶
type Repository interface {
Watcher()
SendMetadataEvent(MetadataEvent)
StoreGroup(groupMeta *commonv1.Metadata) (*group, error)
LoadGroup(name string) (Group, bool)
LoadResource(metadata *commonv1.Metadata) (Resource, bool)
NotifyAll() (err error)
Close()
}
Repository is the collection of several hierarchies groups by a "Group".
func NewRepository ¶
func NewRepository( metadata metadata.Repo, repo discovery.ServiceRepo, l *logger.Logger, resourceSupplier ResourceSupplier, shardTopic bus.Topic, entityTopic bus.Topic, ) Repository
NewRepository return a new Repository.
type Resource ¶
type Resource interface {
GetIndexRules() []*databasev1.IndexRule
MaxObservedModRevision() int64
EntityLocator() partition.EntityLocator
ResourceSchema
io.Closer
}
Resource allows access metadata from a local cache.
type ResourceSchema ¶
ResourceSchema allows get the metadata.
type ResourceSpec ¶
type ResourceSpec struct {
Schema ResourceSchema
// IndexRules are index rules bound to the Schema
IndexRules []*databasev1.IndexRule
// Aggregations are topN aggregation bound to the Schema, e.g. TopNAggregation
Aggregations []*databasev1.TopNAggregation
}
ResourceSpec wraps required fields to open a resource.
type ResourceSupplier ¶
type ResourceSupplier interface {
OpenResource(shardNum uint32, db tsdb.Supplier, spec ResourceSpec) (Resource, error)
ResourceSchema(metdata *commonv1.Metadata) (ResourceSchema, error)
OpenDB(groupSchema *commonv1.Group) (tsdb.Database, error)
}
ResourceSupplier allows open a resource and its embedded tsdb.
Click to show internal directories.
Click to hide internal directories.