controller

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const Component = "reset-offset-controller"

Component For Sarama Config

Variables

This section is empty.

Functions

func GenerateCommandId

func GenerateCommandId(resetOffset *kafkav1alpha1.ResetOffset, podIP string, opCode ctrl.OpCode) (int64, error)

GenerateCommandId returns an int64 hash based on the specified ResetOffset.

func GenerateLockToken

func GenerateLockToken(reconcilerId types.UID, resetOffsetId types.UID) string

GenerateLockToken returns a string representing a Lock.Token unique to the specified Reconciler and ResetOffset

func NewControllerFactory

NewControllerFactory returns a ControllerConstructor function capable of creating a "typed" ResetOffset Controller

func Shutdown

func Shutdown()

Shutdown performs clean tear-down of resources.

Types

type CoreV1EventType

type CoreV1EventType int

CoreV1EventType "Enum" Type

const (
	ResetOffsetReconciled CoreV1EventType = iota
	ResetOffsetFinalized
	ResetOffsetSkipped
)

CoreV1 EventType "Enum" Values For ResetOffset

func (CoreV1EventType) String

func (et CoreV1EventType) String() string

CoreV1 EventType String Value

type PartitionOffsetManagers

type PartitionOffsetManagers map[int32]sarama.PartitionOffsetManager

PartitionOffsetManagers is a map of Partition -> Sarama PartitionOffsetManager

type Reconciler

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

Reconciler Implements controller.Reconciler for ResetOffset Resources

func (*Reconciler) FinalizeKind

func (r *Reconciler) FinalizeKind(ctx context.Context, resetOffset *kafkav1alpha1.ResetOffset) reconciler.Event

FinalizeKind implements the Finalizer Interface and is responsible for performing any necessary cleanup.

func (*Reconciler) ReconcileKind

func (r *Reconciler) ReconcileKind(ctx context.Context, resetOffset *kafkav1alpha1.ResetOffset) reconciler.Event

ReconcileKind implements the Reconciler Interface and is responsible for performing Offset repositioning.

type SaramaNewClientFnType

type SaramaNewClientFnType func([]string, *sarama.Config) (sarama.Client, error)

SaramaNewClientFnType defines the Sarama NewClient() function signature.

var SaramaNewClientFn SaramaNewClientFnType = sarama.NewClient

SaramaNewClientFn is a reference to the Sarama NewClient() function used when reconciling offsets which facilitates stubbing in unit tests.

type SaramaNewOffsetManagerFromClientFnType

type SaramaNewOffsetManagerFromClientFnType func(group string, client sarama.Client) (sarama.OffsetManager, error)

SaramaNewOffsetManagerFromClientFnType defines the Sarama NewOffsetManagerFromClient() function signature.

SaramaNewOffsetManagerFromClientFn is a reference to the Sarama NewOffsetManagerFromClient() function used when reconciling offsets which facilitates stubbing in unit tests.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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