當前位置: 首頁>>代碼示例>>Java>>正文


Java Configuration.reloadConfiguration方法代碼示例

本文整理匯總了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;
}
 
開發者ID:spotify,項目名稱:spydra,代碼行數:30,代碼來源:HistoryLogUtils.java


注:本文中的org.apache.hadoop.conf.Configuration.reloadConfiguration方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。