#NEWLINE# def generate_metrics_config( args , host , job_name , instance_id = ( - 1 ) ) : #NEWLINE# #INDENT# job = args . yarn_config . jobs [ job_name ] #NEWLINE# supervisor_client = deploy_utils . get_supervisor_client ( host , 'yarn' , args . yarn_config . cluster . name , job_name , instance_id = instance_id ) #NEWLINE# ganglia_switch = '# ' #NEWLINE# if args . yarn_config . cluster . ganglia_address : #NEWLINE# #INDENT# ganglia_switch = '' #NEWLINE# #UNINDENT# config_dict = { #NEWLINE# #INDENT# 'job_name' : job_name , #NEWLINE# 'period' : 10 , #NEWLINE# 'data_dir' : supervisor_client . get_log_dir ( ) , #NEWLINE# 'ganglia_address' : args . yarn_config . cluster . ganglia_address , #NEWLINE# 'ganglia_switch' : ganglia_switch , #NEWLINE# #UNINDENT# } #NEWLINE# local_path = ( '%s/hadoop-metrics2.properties.tmpl' % deploy_utils . get_template_dir ( ) ) #NEWLINE# template = deploy_utils . Template ( open ( local_path , 'r' ) . read ( ) ) #NEWLINE# return template . substitute ( config_dict )