private static void setMetaStoreURI ( Configuration conf , Map < String , String > match ) { try { // If the host is set, construct a new MetaStore URI and set the property // in the Configuration. Otherwise, do not change the MetaStore URI. String host = match . get ( URIPattern . HOST ) ; if ( host != null && ! NOT_SET . equals ( host ) ) { int port ; try { port = Integer . parseInt ( match . get ( URIPattern . PORT ) ) ; } catch ( NumberFormatException e ) { port = UNSPECIFIED_PORT ; } conf . set ( HIVE_METASTORE_URI_PROP , new URI ( "thrift" , null , host , port , null , null , null ) . toString ( ) ) ; } } catch ( URISyntaxException ex ) { throw new DatasetOperationException ( "Could not build metastore URI" , ex ) ; } }
Sets the MetaStore URI in the given Configuration if there is a host in the match arguments . If there is no host then the conf is not changed .