util

package
v0.1.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Set in https://github.com/pravega/bookkeeper/blob/master/docker/bookkeeper/entrypoint.sh#L21
	PravegaPath = "pravega"
	ZkFinalizer = "cleanUpZookeeper"
)
View Source
const (
	MajorMinorVersionRegexp string = `^v?(?P<Version>[0-9]+\.[0-9]+\.[0-9]+)`
)

Variables

This section is empty.

Functions

func BookkeeperImage

func BookkeeperImage(p *v1alpha1.BookkeeperCluster) (image string)

func BookkeeperTargetImage

func BookkeeperTargetImage(p *v1alpha1.BookkeeperCluster) (string, error)

func CompareVersions

func CompareVersions(v1, v2, operator string) (bool, error)

func ConfigMapNameForBookie

func ConfigMapNameForBookie(clusterName string) string

func ContainsStringWithPrefix

func ContainsStringWithPrefix(slice []string, str string) bool

func ContainsVersion

func ContainsVersion(list []string, version string) bool

func DeleteAllZnodes

func DeleteAllZnodes(bk *v1alpha1.BookkeeperCluster, pravegaClusterName string) (err error)

Delete all znodes related to a specific Bookkeeper cluster

func DownwardAPIEnv

func DownwardAPIEnv() []corev1.EnvVar

func GenerateJVMOption

func GenerateJVMOption(k, v string) string

Concatenate the key value pair to be a JVM option string.

func GetClusterExpectedSize

func GetClusterExpectedSize(p *v1alpha1.BookkeeperCluster) (size int)

func GetPodVersion

func GetPodVersion(pod *v1.Pod) string

func GetStringWithPrefix

func GetStringWithPrefix(slice []string, str string) (result string)

func HeadlessServiceNameForBookie

func HeadlessServiceNameForBookie(clusterName string) string

func HealthcheckCommand

func HealthcheckCommand(port int32) []string

func IsOrphan

func IsOrphan(k8sObjectName string, replicas int32) bool

func IsPodFaulty

func IsPodFaulty(pod *corev1.Pod) (bool, error)

func IsPodReady

func IsPodReady(pod *corev1.Pod) bool

func LabelsForBookie

func LabelsForBookie(bookkeeperCluster *v1alpha1.BookkeeperCluster) map[string]string

func LabelsForBookkeeperCluster

func LabelsForBookkeeperCluster(bookkeeperCluster *v1alpha1.BookkeeperCluster) map[string]string

func ListSubTreeBFS

func ListSubTreeBFS(conn *zk.Conn, root string) (*list.List, error)

Construct a BFS tree

func Min

func Min(x, y int32) int32

Min returns the smaller of x or y.

func NewEvent

func NewEvent(name string, p *v1alpha1.BookkeeperCluster, reason string, message string, eventType string) *corev1.Event

func NormalizeVersion

func NormalizeVersion(version string) (string, error)

func OverrideDefaultJVMOptions

func OverrideDefaultJVMOptions(defaultOpts []string, customOpts []string) []string

This method will override the default JVM options with user provided custom options

func PdbNameForBookie

func PdbNameForBookie(clusterName string) string

func PodAntiAffinity

func PodAntiAffinity(component string, clusterName string) *corev1.Affinity

func RemoveString

func RemoveString(slice []string, str string) (result []string)

func StatefulSetNameForBookie

func StatefulSetNameForBookie(clusterName string) string

func UpdateOneJVMOption

func UpdateOneJVMOption(arg string, om *OrderedMap)

This method will parse the JVM options into a key value pair and store it in the OrderedMap

func WaitForClusterToTerminate

func WaitForClusterToTerminate(kubeClient client.Client, p *v1alpha1.BookkeeperCluster) (err error)

Wait for pods in cluster to be terminated

Types

type OrderedMap

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

OrderedMap is a map that has insertion order when iterating. The iteration of map in GO is in random order by default.

Jump to

Keyboard shortcuts

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