@Override public LongWatermark apply(WorkUnitState w) { return w.getActualHighWatermark(LongWatermark.class); } }).toList();
@Override public LongWatermark apply(WorkUnitState wus) { return wus.getActualHighWatermark(LongWatermark.class); } });
/** * 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. * * <p>A default {@link Gson} object will be used to deserialize the watermark.</p> * * @param watermarkClass the watermark class for this {@code WorkUnitState}. * @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) { return getActualHighWatermark(watermarkClass, GSON); }
/** * 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); }
} else { MultiKeyValueLongWatermark multiKeyValueLongWatermark = watermarkWorkUnits.get(0).getActualHighWatermark(MultiKeyValueLongWatermark.class); if (multiKeyValueLongWatermark != null) { this.previousWatermarks.setPartitionWatermarks(datasetWorkUnitStates.getKey(),