本文整理匯總了Java中org.apache.hadoop.conf.Configuration.reloadConfiguration方法的典型用法代碼示例。如果您正苦於以下問題:Java Configuration.reloadConfiguration方法的具體用法?Java Configuration.reloadConfiguration怎麽用?Java Configuration.reloadConfiguration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.conf.Configuration
的用法示例。
在下文中一共展示了Configuration.reloadConfiguration方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateHadoopConfig
import org.apache.hadoop.conf.Configuration; //導入方法依賴的package包/類
/**
* Creates a specialized hadoop configuration for spydra. This configuration is
* special in the sense that it configures hadoop tooling to be able to access GCS
* for logs, history and is able to run a read-only job-history server (not moving
* or deleting logs or history files). This configuration is dependent on client
* and username due to how this information is stored in GCS.
*
* @param clientId client id to generate configuration for
* @param username username to generate configuration for
* @param bucket name of the bucket storing logs and history information
*/
public static Configuration generateHadoopConfig(String clientId, String username,
String bucket) {
// We want minimalistic and clean options that are unlikely to collide with anything,
// that's why not loading defaults
Configuration cfg = new Configuration(false);
cfg.addResource(HISTORY_LOG_CONFIG_NAME);
cfg.reloadConfiguration();
cfg.set(SPYDRA_HISTORY_CLIENT_ID_PROPERTY, clientId);
cfg.set(SPYDRA_HISTORY_USERNAME_PROPERTY, username);
cfg.set(SPYDRA_HISTORY_BUCKET_PROPERTY, bucket);
if (logger.isDebugEnabled()) {
logger.debug("Dumping generated config to be applied for log/history tools");
logger.debug(Joiner.on("\n").join(cfg.iterator()));
}
return cfg;
}