Package org.pentaho.di.trans.step
Class StepMeta
- java.lang.Object
-
- org.pentaho.di.shared.SharedObjectBase
-
- org.pentaho.di.trans.step.StepMeta
-
- All Implemented Interfaces:
Cloneable,Comparable<StepMeta>,BaseMeta,org.pentaho.di.core.AttributesInterface,org.pentaho.di.core.CheckResultSourceInterface,org.pentaho.di.core.gui.GUIPositionInterface,ResourceExportInterface,ResourceHolderInterface,org.pentaho.di.shared.SharedObjectInterface
public class StepMeta extends org.pentaho.di.shared.SharedObjectBase implements Cloneable, Comparable<StepMeta>, org.pentaho.di.core.gui.GUIPositionInterface, org.pentaho.di.shared.SharedObjectInterface, org.pentaho.di.core.CheckResultSourceInterface, ResourceExportInterface, ResourceHolderInterface, org.pentaho.di.core.AttributesInterface, BaseMeta
This class contains everything that is needed to define a step.- Since:
- 27-mei-2003
- Author:
- Matt
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Map<String,String>>attributesMapstatic StringSTRING_ID_ETL_META_INJECTstatic StringSTRING_ID_JOB_EXECUTORstatic StringSTRING_ID_MAPPINGstatic StringSTRING_ID_MAPPING_INPUTstatic StringSTRING_ID_MAPPING_OUTPUTstatic StringSTRING_ID_SINGLE_THREADERstatic StringXML_TAG
-
Constructor Summary
Constructors Constructor Description StepMeta()StepMeta(String stepid, String stepname, StepMetaInterface stepMetaInterface)StepMeta(String stepname, StepMetaInterface stepMetaInterface)StepMeta(org.pentaho.di.repository.ObjectId id_step)StepMeta(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters)Deprecated.StepMeta(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, org.pentaho.metastore.api.IMetaStore metaStore)Read the step data from XML
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcheck(List<org.pentaho.di.core.CheckResultInterface> remarks, TransMeta transMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info)voidcheck(List<org.pentaho.di.core.CheckResultInterface> remarks, TransMeta transMeta, 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)booleanchosesTargetSteps()Objectclone()intcompareTo(StepMeta o)voiddrawStep()booleanequals(Object obj)Two steps are equal if their names are equal.StringexportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository)StringexportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore)Exports the object to a flat-file system, adding content with filename keys to a set of definitions.static StepMetafindStep(List<StepMeta> steps, String stepname)Find a step with its name in a given ArrayList of stepsstatic StepMetafindStep(List<StepMeta> steps, org.pentaho.di.repository.ObjectId id)Find a step with the ID in a given ArrayList of stepsvoidflipSelected()static StepMetafromXml(String metaXml)StringgetAttribute(String groupName, String key)Map<String,String>getAttributes(String groupName)Map<String,Map<String,String>>getAttributesMap()ClusterSchemagetClusterSchema()intgetCopies()Get the number of copies to start of a step.StringgetCopiesString()StringgetDescription()StringgetHolderType()Gets the high-level type of resource holder.org.pentaho.di.core.gui.PointgetLocation()StringgetName()org.pentaho.di.repository.ObjectIdgetObjectId()TransMetagetParentTransMeta()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.RowDistributionInterfacegetRowDistribution()StepErrorMetagetStepErrorMeta()StringgetStepID()StepMetaInterfacegetStepMetaInterface()StepPartitioningMetagetStepPartitioningMeta()StringgetSuggestion()StepPartitioningMetagetTargetStepPartitioningMeta()StringgetTypeId()Support for CheckResultSourceInterfaceStringgetXML()StringgetXML(boolean includeInterface)booleanhasChanged()inthashCode()booleanhasTerminator()voidhideStep()booleanisClustered()booleanisDeprecated()booleanisDistributes()booleanisDoingErrorHandling()booleanisDrawn()See wether or not the step is drawn on the canvas.booleanisDrawStep()See wether or not the step is drawn on the canvas.booleanisEtlMetaInject()booleanisJobExecutor()booleanisMapping()booleanisMappingInput()booleanisMappingOutput()booleanisMissing()booleanisPartitioned()booleanisRepartitioning()booleanisSelected()booleanisSendingErrorRowsToStep(StepMeta targetStep)booleanisSingleThreader()booleanisTargetPartitioned()voidreplaceMeta(StepMeta stepMeta)voidsetAttribute(String groupName, String key, String value)voidsetAttributes(String groupName, Map<String,String> attributes)voidsetAttributesMap(Map<String,Map<String,String>> attributesMap)voidsetChanged()voidsetChanged(boolean ch)voidsetClusterSchema(ClusterSchema clusterSchema)voidsetClusterSchemaAfterLoading(List<ClusterSchema> clusterSchemas)Resolves the name of the cluster loaded from XML/Repository to the correct clusterSchema objectvoidsetClusterSchemaName(String clusterSchemaName)voidsetCopies(int c)Sets the number of parallel copies that this step will be launched with.voidsetCopiesString(String copiesString)voidsetDescription(String description)voidsetDistributes(boolean distributes)voidsetDraw(boolean draw)Sets the draw attribute of the step so that it will be drawn on the canvas.voidsetLocation(int x, int y)voidsetLocation(org.pentaho.di.core.gui.Point loc)voidsetName(String sname)voidsetObjectId(org.pentaho.di.repository.ObjectId id)voidsetParentTransMeta(TransMeta parentTransMeta)voidsetRemoteInputSteps(List<RemoteStep> remoteInputSteps)voidsetRemoteOutputSteps(List<RemoteStep> remoteOutputSteps)voidsetRowDistribution(RowDistributionInterface rowDistribution)voidsetSelected(boolean sel)voidsetStepErrorMeta(StepErrorMeta stepErrorMeta)voidsetStepID(String stepid)Set the plugin step id (code)voidsetStepMetaInterface(StepMetaInterface stepMetaInterface)voidsetStepPartitioningMeta(StepPartitioningMeta stepPartitioningMeta)voidsetTargetStepPartitioningMeta(StepPartitioningMeta targetStepPartitioningMeta)voidsetTerminator()voidsetTerminator(boolean t)booleansupportsErrorHandling()StringtoString()-
Methods inherited from class org.pentaho.di.shared.SharedObjectBase
getChangedDate, isShared, setChangedDate, 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_JOB_EXECUTOR
public static final String STRING_ID_JOB_EXECUTOR
- 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 stepstepMetaInterface- The step metadata interface to use (TextFileInputMeta, etc)
-
StepMeta
public StepMeta(String stepname, StepMetaInterface stepMetaInterface)
- Parameters:
stepname- The name of the new stepstepMetaInterface- The step metadata interface to use (TextFileInputMeta, etc)
-
StepMeta
public StepMeta()
-
StepMeta
@Deprecated public StepMeta(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters) throws org.pentaho.di.core.exception.KettleXMLException, org.pentaho.di.core.exception.KettlePluginLoaderException
Deprecated.Read the step data from XML- Parameters:
stepnode- The XML step node.databases- A list of databasescounters- A map with all defined counters.- Throws:
org.pentaho.di.core.exception.KettleXMLExceptionorg.pentaho.di.core.exception.KettlePluginLoaderException
-
StepMeta
public StepMeta(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleXMLException, org.pentaho.di.core.exception.KettlePluginLoaderException
Read the step data from XML- Parameters:
stepnode- The XML step node.databases- A list of databasesmetaStore- The IMetaStore.- Throws:
org.pentaho.di.core.exception.KettleXMLExceptionorg.pentaho.di.core.exception.KettlePluginLoaderException
-
StepMeta
public StepMeta(org.pentaho.di.repository.ObjectId id_step)
-
-
Method Detail
-
getXML
public String getXML() throws org.pentaho.di.core.exception.KettleException
- Specified by:
getXMLin interfaceorg.pentaho.di.shared.SharedObjectInterface- Throws:
org.pentaho.di.core.exception.KettleException
-
getXML
public String getXML(boolean includeInterface) throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.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 org.pentaho.di.repository.ObjectId getObjectId()
- Specified by:
getObjectIdin interfaceorg.pentaho.di.core.CheckResultSourceInterface- Specified by:
getObjectIdin interfaceResourceHolderInterface- Returns:
- The ID of the holder of the resource
-
setObjectId
public void setObjectId(org.pentaho.di.repository.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.
-
compareTo
public int compareTo(StepMeta o)
- Specified by:
compareToin interfaceComparable<StepMeta>
-
hasChanged
public boolean hasChanged()
-
setChanged
public void setChanged(boolean ch)
-
setChanged
public void setChanged()
-
chosesTargetSteps
public boolean chosesTargetSteps()
-
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:
getNamein interfaceorg.pentaho.di.core.CheckResultSourceInterface- Specified by:
getNamein interfaceResourceHolderInterface- Specified by:
getNamein interfaceorg.pentaho.di.shared.SharedObjectInterface- Returns:
- The name of the holder of the resource
-
setName
public void setName(String sname)
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceorg.pentaho.di.core.CheckResultSourceInterface- Specified by:
getDescriptionin interfaceResourceHolderInterface- Returns:
- The description of the holder of the resource
-
setDescription
public void setDescription(String description)
-
setSelected
public void setSelected(boolean sel)
- Specified by:
setSelectedin interfaceorg.pentaho.di.core.gui.GUIPositionInterface
-
flipSelected
public void flipSelected()
-
isSelected
public boolean isSelected()
- Specified by:
isSelectedin interfaceorg.pentaho.di.core.gui.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:
setLocationin interfaceorg.pentaho.di.core.gui.GUIPositionInterface
-
setLocation
public void setLocation(org.pentaho.di.core.gui.Point loc)
- Specified by:
setLocationin interfaceorg.pentaho.di.core.gui.GUIPositionInterface
-
getLocation
public org.pentaho.di.core.gui.Point getLocation()
- Specified by:
getLocationin interfaceBaseMeta- Specified by:
getLocationin interfaceorg.pentaho.di.core.gui.GUIPositionInterface
-
check
@Deprecated public void check(List<org.pentaho.di.core.CheckResultInterface> remarks, TransMeta transMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info)
Deprecated.- Parameters:
remarks-transMeta-prev-input-output-info-
-
check
public void check(List<org.pentaho.di.core.CheckResultInterface> remarks, TransMeta transMeta, 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)
-
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, org.pentaho.di.repository.ObjectId id)
Find a step with the ID in a given ArrayList of steps- Parameters:
steps- The List of steps to searchid- 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 searchstepname- 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:
getTypeIdin interfaceorg.pentaho.di.core.CheckResultSourceInterface- Specified by:
getTypeIdin interfaceResourceHolderInterface- Returns:
- The Type ID of the resource holder. 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()
-
isJobExecutor
public boolean isJobExecutor()
-
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
@Deprecated public String exportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws org.pentaho.di.core.exception.KettleException
Deprecated.- Parameters:
space-definitions-resourceNamingInterface-repository-- Returns:
- Throws:
org.pentaho.di.core.exception.KettleException
-
exportResources
public 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
Description copied from interface:ResourceExportInterfaceExports 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:
exportResourcesin interfaceResourceExportInterface- Parameters:
space- The variable space to resolve (environment) variables with.definitions- The map containing the filenames and contentresourceNamingInterface- The resource naming interface allows the object to name appropriatelyrepository- the repository object to load frommetaStore- the central metastore to load non-kettle specific metadata from- Returns:
- The filename for this object. (also contained in the definitions map)
- Throws:
org.pentaho.di.core.exception.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:ResourceHolderInterfaceGets the high-level type of resource holder.- Specified by:
getHolderTypein interfaceResourceHolderInterface- 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()
-
getRowDistribution
public RowDistributionInterface getRowDistribution()
-
setRowDistribution
public void setRowDistribution(RowDistributionInterface rowDistribution)
-
getCopiesString
public String getCopiesString()
- Returns:
- the copiesString
-
setCopiesString
public void setCopiesString(String copiesString)
- Parameters:
copiesString- the copiesString to set
-
setAttributesMap
public void setAttributesMap(Map<String,Map<String,String>> attributesMap)
- Specified by:
setAttributesMapin interfaceorg.pentaho.di.core.AttributesInterface
-
getAttributesMap
public Map<String,Map<String,String>> getAttributesMap()
- Specified by:
getAttributesMapin interfaceorg.pentaho.di.core.AttributesInterface
-
setAttribute
public void setAttribute(String groupName, String key, String value)
- Specified by:
setAttributein interfaceorg.pentaho.di.core.AttributesInterface
-
setAttributes
public void setAttributes(String groupName, Map<String,String> attributes)
- Specified by:
setAttributesin interfaceorg.pentaho.di.core.AttributesInterface
-
getAttributes
public Map<String,String> getAttributes(String groupName)
- Specified by:
getAttributesin interfaceorg.pentaho.di.core.AttributesInterface
-
getAttribute
public String getAttribute(String groupName, String key)
- Specified by:
getAttributein interfaceorg.pentaho.di.core.AttributesInterface
-
isMissing
public boolean isMissing()
-
isDeprecated
public boolean isDeprecated()
-
getSuggestion
public String getSuggestion()
-
-