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