Jump to: navigation, search

Sahara/PluggableProvisioning/PluginAPI

< Sahara‎ | PluggableProvisioning
Revision as of 12:58, 21 May 2013 by Nadya Privalova (talk | contribs) (Created page with "==Plugin API== '''''get_versions()''''' :Returns all versions of Hadoop that could be used with the plugin. It is responsibility of the plugin to make sure that all required i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Plugin API

get_versions()

Returns all versions of Hadoop that could be used with the plugin. It is responsibility of the plugin to make sure that all required images for each hadoop version are available, as well as configs and whatever else that plugin needs to create the Hadoop cluster.
Returns: list of strings - Hadoop versions
Example Return Value: (“Apache Hadoop 1.1.1”, “CDH 3”, “HDP 1.2”)

get_configs(hadoop_version)

Lists all configs supported by plugin with descriptions, defaults and targets for which this config is applicable.
Returns: list of configs
Example Return Value: ((“heap size”, “512”, true, “jt”))

get_supported_node_process(hadoop_version)

Lists of all supported node_processes for a given Hadoop version.
Returns: list of strings - node processes
Example Return Value: (“jt”, “nn”, “tt”, “dt”)

convert(cluster, file)

Provides plugin with ability to create cluster based on plugin-specific config. Savanna expects plugin to fill in all the required fields. See “Cluster Lifecycle for Config File Mode” section below for clarification.

validate_cluster(cluster)

Validates a given cluster object. Returns empty list if it is correct. Otherwise for each incorrect field the method should return validation_error with meaningful content.
Returns: list of validation_errors
Example Return Value: ((“heap size”), (“Heap size is a required field and must be specified”), (“mapred.task.timeout”, “The parameter must be int”))

update_infra(cluster)'

Plugin has a chance to change cluster description here. Specifically, plugin
  • must specify image for VMs
  • could change VMs specs in any way it needs.
For instance, plugin can ask for additional VMs for the management tool.
Returns: None

configure_cluster(cluster)

Configures cluster on provisioned by savanna VMs. In this function plugin should perform all actions like adjusting OS, installing required packages (including Hadoop, if needed), configuring Hadoop, etc.
Returns: None

start_cluster(cluster)

Start already configured cluster. This method is guaranteed to be called only on cluster which was already prepared with configure_cluster(...) call.
Returns: None

scale_cluster(cluster, remaining_vm_specs, new_vm_specs, delete_vm_specs)

To be changed
Scales cluster - adds/removes nodes to/from active cluster. This function should configure new nodes and attach them to cluster. Additionally here plugin can make some cleanup on VMs that will be deleted.
Returns: None

on_terminate_cluster(cluster)

When user terminates cluster, Savanna simply shuts down all the cluster VMs. This method is guaranteed to be invoked before that, allowing plugin to do some clean-up.
Returns: None