Interface StepMetaInterface
- All Known Subinterfaces:
InputFileMetaInterface
- All Known Implementing Classes:
AbstractStepMeta
,BaseFileInputMeta
,BaseFileMeta
,BaseFileOutputMeta
,BaseSerializingMeta
,BaseStreamStepMeta
,CalculatorMeta
,ConstantMeta
,CsvInputMeta
,DatabaseJoinMeta
,DatabaseLookupMeta
,DataGridMeta
,DBProcMeta
,DeleteMeta
,DenormaliserMeta
,DetectEmptyStreamMeta
,DetectLastRowMeta
,DimensionLookupMeta
,DummyTransMeta
,DynamicSQLRowMeta
,ExecProcessMeta
,ExecSQLMeta
,ExecSQLRowMeta
,FieldsChangeSequenceMeta
,FieldSplitterMeta
,FileExistsMeta
,FileLockedMeta
,FilesFromResultMeta
,FilesToResultMeta
,FilterRowsMeta
,FixedInputMeta
,FlattenerMeta
,FormulaMeta
,FuzzyMatchMeta
,GetFileNamesMeta
,GetFilesRowsCountMeta
,GetSlaveSequenceMeta
,GetSubFoldersMeta
,GetTableNamesMeta
,GetVariableMeta
,GroupByMeta
,HTTPMeta
,HTTPPOSTMeta
,IfNullMeta
,InjectorMeta
,InsertUpdateMeta
,JaninoMeta
,JavaFilterMeta
,JobExecutorMeta
,JoinRowsMeta
,LDIFInputMeta
,LoadFileInputMeta
,MappingInputMeta
,MappingMeta
,MappingOutputMeta
,MemoryGroupByMeta
,MergeJoinMeta
,MergeRowsMeta
,MissingTrans
,MultiMergeJoinMeta
,NormaliserMeta
,NullIfMeta
,NumberRangeMeta
,OlapInputMeta
,ParGzipCsvInputMeta
,PGPDecryptStreamMeta
,PGPEncryptStreamMeta
,PrioritizeStreamsMeta
,ProcessFilesMeta
,PropertyInputMeta
,PropertyOutputMeta
,RandomValueMeta
,RecordsFromStreamMeta
,RegexEvalMeta
,ReplaceStringMeta
,ReservoirSamplingMeta
,RowGeneratorMeta
,RowsFromResultMeta
,RowsToResultMeta
,SampleRowsMeta
,SasInputMeta
,ScriptMeta
,ScriptValuesMetaMod
,SecretKeyGeneratorMeta
,SelectValuesMeta
,SetValueConstantMeta
,SetValueFieldMeta
,SetVariableMeta
,SimpleMappingMeta
,SingleThreaderMeta
,SocketReaderMeta
,SocketWriterMeta
,SortedMergeMeta
,SortRowsMeta
,SplitFieldToRowsMeta
,SQLFileOutputMeta
,SSHMeta
,StepMetastructureMeta
,StepsMetricsMeta
,StepWithMappingMeta
,StreamLookupMeta
,StringCutMeta
,StringOperationsMeta
,SwitchCaseMeta
,SymmetricCryptoTransMeta
,SynchronizeAfterMergeMeta
,SyslogMessageMeta
,SystemDataMeta
,TableCompareMeta
,TableExistsMeta
,TableInputMeta
,TableOutputMeta
,TextFileInputMeta
,TextFileInputMeta
,TextFileOutputLegacyMeta
,TextFileOutputMeta
,TransExecutorMeta
,UniqueRowsByHashSetMeta
,UniqueRowsMeta
,UnivariateStatsMeta
,UpdateMeta
,UserDefinedJavaClassMeta
,ValidatorMeta
,ValueMapperMeta
,WebServiceAvailableMeta
,WebServiceMeta
,WriteToLogMeta
,XBaseInputMeta
,ZipFileMeta
- Keep track of the step settings The implementing class typically keeps track of step settings using
private fields with corresponding getters and setters. The dialog class implementing StepDialogInterface is using the
getters and setters to copy the user supplied configuration in and out of the dialog.
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.
-
Serialize step settings
The plugin needs to be able to serialize its settings to both XML and a PDI repository. The interface methods are as follows.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.
-
Provide instances of other plugin classes
The StepMetaInterface plugin class is the main class tying in with the rest of PDI architecture. It is responsible for supplying instances of the other plugin classes implementing StepDialogInterface, StepInterface and StepDataInterface. The following methods cover these responsibilities. Each of the method’s implementation is typically constructing a new instance of the corresponding class forwarding the passed in arguments to the constructor. The methods are as follows.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.
-
Report the step’s changes to the row stream PDI needs to know how a step affects the row structure. A
step may be adding or removing fields, as well as modifying the metadata of a field. The method implementing this
aspect of a step plugin is getFields().
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.
-
Validate step settings
Spoon supports a “validate transformation” feature, which triggers a self-check of all steps. PDI invokes the check() method of each step on the canvas allowing each step to validate its settings.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.
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.
- Since:
- 4-aug-2004
- Author:
- Matt
-
Method Summary
Modifier and TypeMethodDescriptionvoid
analyseImpact
(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info) Deprecated.void
analyseImpact
(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.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
Call this to cancel trailing database queries (too long running, etc)void
check
(List<org.pentaho.di.core.CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info) void
check
(List<org.pentaho.di.core.CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info, org.pentaho.di.core.variables.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
Action remove hop exiting this stepdefault boolean
cleanAfterHopFromRemove
(StepMeta toStep) Action remove hop exiting this stepdefault boolean
cleanAfterHopToRemove
(StepMeta fromStep) Action remove hop entering this step.clone()
Make an exact copy of this step, make sure to explicitly copy Collections etc.boolean
This method is added to exclude certain steps from copy/distribute checking.boolean
This method is added to exclude certain steps from layout checking.exportResources
(org.pentaho.di.core.variables.VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) exportResources
(org.pentaho.di.core.variables.VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) default TransMeta
fetchTransMeta
(StepMetaInterface stepMeta, Repository rep, org.pentaho.metastore.api.IMetaStore metastore, org.pentaho.di.core.variables.VariableSpace space) Allows for someone to fetch the related TransMeta object.Deprecated.As of release 8.1, use annotated-based dialog insteadvoid
getFields
(org.pentaho.di.core.row.RowMetaInterface inputRowMeta, String name, org.pentaho.di.core.row.RowMetaInterface[] info, StepMeta nextStep, org.pentaho.di.core.variables.VariableSpace space) void
getFields
(org.pentaho.di.core.row.RowMetaInterface inputRowMeta, String name, org.pentaho.di.core.row.RowMetaInterface[] info, StepMeta nextStep, org.pentaho.di.core.variables.VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) Gets the fields.String[]
org.pentaho.di.core.row.RowMetaInterface
getRequiredFields
(org.pentaho.di.core.variables.VariableSpace space) The natural way of data flow in a transformation is source-to-target.getResourceDependencies
(TransMeta transMeta, StepMeta stepMeta) Get a list of all the resource dependencies that the step is depending on.org.pentaho.di.core.SQLStatement
getSQLStatements
(TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev) org.pentaho.di.core.SQLStatement
getSQLStatements
(TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.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.getStep
(StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta, Trans trans) Get the executing step, needed by Trans to launch a step.Get a new instance of the appropriate data class.Returns the Input/Output metadata for this step.Deprecated.Use annotation-based injection insteadorg.pentaho.di.core.row.RowMetaInterface
Default a step doesn't use any arguments.org.pentaho.di.core.database.DatabaseMeta[]
This method returns all the database connections that are used by the step.String[]
getXML()
Get the XML that represents the values in this stepvoid
handleStreamSelection
(StreamInterface stream) When an optional stream is selected, this method is called to handled the ETL metadata implications of that.boolean
boolean
boolean[]
loadReferencedObject
(int index, Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.core.variables.VariableSpace space) Load the referenced objectvoid
loadXML
(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String, org.pentaho.di.core.Counter> counters) Deprecated.void
loadXML
(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, org.pentaho.metastore.api.IMetaStore metaStore) Load the values for this step from an XML Nodevoid
lookupRepositoryReferences
(Repository repository) Look up the references after importdefault boolean
True if the step passes it's result data straight to the servlet output.void
readRep
(Repository rep, org.pentaho.di.repository.ObjectId id_step, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String, org.pentaho.di.core.Counter> counters) Deprecated.void
readRep
(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.repository.ObjectId id_step, List<org.pentaho.di.core.database.DatabaseMeta> databases) Read the steps information from a Kettle repositoryvoid
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.di.repository.ObjectId id_transformation, org.pentaho.di.repository.ObjectId id_step) Deprecated.void
saveRep
(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.repository.ObjectId id_transformation, org.pentaho.di.repository.ObjectId id_step) Save the steps data into a Kettle repositoryvoid
searchInfoAndTargetSteps
(List<StepMeta> steps) Change step names into step objects to allow them to be name-changed etc.void
void
Set default valuesvoid
setParentStepMeta
(StepMeta parentStepMeta) Provide original lineage for this metadata objectboolean
-
Method Details
-
setDefault
void setDefault()Set default values -
getFields
@Deprecated void getFields(org.pentaho.di.core.row.RowMetaInterface inputRowMeta, String name, org.pentaho.di.core.row.RowMetaInterface[] info, StepMeta nextStep, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleStepException Deprecated.Gets the fields.- Parameters:
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 variables- Throws:
org.pentaho.di.core.exception.KettleStepException
- the kettle step exception
-
getFields
void getFields(org.pentaho.di.core.row.RowMetaInterface inputRowMeta, String name, org.pentaho.di.core.row.RowMetaInterface[] info, StepMeta nextStep, org.pentaho.di.core.variables.VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleStepException Gets the fields.- Parameters:
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 fields- Throws:
org.pentaho.di.core.exception.KettleStepException
- the kettle step exception
-
getXML
Get the XML that represents the values in this step- Returns:
- the XML that represents the metadata in this step
- Throws:
org.pentaho.di.core.exception.KettleException
- in case there is a conversion or XML encoding error
-
loadXML
@Deprecated void loadXML(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String, org.pentaho.di.core.Counter> counters) throws org.pentaho.di.core.exception.KettleXMLExceptionDeprecated.Load the values for this step from an XML Node- Parameters:
stepnode
- the Node to get the info fromdatabases
- The available list of databases to reference tocounters
- Counters to reference.- Throws:
org.pentaho.di.core.exception.KettleXMLException
- When an unexpected XML error occurred. (malformed etc.)
-
loadXML
void loadXML(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleXMLException Load the values for this step from an XML Node- Parameters:
stepnode
- the Node to get the info fromdatabases
- The available list of databases to reference tometaStore
- the metastore to optionally load external reference metadata from- Throws:
org.pentaho.di.core.exception.KettleXMLException
- When an unexpected XML error occurred. (malformed etc.)
-
saveRep
@Deprecated void saveRep(Repository rep, org.pentaho.di.repository.ObjectId id_transformation, org.pentaho.di.repository.ObjectId id_step) throws org.pentaho.di.core.exception.KettleException Deprecated.Save the steps data into a Kettle repository- Parameters:
rep
- The Kettle repository to save toid_transformation
- The transformation IDid_step
- The step ID- Throws:
org.pentaho.di.core.exception.KettleException
- When an unexpected error occurred (database, network, etc)
-
saveRep
void saveRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.repository.ObjectId id_transformation, org.pentaho.di.repository.ObjectId id_step) throws org.pentaho.di.core.exception.KettleException Save the steps data into a Kettle repository- Parameters:
rep
- The Kettle repository to save tometaStore
- the metaStore to optionally write toid_transformation
- The transformation IDid_step
- The step ID- Throws:
org.pentaho.di.core.exception.KettleException
- When an unexpected error occurred (database, network, etc)
-
readRep
@Deprecated void readRep(Repository rep, org.pentaho.di.repository.ObjectId id_step, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String, org.pentaho.di.core.Counter> counters) throws org.pentaho.di.core.exception.KettleExceptionDeprecated.Read the steps information from a Kettle repository- Parameters:
rep
- The repository to read fromid_step
- The step IDdatabases
- The databases to referencecounters
- The counters to reference- Throws:
org.pentaho.di.core.exception.KettleException
- When an unexpected error occurred (database, network, etc)
-
readRep
void readRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.repository.ObjectId id_step, List<org.pentaho.di.core.database.DatabaseMeta> databases) throws org.pentaho.di.core.exception.KettleException Read the steps information from a Kettle repository- Parameters:
rep
- The repository to read frommetaStore
- The MetaStore to read external information fromid_step
- The step IDdatabases
- The databases to reference- Throws:
org.pentaho.di.core.exception.KettleException
- When an unexpected error occurred (database, network, etc)
-
check
@Deprecated void check(List<org.pentaho.di.core.CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info) Deprecated.Checks the settings of this step and puts the findings in a remarks List.- Parameters:
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 step
-
check
void check(List<org.pentaho.di.core.CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info, org.pentaho.di.core.variables.VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) Checks the settings of this step and puts the findings in a remarks List.- Parameters:
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 fields
-
clone
Object clone()Make an exact copy of this step, make sure to explicitly copy Collections etc.- Returns:
- an exact copy of this step
-
getTableFields
org.pentaho.di.core.row.RowMetaInterface getTableFields()- Returns:
- The fields used by this step, this is being used for the Impact analyses.
-
excludeFromRowLayoutVerification
boolean excludeFromRowLayoutVerification()This method is added to exclude certain steps from layout checking.- Since:
- 2.5.0
-
excludeFromCopyDistributeVerification
boolean excludeFromCopyDistributeVerification()This method is added to exclude certain steps from copy/distribute checking.- Since:
- 4.0.0
-
getDialogClassName
Deprecated.As of release 8.1, use annotated-based dialog insteadGet the name of the class that implements the dialog for this job entry JobEntryBase provides a default -
getStep
StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta, Trans trans) Get the executing step, needed by Trans to launch a step.- Parameters:
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 transformation
-
getStepData
StepDataInterface getStepData()Get a new instance of the appropriate data class. This data class implements the StepDataInterface. It basically contains the persisting data that needs to live on, even if a worker thread is terminated.- Returns:
- The appropriate StepDataInterface class.
-
analyseImpact
@Deprecated void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info) throws org.pentaho.di.core.exception.KettleStepException Deprecated.Each step must be able to report on the impact it has on a database, table field, etc.- Parameters:
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 step- Throws:
org.pentaho.di.core.exception.KettleStepException
-
analyseImpact
void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleStepException Each step must be able to report on the impact it has on a database, table field, etc.- Parameters:
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 fields- Throws:
org.pentaho.di.core.exception.KettleStepException
-
getSQLStatements
@Deprecated org.pentaho.di.core.SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev) throws org.pentaho.di.core.exception.KettleStepException Standard method to return an SQLStatement object with SQL statements that the step needs in order to work correctly. This can mean "create table", "create index" statements but also "alter table ... add/drop/modify" statements.- Parameters:
transMeta
- TransInfo object containing the complete transformationstepMeta
- StepMeta object containing the complete stepprev
- Row containing meta-data for the input fields (no data)- Returns:
- The SQL Statements for this step. If nothing has to be done, the SQLStatement.getSQL() == null. @see SQLStatement
- Throws:
org.pentaho.di.core.exception.KettleStepException
-
getSQLStatements
org.pentaho.di.core.SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleStepException Standard method to return an SQLStatement object with SQL statements that the step needs in order to work correctly. This can mean "create table", "create index" statements but also "alter table ... add/drop/modify" statements.- Parameters:
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 fields- Returns:
- The SQL Statements for this step. If nothing has to be done, the SQLStatement.getSQL() == null. @see SQLStatement
- Throws:
org.pentaho.di.core.exception.KettleStepException
-
cancelQueries
void cancelQueries() throws org.pentaho.di.core.exception.KettleDatabaseExceptionCall this to cancel trailing database queries (too long running, etc)- Throws:
org.pentaho.di.core.exception.KettleDatabaseException
-
getUsedArguments
Default a step doesn't use any arguments. Implement this to notify the GUI that a window has to be displayed BEFORE launching a transformation. You can also use this to specify certain Environment variable values.- Returns:
- A Map of argument values. (name and optionally a default value) Put 10 values in the map for the possible 10 arguments.
-
getRequiredFields
org.pentaho.di.core.row.RowMetaInterface getRequiredFields(org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleException The natural way of data flow in a transformation is source-to-target. However, this makes mapping to target tables difficult to do. To help out here, we supply information to the transformation meta-data model about which fields are required for a step. This allows us to automate certain tasks like the mapping to pre-defined tables. The Table Output step in this case will output the fields in the target table using this method.- Parameters:
space
- the variable space to reference- Returns:
- the required fields for this steps metadata.
- Throws:
org.pentaho.di.core.exception.KettleException
- in case the required fields can't be determined.
-
getUsedDatabaseConnections
org.pentaho.di.core.database.DatabaseMeta[] getUsedDatabaseConnections()This method returns all the database connections that are used by the step.- Returns:
- an array of database connections meta-data. Return an empty array if no connections are used.
-
getUsedLibraries
String[] getUsedLibraries()- Returns:
- the libraries that this step or plugin uses.
-
supportsErrorHandling
boolean supportsErrorHandling()- Returns:
- true if this step supports error "reporting" on rows: the ability to send rows to a certain target step.
-
getResourceDependencies
Get a list of all the resource dependencies that the step is depending on.- Parameters:
transMeta
-stepMeta
-- Returns:
- a list of all the resource dependencies that the step is depending on
-
exportResources
@Deprecated String exportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws org.pentaho.di.core.exception.KettleExceptionDeprecated.- Parameters:
space
- the variable space to usedefinitions
-resourceNamingInterface
-repository
- The repository to optionally load other resources from (to be converted to XML)- Returns:
- the filename of the exported resource
- Throws:
org.pentaho.di.core.exception.KettleException
-
exportResources
String exportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleException- Parameters:
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.- Returns:
- the filename of the exported resource
- Throws:
org.pentaho.di.core.exception.KettleException
-
getParentStepMeta
StepMeta getParentStepMeta()- Returns:
- The StepMeta object to which this metadata class belongs. With this, we can see to which transformation metadata (etc) this metadata pertains to. (hierarchy)
-
setParentStepMeta
Provide original lineage for this metadata object- Parameters:
parentStepMeta
- the parent step metadata container object
-
getStepIOMeta
StepIOMetaInterface getStepIOMeta()Returns the Input/Output metadata for this step. -
getOptionalStreams
List<StreamInterface> getOptionalStreams()- Returns:
- The list of optional input streams. It allows the user to select f rom a list of possible actions like "New target step"
-
handleStreamSelection
When an optional stream is selected, this method is called to handled the ETL metadata implications of that.- Parameters:
stream
- The optional stream to handle.
-
resetStepIoMeta
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. By default this definition is cached. -
searchInfoAndTargetSteps
Change step names into step objects to allow them to be name-changed etc.- Parameters:
steps
- the steps to reference
-
getStepMetaInjectionInterface
Deprecated.Use annotation-based injection instead- Returns:
- Optional interface that allows an external program to inject step metadata in a standardized fasion. This method will return null if the interface is not available for this step.
-
extractStepMetadataEntries
List<StepInjectionMetaEntry> extractStepMetadataEntries() throws org.pentaho.di.core.exception.KettleException- Returns:
- The step metadata itself, not the metadata description. For lists it will have 0 entries in case there are no entries.
- Throws:
org.pentaho.di.core.exception.KettleException
-
getSupportedTransformationTypes
TransMeta.TransformationType[] getSupportedTransformationTypes()- Returns:
- The supported transformation types that this step supports.
-
hasRepositoryReferences
boolean hasRepositoryReferences()- Returns:
- True if the job entry defines one or more references to a repository object.
-
lookupRepositoryReferences
void lookupRepositoryReferences(Repository repository) throws org.pentaho.di.core.exception.KettleException Look up the references after import- Parameters:
repository
- the repository to reference.- Throws:
org.pentaho.di.core.exception.KettleException
-
setChanged
void setChanged() -
hasChanged
boolean hasChanged() -
getReferencedObjectDescriptions
String[] getReferencedObjectDescriptions()- Returns:
- The objects referenced in the step, like a mapping, a transformation, a job, ...
-
isReferencedObjectEnabled
boolean[] isReferencedObjectEnabled()- Returns:
- true for each referenced object that is enabled or has a valid reference definition.
-
getActiveReferencedObjectDescription
String getActiveReferencedObjectDescription()- Returns:
- A description of the active referenced object in a transformation. Null if nothing special needs to be done or if the active metadata isn't different from design.
-
loadReferencedObject
Object loadReferencedObject(int index, Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleException Load the referenced object- Parameters:
index
- the referenced object index to load (in case there are multiple references)rep
- the repositorymetaStore
- the MetaStore to usespace
- the variable space to use- Returns:
- the referenced object once loaded
- Throws:
org.pentaho.di.core.exception.KettleException
-
cleanAfterHopFromRemove
default boolean cleanAfterHopFromRemove()Action remove hop exiting this step- Returns:
- step was changed
-
cleanAfterHopFromRemove
Action remove hop exiting this step
- Parameters:
toStep
- the to-step of the hop being removed- Returns:
- step was changed
-
cleanAfterHopToRemove
Action remove hop entering this step.
Sometimes, in addition to the hops themselves, a Step has internal configuration referencing some of the steps that connect to it (to identify the main step or the one to be used for lookup, for instance). If the hop being deleted comes from one of those steps, the references to them should be removed.
- Parameters:
fromStep
- the from-step of the hop being removed- Returns:
- step was changed
-
passDataToServletOutput
default boolean passDataToServletOutput()True if the step passes it's result data straight to the servlet output. See exposing Kettle data over a web service http://wiki.pentaho.com/display/EAI/PDI+data+over+web+services- Returns:
- True if the step passes it's result data straight to the servlet output, false otherwise
-
fetchTransMeta
default TransMeta fetchTransMeta(StepMetaInterface stepMeta, Repository rep, org.pentaho.metastore.api.IMetaStore metastore, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleException Allows for someone to fetch the related TransMeta object. Returns null if not found (or not implemented)- Parameters:
stepMeta
- StepMetaInterface objectrep
- Repository objectmetastore
- metastore objectspace
- VariableSpace- Returns:
- the associated TransMeta object, or null if not found (or not implemented)
- Throws:
org.pentaho.di.core.exception.KettleException
- should something go wrong
-
analyseImpact(List, TransMeta, StepMeta, RowMetaInterface, String[], String[], RowMetaInterface, Repository, IMetaStore)