Documentation
¶
Overview ¶
Package querier provides abstractions to keep track of and manage querier nodes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassTenant ¶
ClassTenant represents a class/tenant pair.
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
Querier represents a querier node.
func NewQuerier ¶
NewQuerier creates a new querier node. The class tenant data events channel is buffered to avoid blocking the sender when possible.
func (*Querier) ClassTenantDataEvents ¶
func (q *Querier) ClassTenantDataEvents() <-chan ClassTenant
ClassTenantDataEvents returns the channel on which class tenant data events are sent.
type QuerierManager ¶
type QuerierManager struct {
// contains filtered or unexported fields
}
QuerierManager keeps track of registered querier nodes and allows one to notify all of them of class/tenant data updates.
func NewQuerierManager ¶
func NewQuerierManager(log logrus.FieldLogger) *QuerierManager
func (*QuerierManager) NotifyClassTenantDataEvent ¶
func (qm *QuerierManager) NotifyClassTenantDataEvent(ct ClassTenant) error
NotifyClassTenantDataEvent notifies all registered querier nodes of a class tenant data update. It returns an error if any of the notifications failed. The notification is sent on the querier's class tenant data updates channel and is non-blocking (if the channel is full, the notification is skipped).
func (*QuerierManager) Register ¶
func (qm *QuerierManager) Register(q *Querier)
Register registers a querier node with this manager.
func (*QuerierManager) Unregister ¶
func (qm *QuerierManager) Unregister(q *Querier)
Unregister unregisters a querier node from this manager and closes its associated class tenant data updates channel.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) QuerierStream ¶
func (s *Server) QuerierStream(stream api.MetadataService_QuerierStreamServer) error
QuerierStream is experimental. QuerierStream is triggered when a querier node connects to this metadata node via this bidirectional gRPC stream. We register the querier node with the querier manager and send class tenant data updates to the querier node when they appear on this querier's class tenant data updates channel. We don't currently expect any messages from the querier node, but just use the existence of the stream to keep the connection alive so we can send events to the querier node. This function blocks until the stream is closed by the querier node.
func (*Server) Serve ¶
func (s *Server) Serve(ctx context.Context, listener net.Listener, options []grpc.ServerOption) error
Serve starts the server and registers it as the cluster service server. Blocking. Returns an error if the configured listenAddress is invalid. Returns an error if the configured listenAddress is un-usable to listen on. When the passed in context is cancelled, the server will stop.