public class ImmutableWorkUnitState extends WorkUnitState
WorkUnitState.WorkUnitState.WorkingState| Constructor and Description |
|---|
ImmutableWorkUnitState(WorkUnitState workUnitState) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(Properties properties)
Populates this instance with values of a
Properties instance. |
void |
addAllIfNotExist(Properties properties)
Add properties in a
Properties instance that are not in the current instance. |
void |
appendToListProp(String key,
String value)
Appends the input value to a list property that can be retrieved with
State.getPropAsList(java.lang.String). |
void |
backoffActualHighWatermark()
Backoff the actual high watermark to the low watermark returned by
WorkUnit.getLowWatermark(). |
void |
overrideWith(Properties properties)
Add properties in a
Properties instance that are in the current instance. |
void |
readFields(DataInput in) |
void |
setActualHighWatermark(Watermark watermark)
This method should set the actual, runtime high
Watermark for this WorkUnitState. |
void |
setHighWaterMark(long value)
Deprecated.
|
void |
setId(String id)
Set the id used for state persistence and logging.
|
void |
setProp(String key,
Object value)
Set a property.
|
void |
setWorkingState(WorkUnitState.WorkingState state)
Set the current runtime state of the
WorkUnit. |
addFinalConstructState, contains, equals, getActualHighWatermark, getActualHighWatermark, getActualHighWatermark, getExtract, getFinalConstructStates, getHighWaterMark, getOutputFilePath, getPreviousTableState, getProp, getProp, getProperties, getProperty, getProperty, getPropertyNames, getTaskBroker, getTaskBrokerNullable, getWorkingState, getWorkunit, hashCode, removeProp, removePropsWithPrefix, setJobState, setWuProperties, toString, writeaddAll, addAllIfNotExist, appendToSetProp, getId, getPropAsBoolean, getPropAsBoolean, getPropAsCaseInsensitiveSet, getPropAsCaseInsensitiveSet, getPropAsDouble, getPropAsDouble, getPropAsInt, getPropAsInt, getPropAsJsonArray, getPropAsList, getPropAsList, getPropAsLong, getPropAsLong, getPropAsSet, getPropAsSet, getPropAsShort, getPropAsShort, getPropAsShortWithRadix, getPropAsShortWithRadix, overrideWith, setPropspublic ImmutableWorkUnitState(WorkUnitState workUnitState)
public void setWorkingState(WorkUnitState.WorkingState state)
WorkUnitStateWorkUnit.setWorkingState in class WorkUnitStatestate - WorkUnitState.WorkingState of the WorkUnitpublic void setActualHighWatermark(Watermark watermark)
WorkUnitStateWatermark for this WorkUnitState. A high
Watermark indicates that all data for the source has been pulled up to a specific point.
This method should be called inside the Extractor class, during the initialization
of the class, before any calls to Extractor.readRecord(Object) are executed. This
method keeps a local point to the given Watermark and expects the following invariant to always be upheld.
The invariant for this Watermark is that it should cover all records up to and including the most recent
record returned by Extractor.readRecord(Object).
The Watermark set in this method may be polled by the framework multiple times, in order to track the
progress of how the Watermark changes. This is important for reporting percent completion of a
WorkUnit.
Extractor
interface, this method should become part of the Extractor interface. For example,
a method such as getCurrentHighWatermark() should be added.setActualHighWatermark in class WorkUnitState@Deprecated public void setHighWaterMark(long value)
WorkUnitStatesetHighWaterMark in class WorkUnitStatevalue - high watermarkpublic void setProp(String key, Object value)
StateBoth key and value are stored as strings.
public void addAll(Properties properties)
StateProperties instance.addAll in class Stateproperties - a Properties instancepublic void addAllIfNotExist(Properties properties)
StateProperties instance that are not in the current instance.addAllIfNotExist in class Stateproperties - a Properties instancepublic void overrideWith(Properties properties)
StateProperties instance that are in the current instance.overrideWith in class Stateproperties - a Properties instancepublic void setId(String id)
Statepublic void readFields(DataInput in) throws IOException
readFields in interface WritableShimreadFields in class WorkUnitStateIOExceptionpublic void backoffActualHighWatermark()
WorkUnitStateWorkUnit.getLowWatermark().backoffActualHighWatermark in class WorkUnitStatepublic void appendToListProp(String key, String value)
StateState.getPropAsList(java.lang.String).
List properties are internally stored as comma separated strings. Adding a value that contains commas (for
example "a,b,c") will essentially add multiple values to the property ("a", "b", and "c"). This is
similar to the way that Configuration works.
appendToListProp in class Statekey - property keyvalue - property value (if it includes commas, it will be split by the commas).