本文整理汇总了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;
}