public class WorkUnit extends State
An instance of this class should contain all the properties an Extractor needs
to extract the schema and data records.
| Constructor and Description |
|---|
WorkUnit()
Deprecated.
Use
createEmpty() |
WorkUnit(Extract extract)
Constructor.
|
WorkUnit(SourceState state,
Extract extract)
Deprecated.
Properties in
SourceState should not be added to a WorkUnit. Having each
WorkUnit contain a copy of SourceState is a waste of memory. Use create(Extract). |
WorkUnit(SourceState state,
Extract extract,
WatermarkInterval watermarkInterval)
Deprecated.
Properties in
SourceState should not be added to a WorkUnit. Having each
WorkUnit contain a copy of SourceState is a waste of memory. Use create(Extract, WatermarkInterval). |
WorkUnit(WorkUnit other)
Deprecated.
Use
copyOf(WorkUnit) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String key)
Check if a property is set.
|
static WorkUnit |
copyOf(WorkUnit other)
Factory method.
|
static WorkUnit |
create(Extract extract)
Factory method.
|
static WorkUnit |
create(Extract extract,
WatermarkInterval watermarkInterval)
Factory method.
|
static WorkUnit |
createEmpty()
Factory method.
|
boolean |
equals(Object object) |
com.google.gson.JsonElement |
getExpectedHighWatermark()
Get the expected high
Watermark as a JsonElement. |
<T extends Watermark> |
getExpectedHighWatermark(Class<T> watermarkClass)
Get the expected high
Watermark. |
<T extends Watermark> |
getExpectedHighWatermark(Class<T> watermarkClass,
com.google.gson.Gson gson)
Get the expected high
Watermark. |
Extract |
getExtract()
|
long |
getHighWaterMark()
Deprecated.
use the
getExpectedHighWatermark() method. |
com.google.gson.JsonElement |
getLowWatermark()
Get the low
Watermark as a JsonElement. |
long |
getLowWaterMark()
Deprecated.
use the
getLowWatermark() method. |
<T extends Watermark> |
getLowWatermark(Class<T> watermarkClass)
Get the low
Watermark. |
<T extends Watermark> |
getLowWatermark(Class<T> watermarkClass,
com.google.gson.Gson gson)
Get the low
Watermark. |
String |
getOutputFilePath() |
String |
getProp(String key)
Get the value of a property.
|
String |
getProp(String key,
String def)
Get the value of a property, using the given default value if the property is not set.
|
int |
hashCode() |
void |
readFields(DataInput in) |
void |
setHighWaterMark(long highWaterMark)
Deprecated.
|
void |
setLowWaterMark(long lowWaterMark)
Deprecated.
|
void |
setWatermarkInterval(WatermarkInterval watermarkInterval)
Set
WatermarkInterval for a WorkUnit. |
void |
skip()
This method will allow a work unit to be skipped if needed.
|
void |
write(DataOutput out) |
addAll, addAll, addAllIfNotExist, addAllIfNotExist, appendToListProp, appendToSetProp, getId, getPropAsBoolean, getPropAsBoolean, getPropAsCaseInsensitiveSet, getPropAsCaseInsensitiveSet, getPropAsDouble, getPropAsDouble, getPropAsInt, getPropAsInt, getPropAsJsonArray, getPropAsList, getPropAsList, getPropAsLong, getPropAsLong, getPropAsSet, getPropAsSet, getPropAsShort, getPropAsShort, getPropAsShortWithRadix, getPropAsShortWithRadix, getProperties, getProperty, getProperty, getPropertyNames, overrideWith, overrideWith, removeProp, removePropsWithPrefix, setId, setProp, setProps, toString@Deprecated public WorkUnit()
createEmpty()@Deprecated public WorkUnit(SourceState state, Extract extract)
SourceState should not be added to a WorkUnit. Having each
WorkUnit contain a copy of SourceState is a waste of memory. Use create(Extract).state - a SourceState the properties of which will be copied into this WorkUnit instanceextract - an Extract@Deprecated public WorkUnit(SourceState state, Extract extract, WatermarkInterval watermarkInterval)
SourceState should not be added to a WorkUnit. Having each
WorkUnit contain a copy of SourceState is a waste of memory. Use create(Extract, WatermarkInterval).state - a SourceState the properties of which will be copied into this WorkUnit instance.extract - an Extract.watermarkInterval - a WatermarkInterval which defines the range of data this WorkUnit will process.@Deprecated public WorkUnit(WorkUnit other)
copyOf(WorkUnit)other - the other WorkUnit instancepublic static WorkUnit create(Extract extract, WatermarkInterval watermarkInterval)
extract - ExtractwatermarkInterval - WatermarkIntervalWorkUnit with the given Extract and WatermarkIntervalpublic void skip()
public com.google.gson.JsonElement getLowWatermark()
Watermark as a JsonElement.public <T extends Watermark> T getLowWatermark(Class<T> watermarkClass, com.google.gson.Gson gson)
Watermark.watermarkClass - the watermark class for this WorkUnit.gson - a Gson object used to deserialize the watermark.WorkUnit.public <T extends Watermark> T getLowWatermark(Class<T> watermarkClass)
Watermark. A default Gson object will be used to deserialize the watermark.watermarkClass - the watermark class for this WorkUnit.WorkUnit.public com.google.gson.JsonElement getExpectedHighWatermark()
Watermark as a JsonElement.JsonElement representing the expected high Watermark.public <T extends Watermark> T getExpectedHighWatermark(Class<T> watermarkClass, com.google.gson.Gson gson)
Watermark.watermarkClass - the watermark class for this WorkUnit.gson - a Gson object used to deserialize the watermark.WorkUnit.public <T extends Watermark> T getExpectedHighWatermark(Class<T> watermarkClass)
Watermark. A default Gson object will be used to deserialize the watermark.watermarkClass - the watermark class for this WorkUnit.WorkUnit.@Deprecated public long getHighWaterMark()
getExpectedHighWatermark() method.WorkUnit.public void setWatermarkInterval(WatermarkInterval watermarkInterval)
WatermarkInterval for a WorkUnit.@Deprecated public void setHighWaterMark(long highWaterMark)
setWatermarkInterval(WatermarkInterval).WorkUnit.highWaterMark - high watermark@Deprecated public long getLowWaterMark()
getLowWatermark() method.WorkUnit.public boolean contains(String key)
Statepublic String getProp(String key)
Statepublic String getProp(String key, String def)
State@Deprecated public void setLowWaterMark(long lowWaterMark)
setWatermarkInterval(WatermarkInterval).WorkUnit.lowWaterMark - low watermarkpublic void readFields(DataInput in) throws IOException
readFields in interface WritableShimreadFields in class StateIOExceptionpublic void write(DataOutput out) throws IOException
write in interface WritableShimwrite in class StateIOExceptionpublic String getOutputFilePath()