akkacluster

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new AkkaCluster Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

func SubsetEqual

func SubsetEqual(subset, superset interface{}) bool

SubsetEqual (A,B) returns true if A is a subset of B. This allows us to focus on a smaller set of required fields and ignore other fields that have downstream mutations to objects like creationTimestamp, uid, resourceVersion. The algorithm here is similar to reflect.DeepCopy, in that we use reflection to walk a potentially recursive tree. For comparison, we ignore empty or zero value fields in A.

Types

type GenericResource

type GenericResource interface {
	metav1.Object
	runtime.Object
}

GenericResource have both meta and runtime interfaces

type ReconcileAkkaCluster

type ReconcileAkkaCluster struct {
	// contains filtered or unexported fields
}

ReconcileAkkaCluster reconciles a AkkaCluster object

func (*ReconcileAkkaCluster) Reconcile

func (r *ReconcileAkkaCluster) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a AkkaCluster object and makes changes based on the state read and what is in the AkkaCluster.Spec Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type StatusActor

type StatusActor struct {
	// contains filtered or unexported fields
}

StatusActor manages updating status for a set of Akka clusters. It is a worker for a controller, responsible mainly for converting Akka cluster events into controller reconciliation events. It also provides cluster status to the controller.

func NewStatusActor

func NewStatusActor(client client.Client, statusChanged chan event.GenericEvent) *StatusActor

NewStatusActor constructs a new StatusActor given a Manager's api client and some channel for status update events.

func (*StatusActor) GetStatus

GetStatus looks up last known status by name and namespace. A nil result means no known last status, so caller may safely ignore nil results and hope for better next time.

func (*StatusActor) Run

func (a *StatusActor) Run()

Run loops on inbox until it is closed.

func (*StatusActor) StartPolling

func (a *StatusActor) StartPolling(cluster *appv1alpha1.AkkaCluster)

StartPolling tries to update status of a given cluster for some limited amount of time. If called before existing polling is finished, it will stop previous and restart. A copy of the AkkaCluster object is made in the caller's frame, which is then inserted into the actor's work state in the actor's frame.

This work request is quiescing, which is a kind of work rate limiter. Practically this means many outside callers can ask to start polling an arbitrary number of times, but they'll cancel each other if within the minimal wait window (eg 1 second). This means the first poll for status will only happen if there is a quiet window with only one request in the last second. This fits the typical reconcile burst, which may send dozens of update requests per second, and here we wait until the burst seems to be over. This would not work well if requests for polling were continuous to the point where no quiet period happened.

func (*StatusActor) StopPolling

func (a *StatusActor) StopPolling(req reconcile.Request)

StopPolling stops timer and removes polling state for a given cluster. This is optional since polling against a removed cluster will stop trying and remove itself eventually.

Jump to

Keyboard shortcuts

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