public ImmutableExtract(SourceState state, gobblin.source.workunit.Extract.TableType type, String namespace, String table) { super(state, adaptTableType(type), namespace, table); }
public Extract(TableType type, String namespace, String table) { super(adaptTableType(type), namespace, table); }
/** * Get the {@link gobblin.source.workunit.Extract} associated with the {@link WorkUnit}. * * @return {@link gobblin.source.workunit.Extract} associated with the {@link WorkUnit} */ public Extract getExtract() { return new Extract(this.workUnit.getExtract()); }
/** * Factory method. * * @param other a {@link WorkUnit} instance * @return A copy of the given {@link WorkUnit} instance */ public static WorkUnit copyOf(WorkUnit other) { return new WorkUnit(other); }
/** * 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); }
@Override public long weight(WorkUnit workUnit) { return workUnit.getPropAsLong(this.field); } }
/** * Get the dot-separated namespace of the table. * * @return dot-separated namespace of the table */ public String getNamespace() { return getProp(ConfigurationKeys.EXTRACT_NAMESPACE_NAME_KEY, ""); }
@Override public Long load(WorkUnit key) throws Exception { return WeightComparator.this.weighter.weight(key); } });
/** * Get the {@link Extract} associated with this {@link WorkUnit}. * * @return the {@link Extract} associated with this {@link WorkUnit} */ public Extract getExtract() { return new ImmutableExtract(this.extract); }
/** * If this {@link Extract} has extract table type defined. * * @return <code>true</code> if it has, <code>false</code> otherwise. */ public boolean hasType() { return contains(ConfigurationKeys.EXTRACT_TABLE_TYPE_KEY); }
/** * Override {@link #workUnit}'s properties with new commonProps and specProps. */ public void setWuProperties(Properties commonProps, Properties specProps) { this.workUnit.setProps(commonProps, specProps); }
/** * Set a (non-globally) unique ID for this {@link Extract}. * * @param extractId unique ID for this {@link Extract} */ public void setExtractId(String extractId) { setProp(ConfigurationKeys.EXTRACT_EXTRACT_ID_KEY, extractId); }
@Override public WorkUnit apply(WorkUnit workUnit) { workUnit.addAllIfNotExist(jobState); return workUnit; } });
/** * Get an {@link ImmutableWorkUnit} that wraps the internal {@link WorkUnit}. * * @return an {@link ImmutableWorkUnit} that wraps the internal {@link WorkUnit} */ public WorkUnit getWorkunit() { return new ImmutableWorkUnit(this.workUnit); }
/** * Factory method. * * @return An empty {@link WorkUnit}. */ public static WorkUnit createEmpty() { return new WorkUnit(); }
@Deprecated public Extract(SourceState state, TableType type, String namespace, String table) { super(state, adaptTableType(type), namespace, table); }
/** * Get a (non-globally) unique ID for this {@link Extract}. * * @return unique ID for this {@link Extract} */ public String getExtractId() { return getProp(ConfigurationKeys.EXTRACT_EXTRACT_ID_KEY, ""); }
/** * Factory method. * * @param extract {@link Extract} * @param watermarkInterval {@link WatermarkInterval} * @return A {@link WorkUnit} with the given {@link Extract} and {@link WatermarkInterval} */ public static WorkUnit create(Extract extract, WatermarkInterval watermarkInterval) { return new WorkUnit(null, extract, watermarkInterval); }
/** * Get the name of the table. * * @return name of the table */ public String getTable() { return getProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY, ""); }