"hdp-hadoop::hdfs::service_check", "MAPREDUCE" => "hdp-hadoop::mapred::service_check", "ZOOKEEPER" => "hdp-zookeeper::quorum::service_check", "HBASE" => "hdp-hbase::hbase::service_check", "PIG" => "hdp-pig::pig::service_check", "SQOOP" => "hdp-sqoop::sqoop::service_check", "HCATALOG" => "hdp-hcat::hcat::service_check", "HIVE" => "hdp-hive::hive::service_check", "OOZIE" => "hdp-oozie::oozie::service_check", "TEMPLETON" => "hdp-templeton::templeton::service_check", ); private static $hadoop2_serviceCheckRoles = array ( "HDFS2" => "hdp2-hadoop::hdfs::service_check", "YARN" => "hdp2-hadoop::mapred::service_check", "MAPREDUCE2" => "hdp2-hadoop::mapred::service_check", "ZOOKEEPER2" => "hdp2-zookeeper::quorum::service_check", "HBASE2" => "hdp2-hbase::hbase::service_check", "PIG2" => "hdp2-pig::pig::service_check", "SQOOP" => "hdp-sqoop::sqoop::service_check", "HCATALOG2" => "hdp2-hcat::hcat::service_check", "HIVE2" => "hdp2-hive::hive::service_check", "OOZIE2" => "hdp2-oozie::oozie::service_check", "TEMPLETON" => "hdp-templeton::templeton::service_check", ); function __construct($hadoopStackVersion = AMBARI_HADOOP_1) { $this->logger = new HMCLogger("RoleDependencies"); $this->classDependencies = new PuppetClassDependencies(); $this->sortedRoles = ($hadoopStackVersion == AMBARI_HADOOP_2) ? self::$hadoop2_sortedRoles : self::$hadoop1_sortedRoles; $this->serviceCheckRoles = ($hadoopStackVersion == AMBARI_HADOOP_2) ? self::$hadoop2_serviceCheckRoles : self::$hadoop1_serviceCheckRoles; error_log ("hadoopStackVersion = $hadoopStackVersion"); } public function getRolesStages($rolesList) { $stage=1; $rolesStages = array(); foreach ($this->sortedRoles as $aRole) { if (in_array($aRole, $rolesList)) { $rolesStages[$aRole] = $stage; $stage ++; } } return $rolesStages; } public function getHostLevelDependencies($role, $serviceState) { return $this->classDependencies->getHostLevelDependencies($role, $serviceState); } public function getServiceCheckRole($service) { if (!isset($this->serviceCheckRoles[$service])) { return NULL; } return $this->serviceCheckRoles[$service]; } } ?>