public interface PlugStep
This interface represents an instance of a Data Management Platform DataFlow Plugin Step to allow
interaction with the PlugEngine
/current job.
IMPORTANT: This interface should never be used outside the context and lifecycle of the plugin to which it was provided. This means that an instance should not be passed as an argument to any method nor stored in a static location external to the plugin instance that obtained it.
Modifier and Type | Method and Description |
---|---|
int |
addInputName(java.lang.String name)
Add a name to the list of input names.
|
void |
appendStats(java.lang.String text,
boolean nolf)
Append to the execution statistics.
|
StepOutputItems |
buildOutputItems(int numItems)
Use this to prepare the step's output items.
|
void |
clearInputNames()
Clear the list of input names.
|
PlugEngine |
getEngine()
Returns a reference to the Data Management Platform DataFlow engine.
|
StepExecType |
getExecutionType()
Determine current execution type.
|
StepOutputItems |
getExistingOutputItems()
This returns the output items collection that was created with
buildOutputItems . |
int |
getNumChildren()
Returns the number of Step children.
|
StepStep |
getStep()
Returns a reference to the Data Management Platform DataFlow
StepStep interface. |
int |
getVersion()
Return the version that was set when the step was created, or the current
version if setVersion was called.
|
StepReadState |
parentNext()
Read the next row from the parent.
|
StepOutputItems |
parentOutputItems(boolean needComplete)
Returns StepOutputItems collection for the parent of this step.
|
void |
setError(java.lang.String text)
Set an error state.
|
void |
setVersion(int version)
Set the version that is reported by getVersion.
|
boolean |
updateStatus()
Ask the engine to update status.
|
int getVersion()
This will be 0 if no version was present (if the step was loaded from a file without a version associated with the step), or -1 if the step was created manually (ie, this would mean that it is the current version).
So:
0 = the step is being loaded from a file, and no version was saved with the step, or version 0 was saved with the step. -1 = the step is being created manually through createStep. >0 = the step is being loaded from a file and it is version xxx.
void setError(java.lang.String text)
This should be called before erroring out of a method. It makes the error information along with the step that caused the error available to the user.
text
- The text that describes the error state.void appendStats(java.lang.String text, boolean nolf)
The default is to append a linefeed to the line.
The statistics for a plugin are cleared when
IStep.preExec
is called.
text
- The text that will be appended to the statistics.nolf
- If true, no linefeed will be appended after the text.java.lang.NullPointerException
- if text is null.StepReadState parentNext()
StepOutputItems parentOutputItems(boolean needComplete)
needComplete
- True if we need parent's complete output info.StepOutputItems buildOutputItems(int numItems)
numItems
- Specifies the number of output items to prepare.StepOutputItems getExistingOutputItems()
buildOutputItems
.
If no output items were built, it will still return a valid object with a zero count.
buildOutputItems
.void clearInputNames()
Use this before filling the list.
int addInputName(java.lang.String name)
If the name already exists, it will not be added again.
name
- The name to add.StepExecType getExecutionType()
This will only be valid during IStep.preExec()
and thereafter.
It will not be valid from IStep.prep(int)
.
boolean updateStatus()
int getNumChildren()
If the plugin is in a state of execution (ie. IStep.preExec()
has been successfully
called) and this plugin is the one upon which IStep.preExec()
was called,
it will return 1 even if it has 0 children linked.
void setVersion(int version)
The new version number will be saved to the job file. If a version has not been set, then no version will be saved to the job file.
The premise is that if an earlier version must be supported, if a getVersion()
call
from the IStep.initialize(com.dataflux.architect.PlugStep)
function returns 0 (or your earlier version number),
then it is the earlier version. If it returns -1, or your current version, then it is the
current version. Right after that (also in initialize) you will call setVersion(int)
with your current
version. This version will then be saved with the file.
version
- The version of the plugin step.StepStep getStep()
StepStep
interface.
Most plugin steps only need to use this method to access another step in the job, such as a parent step.
StepStep
interface.PlugEngine getEngine()
Copyright © 2012 SAS Institute Inc. All Rights Reserved.