#NEWLINE# def run_shell( args ) : #NEWLINE# #INDENT# get_yarn_service_config ( args ) #NEWLINE# ( main_class , options ) = deploy_utils . parse_shell_command ( args , SHELL_COMMAND_INFO ) #NEWLINE# if ( not main_class ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# args . yarn_config . parse_generated_config_files ( args ) #NEWLINE# core_site_dict = args . yarn_config . configuration . generated_files [ 'core-site.xml' ] #NEWLINE# hdfs_site_dict = args . yarn_config . configuration . generated_files [ 'hdfs-site.xml' ] #NEWLINE# mapred_site_dict = args . yarn_config . configuration . generated_files [ 'mapred-site.xml' ] #NEWLINE# yarn_site_dict = args . yarn_config . configuration . generated_files [ 'yarn-site.xml' ] #NEWLINE# hadoop_opts = list ( ) #NEWLINE# for ( key , value ) in core_site_dict . iteritems ( ) : #NEWLINE# #INDENT# hadoop_opts . append ( ( '-D%s%s=%s' % ( deploy_utils . HADOOP_PROPERTY_PREFIX , key , value ) ) ) #NEWLINE# #UNINDENT# for ( key , value ) in hdfs_site_dict . iteritems ( ) : #NEWLINE# #INDENT# hadoop_opts . append ( ( '-D%s%s=%s' % ( deploy_utils . HADOOP_PROPERTY_PREFIX , key , value ) ) ) #NEWLINE# #UNINDENT# for ( key , value ) in mapred_site_dict . iteritems ( ) : #NEWLINE# #INDENT# hadoop_opts . append ( ( '-D%s%s=%s' % ( deploy_utils . HADOOP_PROPERTY_PREFIX , key , value ) ) ) #NEWLINE# #UNINDENT# for ( key , value ) in yarn_site_dict . iteritems ( ) : #NEWLINE# #INDENT# hadoop_opts . append ( ( '-D%s%s=%s' % ( deploy_utils . HADOOP_PROPERTY_PREFIX , key , value ) ) ) #NEWLINE# #UNINDENT# if deploy_utils . is_security_enabled ( args ) : #NEWLINE# #INDENT# hadoop_opts . append ( ( '-Djava.security.krb5.conf=%s/krb5-hadoop.conf' % deploy_utils . get_config_dir ( ) ) ) #NEWLINE# #UNINDENT# package_root = deploy_utils . get_artifact_package_root ( args , args . yarn_config . cluster , 'hadoop' ) #NEWLINE# lib_root = ( '%s/share/hadoop' % options ) #NEWLINE# class_path = ( '%s/etc/hadoop' % package_root ) #NEWLINE# for component in [ 'common' , 'hdfs' , 'mapreduce' , 'yarn' ] : #NEWLINE# #INDENT# component_dir = ( '%s/%s' % ( lib_root , component ) ) #NEWLINE# class_path += ( ':%s/:%s/*:%s/lib/*' % ( component_dir , component_dir , component_dir ) ) #NEWLINE# #UNINDENT# cmd = ( ( ( [ 'java' , '-cp' , class_path ] + hadoop_opts ) + [ main_class ] ) + options ) #NEWLINE# p = subprocess . Popen ( cmd , stdout = sys . stdout , stderr = sys . stderr ) #NEWLINE# p . wait ( )