gpt4 book ai didi

gobblin.source.workunit.WorkUnit.getProperties()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 08:25:05 25 4
gpt4 key购买 nike

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

WorkUnit.getProperties介绍

暂无

代码示例

代码示例来源:origin: com.linkedin.gobblin/gobblin-api

@Override
public Properties getProperties() {
 Properties props = new Properties();
 props.putAll(this.jobState.getProperties());
 props.putAll(this.workUnit.getProperties());
 props.putAll(super.getProperties());
 return props;
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-runtime

/**
 * Compose meta data when limiter fails to acquire permit
 * The meta data key list is passed from source layer
 * A prefix matching is used because some work unit {@link gobblin.source.workunit.MultiWorkUnit} have packing strategy, which
 * can append additional string after the key name
 *
 * @return String map representing all the meta data need to report. Return null if no meta data was found.
 */
private ImmutableMap<String, String> getLimiterStopMetadata() {
 WorkUnit workUnit = this.taskState.getWorkunit();
 Properties properties = workUnit.getProperties();
 String metadataKeyList = properties.getProperty(LimiterConfigurationKeys.LIMITER_REPORT_KEY_LIST, LimiterConfigurationKeys.DEFAULT_LIMITER_REPORT_KEY_LIST);
 List<String> keyList = Splitter.on(',').omitEmptyStrings().trimResults()
     .splitToList(metadataKeyList);
 if (keyList.isEmpty())
  return ImmutableMap.of();
  Set<String> names = properties.stringPropertyNames();
  TreeMap<String, String> orderedProperties = new TreeMap<>();
  for (String name : names) {
   orderedProperties.put(name, properties.getProperty(name));
  }
  ImmutableMap.Builder builder = ImmutableMap.<String, String>builder();
  for (String oldKey : keyList) {
   builder.putAll(orderedProperties.subMap(oldKey, oldKey + Character.MAX_VALUE));
  }
  builder.put(LIMITER_STOP_CAUSE_KEY, LIMITER_STOP_CAUSE_VALUE);
  return builder.build();
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-runtime

private void getTaskStateWithCommonAndSpecWuProps(int numTaskStates, DataInput in)
  throws IOException {
 Properties commonWuProps = new Properties();
 for (int i = 0; i < numTaskStates; i++) {
  TaskState taskState = new TaskState();
  taskState.readFields(in);
  if (i == 0) {
   commonWuProps.putAll(taskState.getWorkunit().getProperties());
  } else {
   Properties newCommonWuProps = new Properties();
   newCommonWuProps
     .putAll(Maps.difference(commonWuProps, taskState.getWorkunit().getProperties()).entriesInCommon());
   commonWuProps = newCommonWuProps;
  }
  this.taskStates.put(taskState.getTaskId().intern(), taskState);
 }
 ImmutableProperties immutableCommonProperties = new ImmutableProperties(commonWuProps);
 for (TaskState taskState : this.taskStates.values()) {
  Properties newSpecProps = new Properties();
  newSpecProps.putAll(
    Maps.difference(immutableCommonProperties, taskState.getWorkunit().getProperties()).entriesOnlyOnRight());
  taskState.setWuProperties(immutableCommonProperties, newSpecProps);
 }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com