Documentation ¶
Index ¶
- Constants
- func CheckNoCluster(cluster *SparkCluster) bool
- func DeleteCluster(clustername, namespace string, osclient *oclient.Client, ...) (string, error)
- func ErrorCode(err error) int
- func ScaleCluster(name, namespace string, masters, workers int, osclient *oclient.Client, ...) error
- type ClusterConfig
- type ClusterError
- type SparkCluster
- func CreateCluster(clustername, namespace, sparkimage string, config *ClusterConfig, ...) (SparkCluster, error)
- func FindClusters(namespace string, osclient *oclient.Client, client kclient.Interface, ...) ([]SparkCluster, error)
- func FindSingleCluster(name, namespace string, osclient *oclient.Client, client kclient.Interface) (SparkCluster, error)
- func UpdateCluster(name, namespace string, config *ClusterConfig, osclient *oclient.Client, ...) (SparkCluster, error)
- type SparkPod
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 ScaleCluster ¶ added in v0.2.2
func ScaleCluster(name, namespace string, masters, workers int, osclient *oclient.Client, client kclient.Interface) 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 { MasterCount int WorkerCount int Name string SparkMasterConfig string SparkWorkerConfig string SparkImage string ExposeWebUI bool }
func GetClusterConfig ¶
func GetClusterConfig(config *ClusterConfig, cm kclient.ConfigMapsInterface) (res ClusterConfig, err error)
func GetDefaultConfig ¶
func GetDefaultConfig() ClusterConfig
This function is meant to support testability
type ClusterError ¶
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"` MasterURL string `json:"masterUrl"` MasterWebURL string `json:"masterWebUrl"` MasterWebRoute string `json:"masterWebRoute"` Status string `json:"status"` WorkerCount int `json:"workerCount"` MasterCount int `json:"masterCount"` Config ClusterConfig Ephemeral string `json:"ephemeral,omitempty"` Pods []SparkPod }
func CreateCluster ¶
func CreateCluster( clustername, namespace, sparkimage string, config *ClusterConfig, osclient *oclient.Client, client kclient.Interface, app string, ephemeral bool) (SparkCluster, error)
Create a cluster and return the representation
func FindClusters ¶
func FindClusters(namespace string, osclient *oclient.Client, client kclient.Interface, app string) ([]SparkCluster, error)
Find all clusters and return their representation
func FindSingleCluster ¶
func FindSingleCluster(name, namespace string, osclient *oclient.Client, client kclient.Interface) (SparkCluster, error)
Find a cluster and return its representation
func UpdateCluster ¶
func UpdateCluster(name, namespace string, config *ClusterConfig, osclient *oclient.Client, client kclient.Interface) (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.
Click to show internal directories.
Click to hide internal directories.