include "../tarpackage/tarpackage.sfp" schema Hadoop2 extends TarPackage { installed = true running = true configured = true final package_name = "hadoop" final version = "2.2.0" final source = "http://www.mirrorservice.org/sites/ftp.apache.org/hadoop/common" final home = "/opt/hadoop" final user = "hadoop" final group = "hadoop" final password = "!" final java_home = "" final data_dir = "/opt/hadoop/data" sub install { condition { this.installed != true } effect { this.installed = true this.running = false this.configured = false } } sub uninstall { condition { this.running = false this.installed = true } effect { this.installed = false this.configured = true } } sub start { condition { this.running != true this.installed = true this.configured = true } effect { this.running = true } } sub stop { condition { this.running = true } effect { this.running = false } } sub configure { condition { this.running = false this.configured = false } effect { this.configured = true } } } schema Hadoop2Master extends Hadoop2 { final cluster_name = "hadoopnuri" } schema Hadoop2Slave extends Hadoop2 { master isref Hadoop2Master sub install (master : Hadoop2Master) { condition { this.installed != true master.parent.created = true } effect { this.installed = true this.running = false this.configured = false this.master = master } } sub start (master : Hadoop2Master) { condition { this.running != true this.installed = true this.configured = true this.master = master master.running = true } effect { this.running = true } } sub stop { condition { this.running = true } effect { this.running = false } } }