org.pentaho.di.trans.step
Class StepMeta

java.lang.Object
  extended by org.pentaho.di.shared.SharedObjectBase
      extended by org.pentaho.di.trans.step.StepMeta
All Implemented Interfaces:
Cloneable, Comparable<StepMeta>, CheckResultSourceInterface, GUIPositionInterface, ResourceExportInterface, ResourceHolderInterface, SharedObjectInterface

public class StepMeta
extends SharedObjectBase
implements Cloneable, Comparable<StepMeta>, GUIPositionInterface, SharedObjectInterface, CheckResultSourceInterface, ResourceExportInterface, ResourceHolderInterface

This class contains everything that is needed to define a step.

Since:
27-mei-2003
Author:
Matt

Field Summary
static String STRING_ID_ETL_META_INJECT
           
static String STRING_ID_MAPPING
           
static String STRING_ID_MAPPING_INPUT
           
static String STRING_ID_MAPPING_OUTPUT
           
static String STRING_ID_SINGLE_THREADER
           
static String XML_TAG
           
 
Constructor Summary
StepMeta()
           
StepMeta(Node stepnode, List<DatabaseMeta> databases, Map<String,Counter> counters)
          Read the step data from XML
StepMeta(ObjectId id_step)
           
StepMeta(String stepname, StepMetaInterface stepMetaInterface)
           
StepMeta(String stepid, String stepname, StepMetaInterface stepMetaInterface)
           
 
Method Summary
 void check(List<CheckResultInterface> remarks, TransMeta transMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info)
           
 boolean chosesTargetSteps()
           
 Object clone()
           
 int compareTo(StepMeta o)
           
 void drawStep()
           
 boolean equals(Object obj)
          Two steps are equal if their names are equal.
 String exportResources(VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository)
          Exports the object to a flat-file system, adding content with filename keys to a set of definitions.
static StepMeta findStep(List<StepMeta> steps, ObjectId id)
          Find a step with the ID in a given ArrayList of steps
static StepMeta findStep(List<StepMeta> steps, String stepname)
          Find a step with its name in a given ArrayList of steps
 void flipSelected()
           
 ClusterSchema getClusterSchema()
           
 int getCopies()
          Get the number of copies to start of a step.
 String getDescription()
           
 String getHolderType()
          Gets the high-level type of resource holder.
 Point getLocation()
           
 String getName()
           
 ObjectId getObjectId()
           
 TransMeta getParentTransMeta()
           
 List<RemoteStep> getRemoteInputSteps()
           
 List<RemoteStep> getRemoteOutputSteps()
           
 List<ResourceReference> getResourceDependencies(TransMeta transMeta)
          Get a list of all the resource dependencies that the step is depending on.
 StepErrorMeta getStepErrorMeta()
           
 String getStepID()
           
 StepMetaInterface getStepMetaInterface()
           
 StepPartitioningMeta getStepPartitioningMeta()
           
 StepPartitioningMeta getTargetStepPartitioningMeta()
           
 String getTypeId()
          Support for CheckResultSourceInterface
 String getXML()
           
 String getXML(boolean includeInterface)
           
 boolean hasChanged()
           
 int hashCode()
           
 boolean hasTerminator()
           
 void hideStep()
           
 boolean isClustered()
           
 boolean isDistributes()
           
 boolean isDoingErrorHandling()
           
 boolean isDrawn()
          See wether or not the step is drawn on the canvas.
 boolean isDrawStep()
          See wether or not the step is drawn on the canvas.
 boolean isEtlMetaInject()
           
 boolean isMapping()
           
 boolean isMappingInput()
           
 boolean isMappingOutput()
           
 boolean isPartitioned()
           
 boolean isRepartitioning()
           
 boolean isSelected()
           
 boolean isSendingErrorRowsToStep(StepMeta targetStep)
           
 boolean isSingleThreader()
           
 boolean isTargetPartitioned()
           
 void replaceMeta(StepMeta stepMeta)
           
 void setChanged()
           
 void setChanged(boolean ch)
           
 void setClusterSchema(ClusterSchema clusterSchema)
           
 void setClusterSchemaAfterLoading(List<ClusterSchema> clusterSchemas)
          Resolves the name of the cluster loaded from XML/Repository to the correct clusterSchema object
 void setClusterSchemaName(String clusterSchemaName)
           
 void setCopies(int c)
          Sets the number of parallel copies that this step will be launched with.
 void setDescription(String description)
           
 void setDistributes(boolean distributes)
           
 void setDraw(boolean draw)
          Sets the draw attribute of the step so that it will be drawn on the canvas.
 void setLocation(int x, int y)
           
 void setLocation(Point loc)
           
 void setName(String sname)
           
 void setObjectId(ObjectId id)
           
 void setParentTransMeta(TransMeta parentTransMeta)
           
 void setRemoteInputSteps(List<RemoteStep> remoteInputSteps)
           
 void setRemoteOutputSteps(List<RemoteStep> remoteOutputSteps)
           
 void setSelected(boolean sel)
           
 void setStepErrorMeta(StepErrorMeta stepErrorMeta)
           
 void setStepID(String stepid)
          Set the plugin step id (code)
 void setStepMetaInterface(StepMetaInterface stepMetaInterface)
           
 void setStepPartitioningMeta(StepPartitioningMeta stepPartitioningMeta)
           
 void setTargetStepPartitioningMeta(StepPartitioningMeta targetStepPartitioningMeta)
           
 void setTerminator()
           
 void setTerminator(boolean t)
           
 boolean supportsErrorHandling()
           
 String toString()
           
 
Methods inherited from class org.pentaho.di.shared.SharedObjectBase
getChangedDate, isShared, setChangedDate, setShared
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pentaho.di.shared.SharedObjectInterface
getChangedDate, isShared, setShared
 

Field Detail

XML_TAG

public static final String XML_TAG
See Also:
Constant Field Values

STRING_ID_MAPPING

public static final String STRING_ID_MAPPING
See Also:
Constant Field Values

STRING_ID_SINGLE_THREADER

public static final String STRING_ID_SINGLE_THREADER
See Also:
Constant Field Values

STRING_ID_ETL_META_INJECT

public static final String STRING_ID_ETL_META_INJECT
See Also:
Constant Field Values

STRING_ID_MAPPING_INPUT

public static final String STRING_ID_MAPPING_INPUT
See Also:
Constant Field Values

STRING_ID_MAPPING_OUTPUT

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

StepMeta

public StepMeta(String stepid,
                String stepname,
                StepMetaInterface stepMetaInterface)
Parameters:
stepid - The ID of the step: this is derived information, you can also use the constructor without stepid. This constructor will be deprecated soon.
stepname - The name of the new step
stepMetaInterface - The step metadata interface to use (TextFileInputMeta, etc)

StepMeta

public StepMeta(String stepname,
                StepMetaInterface stepMetaInterface)
Parameters:
stepname - The name of the new step
stepMetaInterface - The step metadata interface to use (TextFileInputMeta, etc)

StepMeta

public StepMeta()

StepMeta

public StepMeta(Node stepnode,
                List<DatabaseMeta> databases,
                Map<String,Counter> counters)
         throws KettleXMLException
Read the step data from XML

Parameters:
stepnode - The XML step node.
databases - A list of databases
counters - A map with all defined counters.
Throws:
KettleXMLException

StepMeta

public StepMeta(ObjectId id_step)
Method Detail

getXML

public String getXML()
              throws KettleException
Specified by:
getXML in interface SharedObjectInterface
Throws:
KettleException

getXML

public String getXML(boolean includeInterface)
              throws KettleException
Throws:
KettleException

setClusterSchemaAfterLoading

public void setClusterSchemaAfterLoading(List<ClusterSchema> clusterSchemas)
Resolves the name of the cluster loaded from XML/Repository to the correct clusterSchema object

Parameters:
clusterSchemas - The list of clusterSchemas to reference.

getObjectId

public ObjectId getObjectId()
Specified by:
getObjectId in interface CheckResultSourceInterface
Specified by:
getObjectId in interface ResourceHolderInterface
Returns:
The ID of the source generating the CheckResult

setObjectId

public void setObjectId(ObjectId id)

isDrawn

public boolean isDrawn()
See wether or not the step is drawn on the canvas.

Returns:
True if the step is drawn on the canvas.

isDrawStep

public boolean isDrawStep()
See wether or not the step is drawn on the canvas. Same as isDrawn(), but needed for findMethod(StepMeta, drawstep) called by StringSearcher.findMetaData(). Otherwise findMethod() returns org.pentaho.di.trans.step.StepMeta.drawStep() instead of isDrawn().

Returns:
True if the step is drawn on the canvas.

setDraw

public void setDraw(boolean draw)
Sets the draw attribute of the step so that it will be drawn on the canvas.

Parameters:
draw - True if you want the step to show itself on the canvas, False if you don't.

setCopies

public void setCopies(int c)
Sets the number of parallel copies that this step will be launched with.

Parameters:
c - The number of copies.

getCopies

public int getCopies()
Get the number of copies to start of a step. This takes into account the partitioning logic.

Returns:
the number of step copies to start.

drawStep

public void drawStep()

hideStep

public void hideStep()

equals

public boolean equals(Object obj)
Two steps are equal if their names are equal.

Overrides:
equals in class Object
Returns:
true if the two steps are equal.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(StepMeta o)
Specified by:
compareTo in interface Comparable<StepMeta>

hasChanged

public boolean hasChanged()

setChanged

public void setChanged(boolean ch)

setChanged

public void setChanged()

chosesTargetSteps

public boolean chosesTargetSteps()

clone

public Object clone()
Overrides:
clone in class Object

replaceMeta

public void replaceMeta(StepMeta stepMeta)

getStepMetaInterface

public StepMetaInterface getStepMetaInterface()

setStepMetaInterface

public void setStepMetaInterface(StepMetaInterface stepMetaInterface)

getStepID

public String getStepID()

getName

public String getName()
Specified by:
getName in interface CheckResultSourceInterface
Specified by:
getName in interface ResourceHolderInterface
Specified by:
getName in interface SharedObjectInterface
Returns:
The name of the source generating the CheckResult

setName

public void setName(String sname)

getDescription

public String getDescription()
Specified by:
getDescription in interface CheckResultSourceInterface
Specified by:
getDescription in interface ResourceHolderInterface
Returns:
The description of the source generating the CheckResult

setDescription

public void setDescription(String description)

setSelected

public void setSelected(boolean sel)
Specified by:
setSelected in interface GUIPositionInterface

flipSelected

public void flipSelected()

isSelected

public boolean isSelected()
Specified by:
isSelected in interface GUIPositionInterface

setTerminator

public void setTerminator()

setTerminator

public void setTerminator(boolean t)

hasTerminator

public boolean hasTerminator()

setLocation

public void setLocation(int x,
                        int y)
Specified by:
setLocation in interface GUIPositionInterface

setLocation

public void setLocation(Point loc)
Specified by:
setLocation in interface GUIPositionInterface

getLocation

public Point getLocation()
Specified by:
getLocation in interface GUIPositionInterface

check

public void check(List<CheckResultInterface> remarks,
                  TransMeta transMeta,
                  RowMetaInterface prev,
                  String[] input,
                  String[] output,
                  RowMetaInterface info)

toString

public String toString()
Overrides:
toString in class Object

isPartitioned

public boolean isPartitioned()
Returns:
true is the step is partitioned

isTargetPartitioned

public boolean isTargetPartitioned()
Returns:
true is the step is partitioned

getStepPartitioningMeta

public StepPartitioningMeta getStepPartitioningMeta()
Returns:
the stepPartitioningMeta

setStepPartitioningMeta

public void setStepPartitioningMeta(StepPartitioningMeta stepPartitioningMeta)
Parameters:
stepPartitioningMeta - the stepPartitioningMeta to set

getClusterSchema

public ClusterSchema getClusterSchema()
Returns:
the clusterSchema

setClusterSchema

public void setClusterSchema(ClusterSchema clusterSchema)
Parameters:
clusterSchema - the clusterSchema to set

isDistributes

public boolean isDistributes()
Returns:
the distributes

setDistributes

public void setDistributes(boolean distributes)
Parameters:
distributes - the distributes to set

getStepErrorMeta

public StepErrorMeta getStepErrorMeta()
Returns:
the StepErrorMeta error handling metadata for this step

setStepErrorMeta

public void setStepErrorMeta(StepErrorMeta stepErrorMeta)
Parameters:
stepErrorMeta - the error handling metadata for this step

findStep

public static final StepMeta findStep(List<StepMeta> steps,
                                      ObjectId id)
Find a step with the ID in a given ArrayList of steps

Parameters:
steps - The List of steps to search
id - The ID of the step
Returns:
The step if it was found, null if nothing was found

findStep

public static final StepMeta findStep(List<StepMeta> steps,
                                      String stepname)
Find a step with its name in a given ArrayList of steps

Parameters:
steps - The List of steps to search
stepname - The name of the step
Returns:
The step if it was found, null if nothing was found

supportsErrorHandling

public boolean supportsErrorHandling()

isDoingErrorHandling

public boolean isDoingErrorHandling()
Returns:
if error handling is supported for this step, if error handling is defined and a target step is set

isSendingErrorRowsToStep

public boolean isSendingErrorRowsToStep(StepMeta targetStep)

getTypeId

public String getTypeId()
Support for CheckResultSourceInterface

Specified by:
getTypeId in interface CheckResultSourceInterface
Specified by:
getTypeId in interface ResourceHolderInterface
Returns:
The Type ID of the source generating the CheckResult. The Type ID is the system-defined type identifier (like TRANS or SORT).

isMapping

public boolean isMapping()

isSingleThreader

public boolean isSingleThreader()

isEtlMetaInject

public boolean isEtlMetaInject()

isMappingInput

public boolean isMappingInput()

isMappingOutput

public boolean isMappingOutput()

getResourceDependencies

public List<ResourceReference> getResourceDependencies(TransMeta transMeta)
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
Description copied from interface: ResourceExportInterface
Exports the object to a flat-file system, adding content with filename keys to a set of definitions. The supplied resource naming interface allows the object to name appropriately without worrying about those parts of the implementation specific details.

Specified by:
exportResources in interface ResourceExportInterface
Parameters:
space - The variable space to resolve (environment) variables with.
definitions - The map containing the filenames and content
resourceNamingInterface - The resource naming interface allows the object to name appropriately
repository - the repository object to load from
Returns:
The filename for this object. (also contained in the definitions map)
Throws:
KettleException - in case something goes wrong during the export

getRemoteInputSteps

public List<RemoteStep> getRemoteInputSteps()
Returns:
the remoteInputSteps

setRemoteInputSteps

public void setRemoteInputSteps(List<RemoteStep> remoteInputSteps)
Parameters:
remoteInputSteps - the remoteInputSteps to set

getRemoteOutputSteps

public List<RemoteStep> getRemoteOutputSteps()
Returns:
the remoteOutputSteps

setRemoteOutputSteps

public void setRemoteOutputSteps(List<RemoteStep> remoteOutputSteps)
Parameters:
remoteOutputSteps - the remoteOutputSteps to set

getTargetStepPartitioningMeta

public StepPartitioningMeta getTargetStepPartitioningMeta()
Returns:
the targetStepPartitioningMeta

setTargetStepPartitioningMeta

public void setTargetStepPartitioningMeta(StepPartitioningMeta targetStepPartitioningMeta)
Parameters:
targetStepPartitioningMeta - the targetStepPartitioningMeta to set

isRepartitioning

public boolean isRepartitioning()

getHolderType

public String getHolderType()
Description copied from interface: ResourceHolderInterface
Gets the high-level type of resource holder.

Specified by:
getHolderType in interface ResourceHolderInterface
Returns:
JOBENTRY, STEP, etc.

isClustered

public boolean isClustered()

setStepID

public void setStepID(String stepid)
Set the plugin step id (code)

Parameters:
stepid -

setClusterSchemaName

public void setClusterSchemaName(String clusterSchemaName)

setParentTransMeta

public void setParentTransMeta(TransMeta parentTransMeta)

getParentTransMeta

public TransMeta getParentTransMeta()