gpt4 book ai didi

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

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

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

WorkUnit.getLowWatermark介绍

[英]Get the low Watermark as a JsonElement.
[中]将低水位线作为JsonElement获取。

代码示例

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

/**
 * Get the low {@link Watermark}. A default {@link Gson} object will be used to deserialize the watermark.
 *
 * @param watermarkClass the watermark class for this {@code WorkUnit}.
 * @return the low watermark in this {@code WorkUnit}.
 */
public <T extends Watermark> T getLowWatermark(Class<T> watermarkClass) {
 return getLowWatermark(watermarkClass, GSON);
}

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

/**
 * Get the low {@link Watermark}.
 *
 * @param watermarkClass the watermark class for this {@code WorkUnit}.
 * @param gson a {@link Gson} object used to deserialize the watermark.
 * @return the low watermark in this {@code WorkUnit}.
 */
public <T extends Watermark> T getLowWatermark(Class<T> watermarkClass, Gson gson) {
 JsonElement json = getLowWatermark();
 if (json == null) {
  return null;
 }
 return gson.fromJson(json, watermarkClass);
}

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

/**
 * Backoff the actual high watermark to the low watermark returned by {@link WorkUnit#getLowWatermark()}.
 */
public void backoffActualHighWatermark() {
 JsonElement lowWatermark = this.workUnit.getLowWatermark();
 if (lowWatermark == null) {
  return;
 }
 setProp(ConfigurationKeys.WORK_UNIT_STATE_ACTUAL_HIGH_WATER_MARK_KEY, lowWatermark.toString());
}

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

/**
 * Get the actual high {@link Watermark}. If the {@code WorkUnitState} does not contain the actual high watermark
 * (which may be caused by task failures), the low watermark in the corresponding {@link WorkUnit} will be returned.
 *
 * @param watermarkClass the watermark class for this {@code WorkUnitState}.
 * @param gson a {@link Gson} object used to deserialize the watermark.
 * @return the actual high watermark in this {@code WorkUnitState}. null is returned if this {@code WorkUnitState}
 * does not contain an actual high watermark, and the corresponding {@code WorkUnit} does not contain a low
 * watermark.
 */
public <T extends Watermark> T getActualHighWatermark(Class<T> watermarkClass, Gson gson) {
 JsonElement json = getActualHighWatermark();
 if (json == null) {
  json = this.workUnit.getLowWatermark();
  if (json == null) {
   return null;
  }
 }
 return gson.fromJson(json, watermarkClass);
}

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

/**
  * Sets metadata to indicate whether this is the first time this table or partition is being published.
  * @param wus to set if this is first publish for this table or partition
  */
 public static void setIsFirstPublishMetadata(WorkUnitState wus) {
  if (!Boolean.valueOf(wus.getPropAsBoolean(IS_WATERMARK_WORKUNIT_KEY))) {
   LongWatermark previousWatermark = wus.getWorkunit().getLowWatermark(LongWatermark.class);
   wus.setProp(SlaEventKeys.IS_FIRST_PUBLISH, (null == previousWatermark || previousWatermark.getValue() == 0));
  }
 }
}

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

long baseRevision = workUnitState.getWorkunit().getLowWatermark(LongWatermark.class, new Gson()).getValue();
if (baseRevision < 0) {
 try {

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