public interface StepMetaInterface
The following interface methods also fall into the area of maintaining settings:
This method is called every time a new step is created and should allocate or set the step configuration to sensible defaults. The values set here will be used by Spoon when a new step is created. This is often a good place to ensure that the step’s settings are initialized to non-null values. Null values can be cumbersome to deal with in serialization and dialog population, so most PDI step implementations stick to non-null values for all step settings.
This method is called when a step is duplicated in Spoon. It needs to return a deep copy of this step meta object. It is essential that the implementing class creates proper deep copies if the step configuration is stored in modifiable objects, such as lists or custom helper objects. See org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta.clone() for an example on creating a deep copy.
This method is called by PDI whenever a step needs to serialize its settings to XML. It is called when saving a transformation in Spoon. The method returns an XML string, containing the serialized step settings. The string contains a series of XML tags, typically one tag per setting. The helper class org.pentaho.di.core.xml.XMLHandler is typically used to construct the XML string.
This method is called by PDI whenever a step needs to read its settings from XML. The XML node containing the step's settings is passed in as an argument. Again, the helper class org.pentaho.di.core.xml.XMLHandler is typically used to conveniently read the step settings from the XML node.
This method is called by PDI whenever a step needs to save its settings to a PDI repository. The repository object passed in as the first argument provides a convenient set of methods for serializing step settings. The transformation id and step id passed in should be used by the step as identifiers when calling the repository serialization methods.
This method is called by PDI whenever a step needs to read its configuration from a PDI repository. The step id given in the arguments should be used as the identifier when using the repositories serialization methods.
public StepDialogInterface getDialog(...)
public StepInterface getStep(...)
public StepDataInterface getStepData()
Each of the above methods returns a new instance of the plugin class implementing StepDialogInterface, StepInterface and StepDataInterface.
Given a description of the input rows, the plugin needs to modify it to match the structure for its output fields. The implementation modifies the passed in RowMetaInterface object to reflect any changes to the row stream. Typically a step adds fields to the row structure, which is done by creating ValueMeta objects (PDI’s default implementation of ValueMetaInterface), and appending them to the RowMetaInterface object. The section Working with Fields goes into deeper detail on ValueMetaInterface.
Each step has the opportunity to validate its settings and verify that the configuration given by the user is reasonable. In addition to that a step typically checks if it is connected to preceding or following steps, if the nature of the step requires that kind of connection. An input step may expect to not have a preceding step for example. The check method passes in a list of check remarks that the method should append its validation results to. Spoon then displays the list of remarks collected from the steps, allowing the user to take corrective action in case of validation warnings or errors.
Modifier and Type | Method and Description |
---|---|
void |
analyseImpact(List<DatabaseImpact> impact,
TransMeta transMeta,
StepMeta stepMeta,
RowMetaInterface prev,
String[] input,
String[] output,
RowMetaInterface info)
|
void |
analyseImpact(List<DatabaseImpact> impact,
TransMeta transMeta,
StepMeta stepMeta,
RowMetaInterface prev,
String[] input,
String[] output,
RowMetaInterface info,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore)
Each step must be able to report on the impact it has on a database, table field, etc.
|
void |
cancelQueries()
Call this to cancel trailing database queries (too long running, etc)
|
void |
check(List<CheckResultInterface> remarks,
TransMeta transMeta,
StepMeta stepMeta,
RowMetaInterface prev,
String[] input,
String[] output,
RowMetaInterface info)
|
void |
check(List<CheckResultInterface> remarks,
TransMeta transMeta,
StepMeta stepMeta,
RowMetaInterface prev,
String[] input,
String[] output,
RowMetaInterface info,
VariableSpace space,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore)
Checks the settings of this step and puts the findings in a remarks List.
|
default boolean |
cleanAfterHopFromRemove()
Action remove hop from this step
|
Object |
clone()
Make an exact copy of this step, make sure to explicitly copy Collections etc.
|
boolean |
excludeFromCopyDistributeVerification()
This method is added to exclude certain steps from copy/distribute checking.
|
boolean |
excludeFromRowLayoutVerification()
This method is added to exclude certain steps from layout checking.
|
String |
exportResources(VariableSpace space,
Map<String,ResourceDefinition> definitions,
ResourceNamingInterface resourceNamingInterface,
Repository repository)
|
String |
exportResources(VariableSpace space,
Map<String,ResourceDefinition> definitions,
ResourceNamingInterface resourceNamingInterface,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore) |
List<StepInjectionMetaEntry> |
extractStepMetadataEntries() |
String |
getActiveReferencedObjectDescription() |
String |
getDialogClassName()
Deprecated.
As of release 8.1, use annotated-based dialog instead
PluginDialog |
void |
getFields(RowMetaInterface inputRowMeta,
String name,
RowMetaInterface[] info,
StepMeta nextStep,
VariableSpace space)
|
void |
getFields(RowMetaInterface inputRowMeta,
String name,
RowMetaInterface[] info,
StepMeta nextStep,
VariableSpace space,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore)
Gets the fields.
|
List<StreamInterface> |
getOptionalStreams() |
StepMeta |
getParentStepMeta() |
String[] |
getReferencedObjectDescriptions() |
RowMetaInterface |
getRequiredFields(VariableSpace space)
The natural way of data flow in a transformation is source-to-target.
|
List<ResourceReference> |
getResourceDependencies(TransMeta transMeta,
StepMeta stepMeta)
Get a list of all the resource dependencies that the step is depending on.
|
SQLStatement |
getSQLStatements(TransMeta transMeta,
StepMeta stepMeta,
RowMetaInterface prev)
|
SQLStatement |
getSQLStatements(TransMeta transMeta,
StepMeta stepMeta,
RowMetaInterface prev,
Repository repository,
org.pentaho.metastore.api.IMetaStore metaStore)
Standard method to return an SQLStatement object with SQL statements that the step needs in order to work
correctly.
|
StepInterface |
getStep(StepMeta stepMeta,
StepDataInterface stepDataInterface,
int copyNr,
TransMeta transMeta,
Trans trans)
Get the executing step, needed by Trans to launch a step.
|
StepDataInterface |
getStepData()
Get a new instance of the appropriate data class.
|
StepIOMetaInterface |
getStepIOMeta()
Returns the Input/Output metadata for this step.
|
StepMetaInjectionInterface |
getStepMetaInjectionInterface()
Deprecated.
Use annotation-based injection instead
|
TransMeta.TransformationType[] |
getSupportedTransformationTypes() |
RowMetaInterface |
getTableFields() |
Map<String,String> |
getUsedArguments()
Default a step doesn't use any arguments.
|
DatabaseMeta[] |
getUsedDatabaseConnections()
This method returns all the database connections that are used by the step.
|
String[] |
getUsedLibraries() |
String |
getXML()
Get the XML that represents the values in this step
|
void |
handleStreamSelection(StreamInterface stream)
When an optional stream is selected, this method is called to handled the ETL metadata implications of that.
|
boolean |
hasChanged() |
boolean |
hasRepositoryReferences() |
boolean[] |
isReferencedObjectEnabled() |
Object |
loadReferencedObject(int index,
Repository rep,
org.pentaho.metastore.api.IMetaStore metaStore,
VariableSpace space)
Load the referenced object
|
void |
loadXML(Node stepnode,
List<DatabaseMeta> databases,
org.pentaho.metastore.api.IMetaStore metaStore)
Load the values for this step from an XML Node
|
void |
loadXML(Node stepnode,
List<DatabaseMeta> databases,
Map<String,Counter> counters)
Deprecated.
|
void |
lookupRepositoryReferences(Repository repository)
Look up the references after import
|
default boolean |
passDataToServletOutput()
True if the step passes it's result data straight to the servlet output.
|
void |
readRep(Repository rep,
org.pentaho.metastore.api.IMetaStore metaStore,
ObjectId id_step,
List<DatabaseMeta> databases)
Read the steps information from a Kettle repository
|
void |
readRep(Repository rep,
ObjectId id_step,
List<DatabaseMeta> databases,
Map<String,Counter> counters)
Deprecated.
|
void |
resetStepIoMeta()
For steps that handle dynamic input (info) or output (target) streams, it is useful to be able to force the
recreate the StepIoMeta definition.
|
void |
saveRep(Repository rep,
org.pentaho.metastore.api.IMetaStore metaStore,
ObjectId id_transformation,
ObjectId id_step)
Save the steps data into a Kettle repository
|
void |
saveRep(Repository rep,
ObjectId id_transformation,
ObjectId id_step)
Deprecated.
|
void |
searchInfoAndTargetSteps(List<StepMeta> steps)
Change step names into step objects to allow them to be name-changed etc.
|
void |
setChanged() |
void |
setDefault()
Set default values
|
void |
setParentStepMeta(StepMeta parentStepMeta)
Provide original lineage for this metadata object
|
boolean |
supportsErrorHandling() |
void setDefault()
@Deprecated void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
getFields(RowMetaInterface, String, RowMetaInterface[], StepMeta, VariableSpace, Repository, IMetaStore)
inputRowMeta
- the input row meta that is modified in this method to reflect the output row metadata of the stepname
- Name of the step to use as input for the origin field in the valuesinfo
- Fields used as extra lookup informationnextStep
- the next step that is targetedspace
- the space The variable space to use to replace variablesKettleStepException
- the kettle step exceptionvoid getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleStepException
inputRowMeta
- the input row meta that is modified in this method to reflect the output row metadata of the stepname
- Name of the step to use as input for the origin field in the valuesinfo
- Fields used as extra lookup informationnextStep
- the next step that is targetedspace
- the space The variable space to use to replace variablesrepository
- the repository to use to load Kettle metadata objects impacting the output fieldsmetaStore
- the MetaStore to use to load additional external data or metadata impacting the output fieldsKettleStepException
- the kettle step exceptionString getXML() throws KettleException
KettleException
- in case there is a conversion or XML encoding error@Deprecated void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String,Counter> counters) throws KettleXMLException
loadXML(Node, List, IMetaStore)
stepnode
- the Node to get the info fromdatabases
- The available list of databases to reference tocounters
- Counters to reference.KettleXMLException
- When an unexpected XML error occurred. (malformed etc.)void loadXML(Node stepnode, List<DatabaseMeta> databases, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleXMLException
stepnode
- the Node to get the info fromdatabases
- The available list of databases to reference tometaStore
- the metastore to optionally load external reference metadata fromKettleXMLException
- When an unexpected XML error occurred. (malformed etc.)@Deprecated void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException
saveRep(Repository, IMetaStore, ObjectId, ObjectId)
rep
- The Kettle repository to save toid_transformation
- The transformation IDid_step
- The step IDKettleException
- When an unexpected error occurred (database, network, etc)void saveRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException
rep
- The Kettle repository to save tometaStore
- the metaStore to optionally write toid_transformation
- The transformation IDid_step
- The step IDKettleException
- When an unexpected error occurred (database, network, etc)@Deprecated void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String,Counter> counters) throws KettleException
readRep(Repository, IMetaStore, ObjectId, List)
rep
- The repository to read fromid_step
- The step IDdatabases
- The databases to referencecounters
- The counters to referenceKettleException
- When an unexpected error occurred (database, network, etc)void readRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException
rep
- The repository to read frommetaStore
- The MetaStore to read external information fromid_step
- The step IDdatabases
- The databases to referenceKettleException
- When an unexpected error occurred (database, network, etc)@Deprecated void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info)
check(List, TransMeta, StepMeta, RowMetaInterface, String[], String[], RowMetaInterface, VariableSpace, Repository, IMetaStore)
remarks
- The list to put the remarks in @see org.pentaho.di.core.CheckResultstepMeta
- The stepMeta to help checkingprev
- The fields coming from the previous stepinput
- The input step namesoutput
- The output step namesinfo
- The fields that are used as information by the stepvoid check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore)
remarks
- The list to put the remarks in @see org.pentaho.di.core.CheckResultstepMeta
- The stepMeta to help checkingprev
- The fields coming from the previous stepinput
- The input step namesoutput
- The output step namesinfo
- The fields that are used as information by the stepspace
- the variable space to resolve variable expressions withrepository
- the repository to use to load Kettle metadata objects impacting the output fieldsmetaStore
- the MetaStore to use to load additional external data or metadata impacting the output fieldsObject clone()
RowMetaInterface getTableFields()
boolean excludeFromRowLayoutVerification()
boolean excludeFromCopyDistributeVerification()
@Deprecated String getDialogClassName()
PluginDialog
StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta, Trans trans)
stepMeta
- The step infostepDataInterface
- the step data interface linked to this step. Here the step can store temporary data, database connections,
etc.copyNr
- The copy nr to gettransMeta
- The transformation infotrans
- The launching transformationStepDataInterface getStepData()
@Deprecated void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info) throws KettleStepException
analyseImpact(List, TransMeta, StepMeta, RowMetaInterface, String[], String[], RowMetaInterface, Repository, IMetaStore)
impact
- The list of impacts @see org.pentaho.di.transMeta.DatabaseImpacttransMeta
- The transformation informationstepMeta
- The step informationprev
- The fields entering this stepinput
- The previous step namesoutput
- The output step namesinfo
- The fields used as information by this stepKettleStepException
void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleStepException
impact
- The list of impacts @see org.pentaho.di.transMeta.DatabaseImpacttransMeta
- The transformation informationstepMeta
- The step informationprev
- The fields entering this stepinput
- The previous step namesoutput
- The output step namesinfo
- The fields used as information by this steprepository
- the repository to use to load Kettle metadata objects impacting the output fieldsmetaStore
- the MetaStore to use to load additional external data or metadata impacting the output fieldsKettleStepException
@Deprecated SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev) throws KettleStepException
transMeta
- TransInfo object containing the complete transformationstepMeta
- StepMeta object containing the complete stepprev
- Row containing meta-data for the input fields (no data)KettleStepException
SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleStepException
transMeta
- TransInfo object containing the complete transformationstepMeta
- StepMeta object containing the complete stepprev
- Row containing meta-data for the input fields (no data)repository
- the repository to use to load Kettle metadata objects impacting the output fieldsmetaStore
- the MetaStore to use to load additional external data or metadata impacting the output fieldsKettleStepException
void cancelQueries() throws KettleDatabaseException
KettleDatabaseException
Map<String,String> getUsedArguments()
RowMetaInterface getRequiredFields(VariableSpace space) throws KettleException
space
- the variable space to referenceKettleException
- in case the required fields can't be determined.DatabaseMeta[] getUsedDatabaseConnections()
String[] getUsedLibraries()
boolean supportsErrorHandling()
List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepMeta)
transMeta
- stepMeta
- @Deprecated String exportResources(VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException
exportResources(VariableSpace, Map, ResourceNamingInterface, Repository, IMetaStore)
space
- the variable space to usedefinitions
- resourceNamingInterface
- repository
- The repository to optionally load other resources from (to be converted to XML)KettleException
String exportResources(VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws KettleException
space
- the variable space to usedefinitions
- resourceNamingInterface
- repository
- The repository to optionally load other resources from (to be converted to XML)metaStore
- the metaStore in which non-kettle metadata could reside.KettleException
StepMeta getParentStepMeta()
void setParentStepMeta(StepMeta parentStepMeta)
parentStepMeta
- the parent step metadata container objectStepIOMetaInterface getStepIOMeta()
List<StreamInterface> getOptionalStreams()
void handleStreamSelection(StreamInterface stream)
stream
- The optional stream to handle.void resetStepIoMeta()
void searchInfoAndTargetSteps(List<StepMeta> steps)
steps
- the steps to reference@Deprecated StepMetaInjectionInterface getStepMetaInjectionInterface()
List<StepInjectionMetaEntry> extractStepMetadataEntries() throws KettleException
KettleException
TransMeta.TransformationType[] getSupportedTransformationTypes()
boolean hasRepositoryReferences()
void lookupRepositoryReferences(Repository repository) throws KettleException
repository
- the repository to reference.KettleException
void setChanged()
boolean hasChanged()
String[] getReferencedObjectDescriptions()
boolean[] isReferencedObjectEnabled()
String getActiveReferencedObjectDescription()
Object loadReferencedObject(int index, Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, VariableSpace space) throws KettleException
index
- the referenced object index to load (in case there are multiple references)rep
- the repositorymetaStore
- the MetaStore to usespace
- the variable space to useKettleException
default boolean cleanAfterHopFromRemove()
default boolean passDataToServletOutput()
Copyright © 2018 Hitachi Vantara. All rights reserved.