historian

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DeadRequestMarker = "*dead*"
View Source
const SyncPeriod = time.Duration(float32(api.DeadGracePeriod) / 2.5)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// AddCollectNotification adds a notification to the collector
	AddCollectNotification(fqn, encodedKeys, bucket string)

	// AddWriteNotification adds a notification to the writer
	AddWriteNotification(fqn, encodedKeys, bucket string, value *api.Value)

	// CollectNotifier is a runnable that notifies the collector of a new collection task
	CollectNotifier() NoLeaderRunnableFunc

	// WriteNotifier is a runnable that notifies the writer of a new writing task
	WriteNotifier() NoLeaderRunnableFunc

	// WithManager adds all the Runnables (CollectNotifier, WriteNotifier) to the manager
	WithManager(mgr manager.Manager) error
}

func NewClient

func NewClient(config ClientConfig) Client

type ClientConfig

type ClientConfig struct {
	CollectNotifier            api.Notifier[api.CollectNotification]
	WriteNotifier              api.Notifier[api.WriteNotification]
	CollectNotificationWorkers int
	WriteNotificationWorkers   int
	Logger                     logr.Logger
}

type FinalizerFunc

type FinalizerFunc func(ctx context.Context)

type HandleFn

type HandleFn[T api.Notification] func(ctx context.Context, notification T) error

type LeaderRunnableFunc

type LeaderRunnableFunc func(context.Context) error

LeaderRunnableFunc implements Runnable using a function that's run on *ONLY* on the leader. It's very important that the given function block until it's done running.

func (LeaderRunnableFunc) NeedLeaderElection

func (r LeaderRunnableFunc) NeedLeaderElection() bool

NeedLeaderElection make sure the Runnable will run on every instance

func (LeaderRunnableFunc) Start

func (r LeaderRunnableFunc) Start(ctx context.Context) error

Start implements Runnable.

type NoLeaderRunnableFunc

type NoLeaderRunnableFunc func(context.Context) error

NoLeaderRunnableFunc implements Runnable using a function that's run on every instance (not only the leader). It's very important that the given function block until it's done running.

func (NoLeaderRunnableFunc) NeedLeaderElection

func (r NoLeaderRunnableFunc) NeedLeaderElection() bool

NeedLeaderElection make sure the Runnable will run on every instance

func (NoLeaderRunnableFunc) Start

Start implements Runnable.

type Server

type Server interface {
	api.FeatureManager

	// Collector is a runnable that collects data from the state and sends a writing notification via the WriteNotifier
	Collector() LeaderRunnableFunc

	// Writer is a runnable that writes data to the Historical Data Storage
	Writer() LeaderRunnableFunc

	// WithManager adds all the Runnables (Collector, Writer) to the manager
	WithManager(manager manager.Manager) error
}

func NewServer

func NewServer(config ServerConfig) Server

type ServerConfig

type ServerConfig struct {
	CollectNotifier api.Notifier[api.CollectNotification]
	WriteNotifier   api.Notifier[api.WriteNotification]
	Logger          logr.Logger

	State            api.State
	HistoricalWriter api.HistoricalWriter
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL