azkaban.utils.Props.getMapByPrefix()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中azkaban.utils.Props.getMapByPrefix()方法的一些代码示例,展示了Props.getMapByPrefix()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Props.getMapByPrefix()方法的具体详情如下:
包路径:azkaban.utils.Props
类名称:Props
方法名:getMapByPrefix

Props.getMapByPrefix介绍

[英]Get a map of all properties by string prefix
[中]按字符串前缀获取所有属性的映射

代码示例

代码示例来源:origin: azkaban/azkaban

/**
 * Returns a map of all the flattened properties, the item in the returned map is sorted
 * alphabetically by the key value.
 *
 * @Return
 */
public Map<String, String> getFlattened() {
 final TreeMap<String, String> returnVal = new TreeMap<>();
 returnVal.putAll(getMapByPrefix(""));
 return returnVal;
}

代码示例来源:origin: azkaban/azkaban

public Map<String, String> getEnvironmentVariables() {
 final Props props = getJobProps();
 final Map<String, String> envMap = props.getMapByPrefix(ENV_PREFIX);
 envMap.putAll(props.getMapByPrefix(ENV_PREFIX_UCASE));
 return envMap;
}

代码示例来源:origin: azkaban/azkaban

private void setupExecutotrComparatorWeightsMap() {
 // initialize comparator feature weights for executor selector from azkaban.properties
 final Map<String, String> compListStrings = this.azkProps
   .getMapByPrefix(ConfigurationKeys.EXECUTOR_SELECTOR_COMPARATOR_PREFIX);
 if (compListStrings != null) {
  this.comparatorWeightsMap = new TreeMap<>();
  for (final Map.Entry<String, String> entry : compListStrings.entrySet()) {
   this.comparatorWeightsMap.put(entry.getKey(), Integer.valueOf(entry.getValue()));
  }
 }
}

代码示例来源:origin: azkaban/azkaban

/**
 * Get a map of all properties by string prefix
 *
 * @param prefix The string prefix
 */
public Map<String, String> getMapByPrefix(final String prefix) {
 final Map<String, String> values = this._parent == null ? new HashMap<>() :
   this._parent.getMapByPrefix(prefix);
 // when there is a conflict, value from the child takes the priority.
 for (final String key : this.localKeySet()) {
  if (key.startsWith(prefix)) {
   values.put(key.substring(prefix.length()), get(key));
  }
 }
 return values;
}

代码示例来源:origin: com.linkedin.azkaban/az-core

/**
 * Returns a map of all the flattened properties, the item in the returned map is sorted
 * alphabetically by the key value.
 *
 * @return the flattened
 */
public Map<String, String> getFlattened() {
 final TreeMap<String, String> returnVal = new TreeMap<>();
 returnVal.putAll(getMapByPrefix(""));
 return returnVal;
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

public Map<String, String> getEnvironmentVariables() {
  Props props = getJobProps();
  Map<String, String> envMap = props.getMapByPrefix(ENV_PREFIX);
  envMap.putAll(props.getMapByPrefix(ENV_PREFIX_UCASE));
  return envMap;
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

public Map<String, String> getEnvironmentVariables() {
 final Props props = getJobProps();
 final Map<String, String> envMap = props.getMapByPrefix(ENV_PREFIX);
 envMap.putAll(props.getMapByPrefix(ENV_PREFIX_UCASE));
 return envMap;
}

代码示例来源:origin: com.linkedin.azkaban/az-core

/**
 * Get a map of all properties by string prefix
 *
 * @param prefix The string prefix
 * @return the map by prefix
 */
public Map<String, String> getMapByPrefix(final String prefix) {
 final Map<String, String> values = this._parent == null ? new HashMap<>() :
   this._parent.getMapByPrefix(prefix);
 // when there is a conflict, value from the child takes the priority.
 for (final String key : this.localKeySet()) {
  if (key.startsWith(prefix)) {
   values.put(key.substring(prefix.length()), get(key));
  }
 }
 return values;
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

/**
 * Get a map of all properties by string prefix
 * 
 * @param prefix
 *            The string prefix
 */
public Map<String, String> getMapByPrefix(String prefix) {
  Map<String, String> values = new HashMap<String, String>();
  if (_parent != null) {
    for (Map.Entry<String, String> entry : _parent.getMapByPrefix(
        prefix).entrySet()) {
      values.put(entry.getKey(), entry.getValue());
    }
  }
  for (String key : this.localKeySet()) {
    if (key.startsWith(prefix)) {
      values.put(key.substring(prefix.length()), get(key));
    }
  }
  return values;
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

.getMapByPrefix(Constants.ConfigurationKeys.EXECUTOR_SELECTOR_COMPARATOR_PREFIX);
if (compListStrings != null) {
 this.comparatorWeightsMap = new TreeMap<>();

代码示例来源:origin: linkedin/TonY

Map<String, String> workerEnvs = getJobProps().getMapByPrefix(WORKER_ENV_PREFIX);
for (Map.Entry<String, String> workerEnv : workerEnvs.entrySet()) {
 args += " " + TensorFlowJobArg.SHELL_ENV.tonyParamName + " " + workerEnv.getKey() + "=" + workerEnv.getValue();
Map<String, String> tonyConfs = getJobProps().getMapByPrefix(TONY_CONF_PREFIX);
Configuration tfConf = new Configuration(false);
for (Map.Entry<String, String> tfConfEntry : tonyConfs.entrySet()) {

代码示例来源:origin: com.linkedin.azkaban/azkaban

public LongArgJob(String jobid, String[] command, Props sysProps, Props jobProp, Logger log, Set<String> suppressedKeys) {
  // super(command, desc);
  super(jobid, sysProps, jobProp, log);
  // String cwd = descriptor.getProps().getString(WORKING_DIR, new
  // File(descriptor.getFullPath()).getParent());
  this.builder = new AzkabanProcessBuilder(command)
      .setEnv(getJobProps()
      .getMapByPrefix(ENV_PREFIX))
      .setWorkingDir(getCwd())
      .setLogger(getLog());
  appendProps(suppressedKeys);
}

相关文章