#NEWLINE# def finalize_configuration( self , cluster_spec ) : #NEWLINE# #INDENT# nn_hosts = cluster_spec . determine_component_hosts ( 'NAMENODE' ) #NEWLINE# if nn_hosts : #NEWLINE# #INDENT# props = { #NEWLINE# #INDENT# 'core-site' : [ 'fs.defaultFS' ] , #NEWLINE# 'hdfs-site' : [ 'dfs.namenode.http-address' , 'dfs.namenode.https-address' ] , #NEWLINE# #UNINDENT# } #NEWLINE# self . _replace_config_token ( cluster_spec , '%NN_HOST%' , nn_hosts . pop ( ) . fqdn ( ) , props ) #NEWLINE# #UNINDENT# snn_hosts = cluster_spec . determine_component_hosts ( 'SECONDARY_NAMENODE' ) #NEWLINE# if snn_hosts : #NEWLINE# #INDENT# props = { #NEWLINE# #INDENT# 'hdfs-site' : [ 'dfs.namenode.secondary.http-address' ] , #NEWLINE# #UNINDENT# } #NEWLINE# self . _replace_config_token ( cluster_spec , '%SNN_HOST%' , snn_hosts . pop ( ) . fqdn ( ) , core_site_config ) #NEWLINE# #UNINDENT# core_site_config = cluster_spec . configurations [ 'core-site' ] #NEWLINE# for prop in self . _get_swift_properties ( ) : #NEWLINE# #INDENT# core_site_config [ prop [ 'name' ] ] = prop [ 'value' ] #NEWLINE# #UNINDENT# if CONF . enable_data_locality : #NEWLINE# #INDENT# for prop in th . vm_awareness_core_config ( ) : #NEWLINE# #INDENT# core_site_config [ prop [ 'name' ] ] = prop [ 'value' ] #NEWLINE# #UNINDENT# core_site_config . update ( TOPOLOGY_CONFIG ) #NEWLINE# #UNINDENT# nn_ng = cluster_spec . get_node_groups_containing_component ( 'NAMENODE' ) [ 0 ] #NEWLINE# dn_node_groups = cluster_spec . get_node_groups_containing_component ( 'DATANODE' ) #NEWLINE# common_paths = [ ] #NEWLINE# if dn_node_groups : #NEWLINE# #INDENT# common_paths = self . _get_common_paths ( dn_node_groups ) #NEWLINE# #UNINDENT# hdfs_site_config = cluster_spec . configurations [ 'hdfs-site' ] #NEWLINE# hdfs_site_config [ 'dfs.namenode.name.dir' ] = self . _generate_storage_path ( self . _get_common_paths ( [ nn_ng ] ) , '/hadoop/hdfs/namenode' ) #NEWLINE# if common_paths : #NEWLINE# #INDENT# hdfs_site_config [ 'dfs.datanode.data.dir' ] = self . _generate_storage_path ( common_paths , '/hadoop/hdfs/data' )