clusters

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ClientOperationCode = 101
View Source
const ClusterConfigCode = 100
View Source
const ClusterIncompleteCode = 102
View Source
const ComponentExistsCode = 104
View Source
const Defaultname = "default-oshinko-cluster-config"
View Source
const EphemeralCode = 105
View Source
const ErrorWhileProcessing = "'%s', %s"
View Source
const MasterCountMustBeZeroOrOne = "cluster configuration must have a master count of 0 or 1"
View Source
const NamedConfigDoesNotExist = "named config '%s' does not exist"
View Source
const NoCodeAvailable = 0
View Source
const NoSuchClusterCode = 103
View Source
const SentinelCountValue = -1
View Source
const WorkerCountMustBeAtLeastZero = "cluster configuration may not have a worker count less than 0"

Variables

This section is empty.

Functions

func CheckNoCluster added in v0.2.3

func CheckNoCluster(cluster *SparkCluster) bool

func DeleteCluster

func DeleteCluster(clustername, namespace string, restconfig *rest.Config, app, appstatus string) (string, error)

func ErrorCode

func ErrorCode(err error) int

func ScaleCluster added in v0.2.2

func ScaleCluster(name, namespace string, masters, workers int, restconfig *rest.Config) error

Scale a cluster This routine supports a specific scale operation based on immediate values for master and worker counts and does not consider stored configs.

Types

type ClusterConfig

type ClusterConfig struct {
	MastersCount      int
	WorkersCount      int
	Name              string `json:"ConfigName,omitempty"`
	SparkMasterConfig string `json:"SparkMasterConfig,omitempty"`
	SparkWorkerConfig string `json:"SparkWorkerConfig,omitempty"`
	SparkImage        string `json:"SparkImage,omitempty"`
	ExposeWebUI       string
	Metrics           string
}

func GetClusterConfig

func GetClusterConfig(config *ClusterConfig, restconfig *rest.Config, namespace string) (res ClusterConfig, err error)

func GetDefaultConfig

func GetDefaultConfig() ClusterConfig

This function is meant to support testability

type ClusterError

type ClusterError struct {
	Msg  string
	Code int
}

func NewClusterError

func NewClusterError(msg string, code int) ClusterError

func (ClusterError) Error

func (e ClusterError) Error() string

type SparkCluster

type SparkCluster struct {
	Namespace      string `json:"Namespace,omitempty"`
	Name           string `json:"Name,omitempty"`
	Href           string `json:"href"`
	Image          string `json:"Image,omitempty"`
	MasterURL      string `json:"MasterUrl"`
	MasterWebURL   string `json:"MasterWebUrl"`
	MasterWebRoute string `json:"MasterWebRoute"`
	Status         string `json:"Status"`
	Config         ClusterConfig
	Ephemeral      string     `json:"Ephemeral,omitempty"`
	Pods           []SparkPod `json:"Pods,omitempty"`
}

func CreateCluster

func CreateCluster(
	clustername, namespace, sparkimage string,
	config *ClusterConfig, restconfig *rest.Config, app string, ephemeral bool) (SparkCluster, error)

Create a cluster and return the representation

func FindClusters

func FindClusters(namespace string, restconfig *rest.Config, app string) ([]SparkCluster, error)

Find all clusters and return their representation

func FindSingleCluster

func FindSingleCluster(name, namespace string, restconfig *rest.Config) (SparkCluster, error)

Find a cluster and return its representation

func UpdateCluster

func UpdateCluster(name, namespace string, config *ClusterConfig, restconfig *rest.Config) (SparkCluster, error)

Update a cluster and return the new representation This routine supports the same stored config semantics as used in cluster creation but at this point only allows updating the master and worker counts.

type SparkPod

type SparkPod struct {
	IP     string `json:"ip"`
	Status string `json:"status"`
	Type   string `json:"type"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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