2016/09/21 context.getConfiguration().get()


查看api:http://hadoop.apache.org/docs/stable/api/

public String get(String name)
Get the value of the name property, null if no such property exists. If the key is deprecated, it returns the value of the first key which replaces the deprecated key and is not null. Values are processed for variable expansion before being returned.
Parameters:
name - the property name, will be trimmed before get value.
Returns:
the value of the name or its replacing property, or null if no such property exists.

若能获取相应的name属性,返回name值,若无法获得,返回null.

 
public String get(String name,
         String defaultValue)
Get the value of the name. If the key is deprecated, it returns the value of the first key which replaces the deprecated key and is not null. If no such property exists, then defaultValue is returned.
Parameters:
name - property name, will be trimmed before get value.
defaultValue - default value.
Returns:
property value, or defaultValue if the property doesn't exist.

若能获取相应的name属性,返回name值,若无法获得,返回nulldefaultValue.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM