org.pentaho.di.trans.step
Class BaseStepMeta

java.lang.Object
  extended by org.pentaho.di.trans.step.BaseStepMeta
All Implemented Interfaces:
Cloneable, StepAttributesInterface
Direct Known Subclasses:
AbortMeta, AbstractStepMeta, AccessInputMeta, AccessOutputMeta, AddSequenceMeta, AddXMLMeta, AggregateRowsMeta, AnalyticQueryMeta, AppendMeta, AutoDocMeta, BlockingStepMeta, BlockUntilStepsFinishMeta, CalculatorMeta, ChangeFileEncodingMeta, CheckSumMeta, CloneRowMeta, ClosureGeneratorMeta, ColumnExistsMeta, CombinationLookupMeta, ConstantMeta, CreditCardValidatorMeta, CsvInputMeta, CubeInputMeta, CubeOutputMeta, DatabaseJoinMeta, DatabaseLookupMeta, DataGridMeta, DBProcMeta, DelayMeta, DeleteMeta, DenormaliserMeta, DetectEmptyStreamMeta, DetectLastRowMeta, DimensionLookupMeta, DummyTransMeta, DynamicSQLRowMeta, Edi2XmlMeta, ElasticSearchBulkMeta, ExcelInputMeta, ExcelOutputMeta, ExcelWriterStepMeta, ExecProcessMeta, ExecSQLMeta, ExecSQLRowMeta, FieldsChangeSequenceMeta, FieldSplitterMeta, FileExistsMeta, FileLockedMeta, FilesFromResultMeta, FilesToResultMeta, FilterRowsMeta, FixedInputMeta, FlattenerMeta, FormulaMeta, FuzzyMatchMeta, GaInputStepMeta, GetFileNamesMeta, GetFilesRowsCountMeta, GetPreviousRowFieldMeta, GetRepositoryNamesMeta, GetSlaveSequenceMeta, GetSubFoldersMeta, GetTableNamesMeta, GetVariableMeta, GetXMLDataMeta, GPBulkLoaderMeta, GroupByMeta, HTTPMeta, HTTPPOSTMeta, IfNullMeta, IngresVectorwiseLoaderMeta, InjectorMeta, InsertUpdateMeta, JaninoMeta, JavaFilterMeta, JoinRowsMeta, JsonInputMeta, JsonOutputMeta, LDAPInputMeta, LDAPOutputMeta, LDIFInputMeta, LoadFileInputMeta, LucidDBBulkLoaderMeta, LucidDBStreamingLoaderMeta, MailInputMeta, MailMeta, MailValidatorMeta, MappingInputMeta, MappingMeta, MappingOutputMeta, MemoryGroupByMeta, MergeJoinMeta, MergeRowsMeta, MetaInjectMeta, MondrianInputMeta, MonetDBBulkLoaderMeta, MultiMergeJoinMeta, MySQLBulkLoaderMeta, NormaliserMeta, NullIfMeta, NumberRangeMeta, OlapInputMeta, OraBulkLoaderMeta, ParGzipCsvInputMeta, PentahoReportingOutputMeta, PGBulkLoaderMeta, PrioritizeStreamsMeta, ProcessFilesMeta, PropertyInputMeta, PropertyOutputMeta, RandomCCNumberGeneratorMeta, RandomValueMeta, RegexEvalMeta, ReplaceStringMeta, ReservoirSamplingMeta, RestMeta, RowGeneratorMeta, RowsFromResultMeta, RowsToResultMeta, RssInputMeta, RssOutputMeta, RulesMeta, SalesforceDeleteMeta, SalesforceInputMeta, SalesforceInsertMeta, SalesforceUpdateMeta, SalesforceUpsertMeta, SampleRowsMeta, SapInputMeta, SasInputMeta, ScriptMeta, ScriptValuesMetaMod, SecretKeyGeneratorMeta, SelectValuesMeta, SetValueConstantMeta, SetValueFieldMeta, SetVariableMeta, SingleThreaderMeta, SocketReaderMeta, SocketWriterMeta, SortedMergeMeta, SortRowsMeta, SplitFieldToRowsMeta, SQLFileOutputMeta, SSHMeta, StepMetastructureMeta, StepsMetricsMeta, StreamLookupMeta, StringCutMeta, StringOperationsMeta, SwitchCaseMeta, SymmetricCryptoTransMeta, SynchronizeAfterMergeMeta, SyslogMessageMeta, SystemDataMeta, TableExistsMeta, TableInputMeta, TableOutputMeta, TextFileInputMeta, TextFileOutputMeta, UniqueRowsByHashSetMeta, UniqueRowsMeta, UnivariateStatsMeta, UpdateMeta, UserDefinedJavaClassMeta, ValidatorMeta, ValueMapperMeta, WebServiceAvailableMeta, WebServiceMeta, WriteToLogMeta, XBaseInputMeta, XMLInputMeta, XMLInputSaxMeta, XMLInputStreamMeta, XMLJoinMeta, XMLOutputMeta, XsdValidatorMeta, XsltMeta, YamlInputMeta

public class BaseStepMeta
extends Object
implements Cloneable, StepAttributesInterface

This class is responsible for implementing common functionality regarding step meta, such as logging. All Kettle steps have an extension of this where private fields have been added with public accessors.

For example, the "Text File Output" step's TextFileOutputMeta class extends BaseStepMeta by adding fields for the output file name, compression, file format, etc...


Field Summary
static LoggingObjectInterface loggingObject
           
static String STEP_ATTRIBUTES_FILE
           
 
Constructor Summary
BaseStepMeta()
          Instantiates a new base step meta.
 
Method Summary
 void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info)
          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)
 Object clone()
           
 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)
          Export resources.
 KettleAttributeInterface findAttribute(String key)
           
 KettleAttributeInterface findParent(List<KettleAttributeInterface> attributes, String parentId)
           
 String getDescription(String attributeKey)
           
 String getDialogClassName()
          This returns the expected name for the dialog that edits a job entry.
 void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
          Gets the fields.
 LogChannelInterface getLog()
          Gets the log.
 String getLogChannelId()
          Gets the log channel id.
 String getName()
          Gets the name.
 String getObjectCopy()
          Gets the object copy.
 ObjectId getObjectId()
          Gets the object id.
 ObjectRevision getObjectRevision()
          Gets the object revision.
 LoggingObjectType getObjectType()
          Gets the object type.
 List<StreamInterface> getOptionalStreams()
           
 LoggingObjectInterface getParent()
          Gets the parent.
 StepMeta getParentStepMeta()
          Gets the parent step meta.
 String getRepCode(String attributeKey)
           
 RepositoryDirectory getRepositoryDirectory()
          Gets the repository directory.
 RowMetaInterface getRequiredFields()
          Deprecated.  
 RowMetaInterface getRequiredFields(VariableSpace space)
          The natural way of data flow in a transformation is source-to-target.
 List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo)
          Get a list of all the resource dependencies that the step is depending on.
 SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev)
          Standard method to return one or more SQLStatement objects that the step needs in order to work correctly.
 List<StepInjectionMetaEntry> getStepInjectionMetadataEntries(Class<?> PKG)
          Describe the metadata attributes that can be injected into this step metadata object.
 StepIOMetaInterface getStepIOMeta()
          Returns the Input/Output metadata for this step.
 StepMetaInjectionInterface getStepMetaInjectionInterface()
           
 TransMeta.TransformationType[] getSupportedTransformationTypes()
           
 RowMetaInterface getTableFields()
          Gets the table fields.
 String getTooltip(String attributeKey)
           
 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()
          Produces the XML string that describes this step's information.
 String getXmlCode(String attributeKey)
           
 void handleStreamSelection(StreamInterface stream)
          When an optional stream is selected, this method is called to handled the ETL metadata implications of that.
 boolean hasChanged()
          Checks for changed.
 boolean hasRepositoryReferences()
           
 boolean isBasic()
          Checks if is basic.
 boolean isDebug()
          Checks if is debug.
 boolean isDetailed()
          Checks if is detailed.
 boolean isRowLevel()
          Checks if is row level.
 void logBasic(String message)
          Log basic.
 void logBasic(String message, Object... arguments)
          Log basic.
 void logDebug(String message)
          Log debug.
 void logDebug(String message, Object... arguments)
          Log debug.
 void logDetailed(String message)
          Log detailed.
 void logDetailed(String message, Object... arguments)
          Log detailed.
 void logError(String message)
          Log error.
 void logError(String message, Object... arguments)
          Log error.
 void logError(String message, Throwable e)
          Log error.
 void logMinimal(String message)
          Log minimal.
 void logMinimal(String message, Object... arguments)
          Log minimal.
 void logRowlevel(String message)
          Log rowlevel.
 void logRowlevel(String message, Object... arguments)
          Log rowlevel.
 void lookupRepositoryReferences(Repository repository)
          Look up the references after import
 void resetStepIoMeta()
          Reset step io meta.
 void searchInfoAndTargetSteps(List<StepMeta> steps)
          Change step names into step objects to allow them to be name-changed etc.
 void setChanged()
          Sets the changed.
 void setChanged(boolean ch)
          Sets the changed.
 void setParentStepMeta(StepMeta parentStepMeta)
          Sets the parent step meta.
 boolean supportsErrorHandling()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggingObject

public static final LoggingObjectInterface loggingObject

STEP_ATTRIBUTES_FILE

public static final String STEP_ATTRIBUTES_FILE
See Also:
Constant Field Values
Constructor Detail

BaseStepMeta

public BaseStepMeta()
Instantiates a new base step meta.

Method Detail

clone

public Object clone()
Overrides:
clone in class Object

setChanged

public void setChanged(boolean ch)
Sets the changed.

Parameters:
ch - the new changed

setChanged

public void setChanged()
Sets the changed.


hasChanged

public boolean hasChanged()
Checks for changed.

Returns:
true, if successful

getTableFields

public RowMetaInterface getTableFields()
Gets the table fields.

Returns:
the table fields

getXML

public String getXML()
              throws KettleException
Produces the XML string that describes this step's information.

Returns:
String containing the XML describing this step.
Throws:
KettleValueException - in case there is an XML conversion or encoding error
KettleException

getFields

public void getFields(RowMetaInterface inputRowMeta,
                      String name,
                      RowMetaInterface[] info,
                      StepMeta nextStep,
                      VariableSpace space)
               throws KettleStepException
Gets the fields.

Parameters:
inputRowMeta - the input row meta
name - the name
info - the info
nextStep - the next step
space - the space
Throws:
KettleStepException - the kettle step exception

analyseImpact

public void analyseImpact(List<DatabaseImpact> impact,
                          TransMeta transMeta,
                          StepMeta stepMeta,
                          RowMetaInterface prev,
                          String[] input,
                          String[] output,
                          RowMetaInterface info)
                   throws 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.DatabaseImpact
transMeta - The transformation information
stepMeta - The step information
prev - The fields entering this step
input - The previous step names
output - The output step names
info - The fields used as information by this step
Throws:
KettleStepException

getSQLStatements

public SQLStatement getSQLStatements(TransMeta transMeta,
                                     StepMeta stepMeta,
                                     RowMetaInterface prev)
                              throws KettleStepException
Standard method to return one or more SQLStatement objects 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 transformation
stepMeta - StepMeta object containing the complete step
prev - Row containing meta-data for the input fields (no data)
Returns:
The SQL Statements for this step or null if an error occurred. If nothing has to be done, the SQLStatement.getSQL() == null.
Throws:
KettleStepException

cancelQueries

public void cancelQueries()
                   throws KettleDatabaseException
Call this to cancel trailing database queries (too long running, etc)

Throws:
KettleDatabaseException

getUsedArguments

public Map<String,String> 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.

Returns:
A row of argument values. (name and optionally a default value)

getRequiredFields

public RowMetaInterface getRequiredFields()
                                   throws KettleException
Deprecated. 

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. This default implementation returns an empty row meaning that no fields are required for this step to operate.

Returns:
the required fields for this steps meta data.
Throws:
KettleException - in case the required fields can't be determined

getRequiredFields

public RowMetaInterface getRequiredFields(VariableSpace space)
                                   throws 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. This default implementation returns an empty row meaning that no fields are required for this step to operate.

Parameters:
space - the variable space to use to do variable substitution.
Returns:
the required fields for this steps meta data.
Throws:
KettleException - in case the required fields can't be determined

getUsedDatabaseConnections

public 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

public String[] getUsedLibraries()
Returns:
the libraries that this step or plug-in uses.

supportsErrorHandling

public boolean supportsErrorHandling()
Returns:
true if this step supports error "reporting" on rows: the ability to send rows to a certain target step.

excludeFromRowLayoutVerification

public boolean excludeFromRowLayoutVerification()
This method is added to exclude certain steps from layout checking.

Since:
2.5.0

excludeFromCopyDistributeVerification

public boolean excludeFromCopyDistributeVerification()
This method is added to exclude certain steps from copy/distribute checking.

Since:
4.0.0

getResourceDependencies

public List<ResourceReference> getResourceDependencies(TransMeta transMeta,
                                                       StepMeta stepInfo)
Get a list of all the resource dependencies that the step is depending on.

Returns:
a list of all the resource dependencies that the step is depending on

exportResources

public String exportResources(VariableSpace space,
                              Map<String,ResourceDefinition> definitions,
                              ResourceNamingInterface resourceNamingInterface,
                              Repository repository)
                       throws KettleException
Export resources.

Parameters:
space - the space
definitions - the definitions
resourceNamingInterface - the resource naming interface
repository - the repository
Returns:
the string
Throws:
KettleException - the kettle exception

getDialogClassName

public String getDialogClassName()
This returns the expected name for the dialog that edits a job entry. The expected name is in the org.pentaho.di.ui tree and has a class name that is the name of the job entry with 'Dialog' added to the end. e.g. if the job entry is org.pentaho.di.job.entries.zipfile.JobEntryZipFile the dialog would be org.pentaho.di.ui.job.entries.zipfile.JobEntryZipFileDialog If the dialog class for a job entry does not match this pattern it should override this method and return the appropriate class name

Returns:
full class name of the dialog

getParentStepMeta

public StepMeta getParentStepMeta()
Gets the parent step meta.

Returns:
the parent step meta

setParentStepMeta

public void setParentStepMeta(StepMeta parentStepMeta)
Sets the parent step meta.

Parameters:
parentStepMeta - the new parent step meta

getLog

public LogChannelInterface getLog()
Gets the log.

Returns:
the log

isBasic

public boolean isBasic()
Checks if is basic.

Returns:
true, if is basic

isDetailed

public boolean isDetailed()
Checks if is detailed.

Returns:
true, if is detailed

isDebug

public boolean isDebug()
Checks if is debug.

Returns:
true, if is debug

isRowLevel

public boolean isRowLevel()
Checks if is row level.

Returns:
true, if is row level

logMinimal

public void logMinimal(String message)
Log minimal.

Parameters:
message - the message

logMinimal

public void logMinimal(String message,
                       Object... arguments)
Log minimal.

Parameters:
message - the message
arguments - the arguments

logBasic

public void logBasic(String message)
Log basic.

Parameters:
message - the message

logBasic

public void logBasic(String message,
                     Object... arguments)
Log basic.

Parameters:
message - the message
arguments - the arguments

logDetailed

public void logDetailed(String message)
Log detailed.

Parameters:
message - the message

logDetailed

public void logDetailed(String message,
                        Object... arguments)
Log detailed.

Parameters:
message - the message
arguments - the arguments

logDebug

public void logDebug(String message)
Log debug.

Parameters:
message - the message

logDebug

public void logDebug(String message,
                     Object... arguments)
Log debug.

Parameters:
message - the message
arguments - the arguments

logRowlevel

public void logRowlevel(String message)
Log rowlevel.

Parameters:
message - the message

logRowlevel

public void logRowlevel(String message,
                        Object... arguments)
Log rowlevel.

Parameters:
message - the message
arguments - the arguments

logError

public void logError(String message)
Log error.

Parameters:
message - the message

logError

public void logError(String message,
                     Throwable e)
Log error.

Parameters:
message - the message
e - the e

logError

public void logError(String message,
                     Object... arguments)
Log error.

Parameters:
message - the message
arguments - the arguments

getLogChannelId

public String getLogChannelId()
Gets the log channel id.

Returns:
the log channel id

getName

public String getName()
Gets the name.

Returns:
the name

getObjectCopy

public String getObjectCopy()
Gets the object copy.

Returns:
the object copy

getObjectId

public ObjectId getObjectId()
Gets the object id.

Returns:
the object id

getObjectRevision

public ObjectRevision getObjectRevision()
Gets the object revision.

Returns:
the object revision

getObjectType

public LoggingObjectType getObjectType()
Gets the object type.

Returns:
the object type

getParent

public LoggingObjectInterface getParent()
Gets the parent.

Returns:
the parent

getRepositoryDirectory

public RepositoryDirectory getRepositoryDirectory()
Gets the repository directory.

Returns:
the repository directory

getStepIOMeta

public StepIOMetaInterface getStepIOMeta()
Returns the Input/Output metadata for this step. By default, each step produces and accepts optional input.


getOptionalStreams

public List<StreamInterface> getOptionalStreams()
Returns:
The list of optional input streams. It allows the user to select from a list of possible actions like "New target step"

handleStreamSelection

public void handleStreamSelection(StreamInterface stream)
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

public void resetStepIoMeta()
Reset step io meta.


searchInfoAndTargetSteps

public void searchInfoAndTargetSteps(List<StepMeta> steps)
Change step names into step objects to allow them to be name-changed etc.

Parameters:
steps - the steps to reference

getStepMetaInjectionInterface

public StepMetaInjectionInterface getStepMetaInjectionInterface()
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.

getStepInjectionMetadataEntries

public List<StepInjectionMetaEntry> getStepInjectionMetadataEntries(Class<?> PKG)
Describe the metadata attributes that can be injected into this step metadata object.


findParent

public KettleAttributeInterface findParent(List<KettleAttributeInterface> attributes,
                                           String parentId)
Specified by:
findParent in interface StepAttributesInterface

findAttribute

public KettleAttributeInterface findAttribute(String key)
Specified by:
findAttribute in interface StepAttributesInterface

getXmlCode

public String getXmlCode(String attributeKey)
Specified by:
getXmlCode in interface StepAttributesInterface

getRepCode

public String getRepCode(String attributeKey)
Specified by:
getRepCode in interface StepAttributesInterface

getDescription

public String getDescription(String attributeKey)
Specified by:
getDescription in interface StepAttributesInterface

getTooltip

public String getTooltip(String attributeKey)
Specified by:
getTooltip in interface StepAttributesInterface

getSupportedTransformationTypes

public TransMeta.TransformationType[] getSupportedTransformationTypes()
Returns:
The supported transformation types that this step supports.

hasRepositoryReferences

public boolean hasRepositoryReferences()
Returns:
True if the job entry defines one or more references to a repository object.

lookupRepositoryReferences

public void lookupRepositoryReferences(Repository repository)
                                throws KettleException
Look up the references after import

Parameters:
repository - the repository to reference.
Throws:
KettleException