org.pentaho.di.trans
Class TransMeta

java.lang.Object
  extended by org.pentaho.di.core.changed.ChangedFlag
      extended by org.pentaho.di.trans.TransMeta
All Implemented Interfaces:
Cloneable, Comparable<TransMeta>, Comparator<TransMeta>, ChangedFlagInterface, EngineMetaInterface, UndoInterface, LoggingObjectInterface, NamedParams, VariableSpace, XMLInterface, RepositoryElementInterface, RepositoryObjectInterface, ResourceExportInterface, HasDatabasesInterface, HasSlaveServersInterface

public class TransMeta
extends ChangedFlag
implements XMLInterface, Comparator<TransMeta>, Comparable<TransMeta>, Cloneable, UndoInterface, HasDatabasesInterface, VariableSpace, EngineMetaInterface, ResourceExportInterface, HasSlaveServersInterface, NamedParams, RepositoryElementInterface, LoggingObjectInterface

This class defines information about a transformation and offers methods to save and load it from XML or a PDI database repository, as well as methods to alter a transformation by adding/removing databases, steps, hops, etc.

Since:
20-jun-2003
Author:
Matt Casters

Nested Class Summary
static class TransMeta.TransformationType
          The TransformationType enum describes the various types of transformations in terms of execution, including Normal, Serial Single-Threaded, and Single-Threaded.
 
Field Summary
static String[] desc_type_undo
          A list of localized strings corresponding to string descriptions of the undo/redo actions.
static RepositoryObjectType REPOSITORY_ELEMENT_TYPE
          A constant specifying the repository element type as a Transformation.
static String STRING_TRANSMETA
          A constant used by the logging operations to indicate any logged messages are related to transformation meta-data.
static int TYPE_UNDO_CHANGE
          A constant indicating a Change action, used in "undo/redo" operations.
static int TYPE_UNDO_DELETE
          A constant indicating a Delete action, used in "undo/redo" operations.
static int TYPE_UNDO_NEW
          A constant indicating a New action, used in "undo/redo" operations.
static int TYPE_UNDO_POSITION
          A constant indicating a Position Change action, used in "undo/redo" operations.
static String XML_TAG
          A constant specifying the tag value for the XML node of the transformation.
static String XML_TAG_CLUSTERSCHEMAS
          A constant specifying the tag value for the XML node of the cluster schemas.
static String XML_TAG_NOTEPADS
          A constant specifying the tag value for the XML node of the notes.
static String XML_TAG_PARAMETERS
          A constant specifying the tag value for the XML node of the transformation parameters.
static String XML_TAG_PARTITIONSCHEMAS
          A constant specifying the tag value for the XML node of the transformation's partition schemas.
static String XML_TAG_SLAVESERVERS
          A constant specifying the tag value for the XML node of the slave servers.
 
Constructor Summary
TransMeta()
          Builds a new empty transformation.
TransMeta(InputStream xmlStream, Repository rep, boolean setInternalVariables, VariableSpace parentVariableSpace, OverwritePrompter prompter)
          Instantiates a new transformation meta-data object.
TransMeta(Node transnode, Repository rep)
          Parse a file containing the XML that describes the transformation.
TransMeta(String fname)
          Parses a file containing the XML that describes the transformation.
TransMeta(String fname, boolean setInternalVariables)
          Parses a file containing the XML that describes the transformation.
TransMeta(String fname, Repository rep)
          Parses a file containing the XML that describes the transformation.
TransMeta(String fname, Repository rep, boolean setInternalVariables)
          Parses a file containing the XML that describes the transformation.
TransMeta(String fname, Repository rep, boolean setInternalVariables, VariableSpace parentVariableSpace)
          Parses a file containing the XML that describes the transformation.
TransMeta(String fname, Repository rep, boolean setInternalVariables, VariableSpace parentVariableSpace, OverwritePrompter prompter)
          Parses a file containing the XML that describes the transformation.
TransMeta(String filename, String name, String[] arguments)
          Constructs a new transformation specifying the filename, name and arguments.
TransMeta(String fname, VariableSpace parentVariableSpace)
          Parses a file containing the XML that describes the transformation.
TransMeta(VariableSpace parent)
          Builds a new empty transformation with a set of variables to inherit from.
 
Method Summary
 void activateParameters()
          Activates the parameters.
 void addDatabase(DatabaseMeta databaseMeta)
          Adds the specified database (via database meta-data) to the list of associated databases for the transformation.
 void addDatabase(int p, DatabaseMeta ci)
          Adds a database association to the transformation at the given index
 void addDependency(int p, TransDependency td)
          Add a new dependency to the transformation on a certain location (i.e.
 void addDependency(TransDependency td)
          Add a new dependency to the transformation.
 void addFilenameChangedListener(FilenameChangedListener listener)
          Adds a listener for "filename changed" events.
 void addNameChangedListener(NameChangedListener listener)
          Adds a listener for "name changed" events.
 void addNote(int p, NotePadMeta ni)
          Add a new note to the transformation on a certain location (i.e.
 void addNote(NotePadMeta ni)
          Add a new note to the transformation.
 void addOrReplaceClusterSchema(ClusterSchema clusterSchema)
          Add a new cluster schema to the transformation if that didn't exist yet.
 void addOrReplaceDatabase(DatabaseMeta databaseMeta)
          Adds the specified database (via database meta-data) to the list of associated databases for the transformation, or replaces the database if it already exists in the list
 void addOrReplacePartitionSchema(PartitionSchema partitionSchema)
          Add a new partition schema to the transformation if that didn't exist yet.
 void addOrReplaceSlaveServer(SlaveServer slaveServer)
          Add a new slave server to the transformation if that didn't exist yet.
 void addOrReplaceStep(StepMeta stepMeta)
          Add a new step to the transformation if that step didn't exist yet.
 void addParameterDefinition(String key, String defaultValue, String description)
          Adds the parameter definition.
 void addStep(int p, StepMeta stepMeta)
          Add a new step to the transformation at the specified index.
 void addStep(StepMeta stepMeta)
          Add a new step to the transformation.
 void addTransHop(int p, TransHopMeta hi)
          Add a new hop to the transformation on a certain location (i.e.
 void addTransHop(TransHopMeta hi)
          Add a new hop to the transformation.
 void addUndo(Object[] from, Object[] to, int[] pos, Point[] prev, Point[] curr, int type_of_change, boolean nextAlso)
          Adds an undo operation to the undo list.
 void analyseImpact(List<DatabaseImpact> impact, ProgressMonitorListener monitor)
          Determines the impact of the different steps in a transformation on databases, tables and field.
 void cancelQueries()
          Cancels queries opened for checking & fieldprediction.
 boolean canSave()
          Checks whether the transformation can be saved.
 void checkRowMixingStatically(StepMeta stepMeta, ProgressMonitorListener monitor)
          Check a step to see if there are no multiple steps to read from.
 void checkSteps(List<CheckResultInterface> remarks, boolean only_selected, ProgressMonitorListener monitor)
          Checks all the steps and fills a List of (CheckResult) remarks.
 void clear()
          Clears the transformation's meta-data, including the lists of databases, steps, hops, notes, dependencies, partition schemas, slave servers, and cluster schemas.
 void clearCaches()
          Clears the step fields and loop caches.
 void clearChanged()
          Clears the different changed flags of the transformation.
 void clearChangedDatabases()
          Clears the flags for whether the transformation's databases have changed.
 void clearParameters()
          Clears the parameters' values.
 void clearUndo()
          Clears the list of undo actions.
 Object clone()
          Clones the transformation meta-data object.
 int compare(TransMeta t1, TransMeta t2)
          Compares two transformation on name, filename, repository directory, etc.
 int compareTo(TransMeta o)
          Compares this transformation's meta-data to the specified transformation's meta-data.
 void copyParametersFrom(NamedParams params)
          Copy parameters from the specified parameters.
 void copyVariablesFrom(VariableSpace space)
          Copies variables from the specified variable space into this transformation's variable space.
 String environmentSubstitute(String aString)
          Resolves the given string against environment variables by performing substitution.
 String[] environmentSubstitute(String[] aString)
          Resolves the given strings against environment variables by performing substitution.
 boolean equals(Object obj)
          Checks whether this transformation's meta-data object is equal to the specified object.
 void eraseParameters()
          Erases all parameters (both name and value)
 String exportResources(VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository)
          Exports the specified objects to a flat-file system, adding content with filename keys to a set of definitions.
 ClusterSchema findClusterSchema(String name)
          Find a clustering schema using its name.
 DatabaseMeta findDatabase(String name)
          Find a database (associated with the transformation) by name
 ClusterSchema findFirstUsedClusterSchema()
          Finds the first used cluster schema.
 StepMeta findMappingInputStep(String stepname)
          Finds the mapping input step with the specified name.
 StepMeta findMappingOutputStep(String stepname)
          Finds the mapping output step with the specified name.
 StepMeta findNextStep(StepMeta stepMeta, int nr)
          Deprecated. just get the next steps as an array
 List<StepMeta> findNextSteps(StepMeta stepMeta)
          Retrieve a list of succeeding steps for a certain originating step.
 int findNrInfoSteps(StepMeta stepMeta)
          Find the the number of informational steps for a certain step.
 int findNrNextSteps(StepMeta stepMeta)
          Deprecated. just get the next steps as an array
 int findNrPrevSteps(StepMeta stepMeta)
          Find the number of steps that precede the indicated step.
 int findNrPrevSteps(StepMeta stepMeta, boolean info)
          Deprecated. please use method findPreviousSteps
 int findNrPrevSteps(String stepname)
          Deprecated.  
 int findNrPrevSteps(String stepname, boolean info)
          Deprecated.  
 PartitionSchema findPartitionSchema(String name)
          Find a partition schema using its name.
 boolean findPrevious(StepMeta startStep, StepMeta stepToFind)
          Looks in the transformation to find a step in a previous location starting somewhere.
 List<StepMeta> findPreviousSteps(StepMeta stepMeta)
          Get the list of previous steps for a certain reference step.
 List<StepMeta> findPreviousSteps(StepMeta stepMeta, boolean info)
          Get the previous steps on a certain location taking into account the steps being informational or not.
 StepMeta findPrevStep(StepMeta stepMeta, int nr)
          Find the previous step on a certain location (i.e.
 StepMeta findPrevStep(StepMeta stepMeta, int nr, boolean info)
          Deprecated. please use method findPreviousSteps
 StepMeta findPrevStep(String stepname, int nr)
          Deprecated.  
 StepMeta findPrevStep(String stepname, int nr, boolean info)
          Deprecated.  
 SlaveServer findSlaveServer(String serverString)
          Find a slave server with the given name.
 StepMeta findStep(String name)
          Searches the list of steps for a step with a certain name.
 StepMeta findStep(String name, StepMeta exclude)
          Searches the list of steps for a step with a certain name while excluding one step.
 TransHopMeta findTransHop(StepMeta from, StepMeta to)
          Search all hops for a hop where a certain step is at the start and another is at the end.
 TransHopMeta findTransHop(StepMeta from, StepMeta to, boolean disabledToo)
          Search all hops for a hop where a certain step is at the start and another is at the end.
 TransHopMeta findTransHop(String name)
          Searches the list of hops for a hop with a certain name.
 TransHopMeta findTransHop(TransHopMeta hi)
          Find a certain hop in the transformation.
 TransHopMeta findTransHopFrom(StepMeta fromstep)
          Search all hops for a hop where a certain step is at the start.
 TransHopMeta findTransHopTo(StepMeta tostep)
          Search all hops for a hop where a certain step is at the end.
 String getAlternativeStepname(String stepname)
          Proposes an alternative stepname when the original already exists.
 String[] getArguments()
          Gets the arguments used for this transformation.
 boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
          Returns a boolean representation of the specified variable after performing any necessary substitution.
 ChannelLogTable getChannelLogTable()
          Gets the channel log table for the transformation.
 String[] getClusterSchemaNames()
          Gets the cluster schema names.
 List<ClusterSchema> getClusterSchemas()
          Gets a list of the cluster schemas used by the transformation.
 String getContainerObjectId()
          Gets the container object ID.
 Hashtable<String,Counter> getCounters()
          Gets the counters (database sequence values, e.g.) for the transformation.
 Date getCreatedDate()
          Gets the date the transformation was created.
 String getCreatedUser()
          Gets the user by whom the transformation was created.
 DatabaseMeta getDatabase(int i)
          Gets the database at the specified index.
 String[] getDatabaseNames()
          Gets the database names.
 List<DatabaseMeta> getDatabases()
          Gets the list of databases associated with the transformation.
 DBCache getDbCache()
          Gets the database cache object.
 String getDefaultExtension()
          Gets the default extension for a transformation.
 List<TransDependency> getDependencies()
          Gets a list of dependencies for the transformation
 TransDependency getDependency(int i)
          Retrieves a dependency on a certain location (i.e.
 String getDescription()
          Gets the description of the transformation.
 String getExtendedDescription()
          Gets the extended description of the transformation.
 int getFeedbackSize()
          Gets the feedback size.
 String getFilename()
          Get the filename (if any) of the transformation.
 String getFileType()
          Gets the file type.
 String[] getFilterExtensions()
          Gets the transformation filter extensions.
 String[] getFilterNames()
          Gets the transformation filter names.
 StepMeta[] getInfoStep(StepMeta stepMeta)
          Get the informational steps for a certain step.
 LogChannelInterface getLogChannel()
          Gets the log channel.
 String getLogChannelId()
          Gets the log channel ID.
 LogLevel getLogLevel()
          Gets the log level for the transformation.
 List<LogTableInterface> getLogTables()
          Gets a list of the log tables (transformation, step, performance, channel) for the transformation.
 DatabaseMeta getMaxDateConnection()
          Gets the database connection associated with "max date" processing.
 double getMaxDateDifference()
          Gets the maximum date difference between start and end dates for row/record processing.
 String getMaxDateField()
          Gets the date field associated with "max date" processing.
 double getMaxDateOffset()
          Gets the amount by which to increase the "max date" difference.
 String getMaxDateTable()
          Gets the database table providing a date to be used in "max date" processing.
 Point getMaximum()
          Gets the maximum size of the canvas by calculating the maximum location of a step.
 int getMaxUndo()
          Gets the maximum number of undo operations possible.
 Point getMinimum()
          Gets the minimum point on the canvas of a transformation.
 Date getModifiedDate()
          Gets the date the transformation was modified.
 String getModifiedUser()
          Gets the user who last modified the transformation.
 String getName()
          Get the name of the transformation.
 String[] getNextStepNames(StepMeta stepMeta)
          Retrieve an array of succeeding step names for a certain originating step.
 StepMeta[] getNextSteps(StepMeta stepMeta)
          Deprecated. use findNextSteps instead
 NotePadMeta getNote(int i)
          Retrieves notepad information on a certain location (i.e.
 NotePadMeta getNote(int x, int y)
          Find the note that is located on a certain point on the canvas.
 int[] getNoteIndexes(List<NotePadMeta> notes)
          Gets an array of the locations of an array of notes.
 String getObjectCopy()
          Gets the object copy.
 ObjectId getObjectId()
          Get the database ID in the repository for this object.
 String getObjectName()
          Gets the object name.
 ObjectRevision getObjectRevision()
          Gets the object revision.
 LoggingObjectType getObjectType()
          Gets the object type.
 String getParameterDefault(String key)
          Gets the parameter default.
 String getParameterDescription(String key)
          Gets the parameter description.
 String getParameterValue(String key)
          Gets the parameter value.
 LoggingObjectInterface getParent()
          Gets the interface to the parent log object.
 VariableSpace getParentVariableSpace()
          Gets the parent variable space.
 List<PartitionSchema> getPartitionSchemas()
          Gets a list of partition schemas for this transformation.
 String[] getPartitionSchemasNames()
          Gets the partition schemas' names.
 String getPathAndName()
          Gets the repository directory path and name of the transformation.
 PerformanceLogTable getPerformanceLogTable()
          Gets the performance log table for the transformation.
 RowMetaInterface getPrevInfoFields(StepMeta stepMeta)
          Find the informational fields coming from an informational step into the step specified.
 RowMetaInterface getPrevInfoFields(String stepname)
          Find the informational fields coming from an informational step into the step specified.
 Result getPreviousResult()
          Gets the previous result.
 RowMetaInterface getPrevStepFields(StepMeta stepMeta)
          Find the fields that are entering a certain step.
 RowMetaInterface getPrevStepFields(StepMeta stepMeta, ProgressMonitorListener monitor)
          Find the fields that are entering a certain step.
 RowMetaInterface getPrevStepFields(String stepname)
          Find the fields that are entering a step with a certain name.
 String[] getPrevStepNames(StepMeta stepMeta)
          Retrieve an array of preceding steps for a certain destination step.
 String[] getPrevStepNames(String stepname)
          Retrieve an array of succeeding step names for a certain originating step name.
 StepMeta[] getPrevSteps(StepMeta stepMeta)
          Retrieve an array of preceding steps for a certain destination step.
 Date getRegistrationDate()
          Gets the registration date for the transformation.
 Repository getRepository()
          Gets the repository.
 RepositoryDirectoryInterface getRepositoryDirectory()
          Gets the repository directory.
 RepositoryObjectType getRepositoryElementType()
          Gets the repository element type.
 List<ResourceReference> getResourceDependencies()
          Gets a list of the resource dependencies.
 List<ResultFile> getResultFiles()
          Gets a list of the files in the result.
 List<RowMetaAndData> getResultRows()
          Gets the result rows.
 Point[] getSelectedNoteLocations()
          Get an array of all the selected note locations.
 List<NotePadMeta> getSelectedNotes()
          Gets an array of all the selected notes.
 Point[] getSelectedStepLocations()
          Get an array of all the selected step locations.
 String[] getSelectedStepNames()
          Gets an array of all the selected step names.
 List<StepMeta> getSelectedSteps()
          Gets a list of the selected steps.
 SharedObjects getSharedObjects()
          Gets the shared objects.
 String getSharedObjectsFile()
          Gets the shared objects file.
 int getSizeRowset()
          Gets the size of the rowsets.
 String[] getSlaveServerNames()
          Gets the slave server names.
 List<SlaveServer> getSlaveServers()
          Gets a list of the slave servers.
 SlaveStepCopyPartitionDistribution getSlaveStepCopyPartitionDistribution()
          Gets the slave step copy partition distribution.
 int getSleepTimeEmpty()
          Gets the amount of time (in nano-seconds) to wait while the input buffer is empty.
 int getSleepTimeFull()
          Gets the amount of time (in nano-seconds) to wait while the input buffer is full.
 List<SQLStatement> getSQLStatements()
          Builds a list of all the SQL statements that this transformation needs in order to work properly.
 List<SQLStatement> getSQLStatements(ProgressMonitorListener monitor)
          Builds a list of all the SQL statements that this transformation needs in order to work properly.
 String getSQLStatementsString()
          Get the SQL statements (needed to run this transformation) as a single String.
 StepMeta getStep(int i)
          Retrieves a step on a certain location (i.e.
 StepMeta getStep(int x, int y, int iconsize)
          Find the step that is located on a certain point on the canvas, taking into account the icon size.
 RowMetaInterface getStepFields(StepMeta stepMeta)
          Returns the fields that are emitted by a certain step.
 RowMetaInterface getStepFields(StepMeta[] stepMeta)
          Gets the fields for each of the specified steps and merges them into a single set
 RowMetaInterface getStepFields(StepMeta stepMeta, ProgressMonitorListener monitor)
          Returns the fields that are emitted by a certain step.
 RowMetaInterface getStepFields(StepMeta stepMeta, StepMeta targetStep, ProgressMonitorListener monitor)
          Returns the fields that are emitted by a certain step.
 RowMetaInterface getStepFields(String stepname)
          Returns the fields that are emitted by a certain step name.
 int[] getStepIndexes(List<StepMeta> steps)
          Gets an array of the locations of an array of steps.
 StepLogTable getStepLogTable()
          Gets the step log table for the transformation.
 String[] getStepNames()
          Gets the names of all the steps.
 long getStepPerformanceCapturingDelay()
          Gets the step performance capturing delay.
 String getStepPerformanceCapturingSizeLimit()
          Gets the step performance capturing size limit.
 List<StepMeta> getSteps()
          Get a list of defined steps in this transformation.
 StepMeta[] getStepsArray()
          Gets all the steps as an array.
 List<StringSearchResult> getStringList(boolean searchSteps, boolean searchDatabases, boolean searchNotes)
          Get a list of all the strings used in this transformation.
 List<StringSearchResult> getStringList(boolean searchSteps, boolean searchDatabases, boolean searchNotes, boolean includePasswords)
          Gets a list of all the strings used in this transformation.
 RowMetaInterface getThisStepFields(StepMeta stepMeta, StepMeta nextStep, RowMetaInterface row)
          Returns the fields that are emitted by a step.
 RowMetaInterface getThisStepFields(StepMeta stepMeta, StepMeta nextStep, RowMetaInterface row, ProgressMonitorListener monitor)
          Returns the fields that are emitted by a step.
 RowMetaInterface getThisStepFields(String stepname, RowMetaInterface row)
          Return the fields that are emitted by a step with a certain name.
 TransMeta.TransformationType getTransformationType()
          Gets the transformation type.
 TransHopMeta getTransHop(int i)
          Retrieves a hop on a certain location (i.e.
 List<StepMeta> getTransHopSteps(boolean all)
          Gets a List of all the steps that are used in at least one active hop.
 TransLogTable getTransLogTable()
          Gets the log table for the transformation.
 int getTransstatus()
          Gets the status of the transformation.
 String getTransversion()
          Gets the version of the transformation.
 Map<String,String> getUsedArguments(String[] arguments)
          Gets the arguments (and their values) used by this transformation.
 List<StepMeta> getUsedSteps()
          Gets the list of used steps, which are the steps that are connected by hops.
 List<String> getUsedVariables()
          Gets a list of the used variables in this transformation.
 String getVariable(String variableName)
          Gets the value for a variable with the specified name.
 String getVariable(String variableName, String defaultValue)
          Gets the value for a variable with the specified name.
 String getXML()
          Gets the XML representation of this transformation.
 String getXML(boolean includeSteps, boolean includeDatabase, boolean includeSlaves, boolean includeClusters, boolean includePartitions)
          Gets the XML representation of this transformation, including or excluding step, database, slave server, cluster, or partition information as specified by the parameters
 boolean hasChanged()
          Checks whether or not the transformation has changed.
 boolean hasLoop(StepMeta stepMeta)
          See if there are any loops in the transformation, starting at the indicated step.
 boolean hasRepositoryReferences()
          Checks whether the transformation has repository references.
 boolean haveClusterSchemasChanged()
          Checks whether or not any of the clustering schemas have been changed.
 boolean haveConnectionsChanged()
          Checks for whether the transformation's connections have changed.
 boolean haveHopsChanged()
          Checks whether or not any of the hops have been changed.
 boolean haveNotesChanged()
          Checks whether or not any of the notes have been changed.
 boolean havePartitionSchemasChanged()
          Checks whether or not any of the partitioning schemas have been changed.
 boolean haveStepsChanged()
          Checks whether or not the steps have changed.
 int indexOfDatabase(DatabaseMeta ci)
          Finds the location (index) of the specified database.
 int indexOfNote(NotePadMeta ni)
          Finds the location (index) of the specified note.
 int indexOfStep(StepMeta stepMeta)
          Finds the location (index) of the specified step.
 int indexOfTransHop(TransHopMeta hi)
          Finds the location (index) of the specified hop.
 void initializeVariablesFrom(VariableSpace parent)
          Initialize variables from the specified variable space.
 void injectVariables(Map<String,String> prop)
          Inject variables from a properties map.
 boolean isCapturingStepPerformanceSnapShots()
          Checks whether the transformation is capturing step performance snapshots.
 boolean isDatabaseConnectionUsed(DatabaseMeta databaseMeta)
          This method asks all steps in the transformation whether or not the specified database connection is used.
 boolean isFeedbackShown()
          Checks if is feedback shown.
 boolean isFileReference()
          Checks if the transformation is referenced by a file.
static boolean isFileReference(String exactFilename, String exactTransname)
          Checks (using the exact filename and transformation name) if the transformation is referenced by a file.
 boolean isRepReference()
          Checks if the transformation is referenced by a repository.
static boolean isRepReference(String exactFilename, String exactTransname)
          Checks (using the exact filename and transformation name) if the transformation is referenced by a repository.
 boolean isSlaveTransformation()
          Checks whether the transformation is a slave transformation.
 boolean isStepInformative(StepMeta this_step, StepMeta prev_step)
          Determines whether or not a certain step is informative.
 boolean isStepUsedInTransHops(StepMeta stepMeta)
          Checks if a step has been used in a hop or not.
 boolean isUsingAClusterSchema()
          Checks if the transformation is using a cluster schema.
 boolean isUsingClusterSchema(ClusterSchema clusterSchema)
          Checks if the transformation is using the specified cluster schema.
 boolean isUsingPartitionSchema(PartitionSchema partitionSchema)
          Checks if the transformation is using the specified partition schema.
 boolean isUsingSlaveServer(SlaveServer slaveServer)
          Checks if the transformation is using the specified slave server.
 boolean isUsingThreadPriorityManagment()
          Checks whether the transformation is using thread priority management.
 boolean isUsingUniqueConnections()
          Checks if the transformation is using unique database connections.
 String[] listParameters()
          Gets an array of parameter names.
 String[] listVariables()
          Gets an array of variable names.
 void loadXML(Node transnode, Repository rep, boolean setInternalVariables)
          Parses an XML DOM (starting at the specified Node) that describes the transformation.
 void loadXML(Node transnode, Repository rep, boolean setInternalVariables, VariableSpace parentVariableSpace)
          Parses an XML DOM (starting at the specified Node) that describes the transformation.
 void loadXML(Node transnode, Repository rep, boolean setInternalVariables, VariableSpace parentVariableSpace, OverwritePrompter prompter)
          Parses an XML DOM (starting at the specified Node) that describes the transformation.
 void lookupRepositoryReferences(Repository repository)
          Looks up the references after a repository import.
 void lowerNote(int p)
          Lowers a note to the "bottom" of the list by removing the note at the specified index and re-inserting it at the front.
 void nameFromFilename()
          Builds a name for the transformation.
 TransAction nextUndo()
          Gets the next undo transaction on the list.
 int nrDatabases()
          Gets the number of databases associated with the transformation.
 int nrDependencies()
          Gets the number of dependencies in the transformation.
 int nrNotes()
          Gets the number of notes in the transformation.
 int nrSteps()
          Gets the number of steps in the transformation.
 int nrTransHops()
          Gets the number of hops in the transformation.
 boolean partOfTransHop(StepMeta stepMeta)
          Determines whether or not a certain step is part of a hop.
 TransAction previousUndo()
          Gets the previous undo operation and change the undo pointer.
 void raiseNote(int p)
          Raises a note to the "top" of the list by removing the note at the specified index and re-inserting it at the end.
 SharedObjects readSharedObjects()
          Reads the shared objects (steps, connections, etc.).
 Object realClone(boolean doClear)
          Perform a real clone of the transformation meta-data object, including cloning all lists and copying all values.
 void removeAllDependencies()
          Clears all the dependencies from the transformation.
 void removeDatabase(int i)
          Removes the database at the specified index.
 void removeDependency(int i)
          Removes a dependency from the transformation on a certain location (i.e.
 void removeFilenameChangedListener(FilenameChangedListener listener)
          Removes the specified FilenameChangedListener.
 void removeNameChangedListener(NameChangedListener listener)
          Removes the specified NameChangedListener.
 void removeNote(int i)
          Removes a note from the transformation on a certain location (i.e.
 void removeStep(int i)
          Removes a step from the transformation on a certain location (i.e.
 void removeTransHop(int i)
          Removes a hop from the transformation on a certain location (i.e.
 void saveSharedObjects()
          Save shared objects, including databases, steps, partition schemas, slave servers, and cluster schemas, to a file
 void selectAll()
          Mark all steps in the transformation as selected.
 void setArguments(String[] arguments)
          Sets the arguments used for this transformation.
 void setCapturingStepPerformanceSnapShots(boolean capturingStepPerformanceSnapShots)
          Sets whether the transformation is capturing step performance snapshots.
 void setCarteObjectId(String containerObjectId)
          Sets the carte object ID.
 void setChanged(boolean ch)
          Sets whether the transformation has changed.
 void setChannelLogTable(ChannelLogTable channelLogTable)
          Sets the channel log table for the transformation.
 void setClusterSchemas(List<ClusterSchema> clusterSchemas)
          Sets list of the cluster schemas used by the transformation.
 void setCounters(Hashtable<String,Counter> counters)
          Sets the counters (database sequence values, e.g.) for the transformation.
 void setCreatedDate(Date createdDate)
          Sets the date the transformation was created.
 void setCreatedUser(String createdUser)
          Sets the user by whom the transformation was created.
 void setDatabases(List<DatabaseMeta> databases)
          Sets the databases associated with the transformation.
 void setDbCache(DBCache dbCache)
          Sets the database cache object.
 void setDependencies(List<TransDependency> dependencies)
          Sets the dependencies for the transformation.
 void setDescription(String n)
          Sets the description of the transformation.
 void setExtendedDescription(String n)
          Sets the extended description of the transformation.
 void setFeedbackShown(boolean feedbackShown)
          Sets whether the feedback should be shown.
 void setFeedbackSize(int feedbackSize)
          Sets the feedback size.
 void setFilename(String fname)
          Set the filename of the transformation.
 void setInternalKettleVariables()
          Sets the internal kettle variables.
 void setInternalKettleVariables(VariableSpace var)
          Sets the internal kettle variables.
 void setLogLevel(LogLevel logLevel)
          Sets the log level for the transformation.
 void setMaxDateConnection(DatabaseMeta maxDateConnection)
          Sets the database connection associated with "max date" processing.
 void setMaxDateDifference(double maxDateDifference)
          Sets the maximum date difference between start and end dates for row/record processing.
 void setMaxDateField(String maxDateField)
          Sets the date field associated with "max date" processing.
 void setMaxDateOffset(double maxDateOffset)
          Sets the amount by which to increase the end date in "max date" processing.
 void setMaxDateTable(String maxDateTable)
          Sets the table name associated with "max date" processing.
 void setMaxUndo(int mu)
          Sets the maximum number of undo operations that are allowed.
 void setModifiedDate(Date modifiedDate)
          Sets the date the transformation was modified.
 void setModifiedUser(String modifiedUser)
          Sets the user who last modified the transformation.
 void setName(String newName)
          Set the name of the transformation.
 void setObjectId(ObjectId id)
          Set the database ID for this object in the repository.
 void setObjectRevision(ObjectRevision objectRevision)
          Sets the object revision.
 void setParameterValue(String key, String value)
          Sets the specified parameter to the specified value.
 void setParentVariableSpace(VariableSpace parent)
          Sets the parent variable space.
 void setPartitionSchemas(List<PartitionSchema> partitionSchemas)
          Sets the list of partition schemas for this transformation.
 void setPerformanceLogTable(PerformanceLogTable performanceLogTable)
          Sets the performance log table for the transformation.
 void setPreviousResult(Result previousResult)
          Sets the previous result.
 void setRepository(Repository repository)
          Sets the repository.
 void setRepositoryDirectory(RepositoryDirectoryInterface directory)
          Sets the repository directory.
 void setResultFiles(List<ResultFile> resultFiles)
          Sets the list of the files in the result.
 void setResultRows(List<RowMetaAndData> resultRows)
          Sets the list of result rows.
 void setSharedObjects(SharedObjects sharedObjects)
          Sets the shared objects.
 void setSharedObjectsFile(String sharedObjectsFile)
          Sets the shared objects file.
 void setSizeRowset(int sizeRowset)
          Sets the size of the rowsets.
 void setSlaveServers(List<SlaveServer> slaveServers)
          Sets the list of slave servers.
 void setSlaveStepCopyPartitionDistribution(SlaveStepCopyPartitionDistribution slaveStepCopyPartitionDistribution)
          Sets the slave step copy partition distribution.
 void setSlaveTransformation(boolean slaveTransformation)
          Sets whether the transformation is a slave transformation.
 void setSleepTimeEmpty(int sleepTimeEmpty)
          Sets the amount of time (in nano-seconds) to wait while the input buffer is empty.
 void setSleepTimeFull(int sleepTimeFull)
          Sets the amount of time (in nano-seconds) to wait while the input buffer is full.
 void setStep(int i, StepMeta stepMeta)
          Changes the content of a step on a certain position.
 void setStepLogTable(StepLogTable stepLogTable)
          Sets the step log table for the transformation.
 void setStepPerformanceCapturingDelay(long stepPerformanceCapturingDelay)
          Sets the step performance capturing delay.
 void setStepPerformanceCapturingSizeLimit(String stepPerformanceCapturingSizeLimit)
          Sets the step performance capturing size limit.
 void setTransformationType(TransMeta.TransformationType transformationType)
          Sets the transformation type.
 void setTransHop(int i, TransHopMeta hi)
          Changes the content of a hop on a certain position.
 void setTransLogTable(TransLogTable transLogTable)
          Sets the log table for the transformation.
 void setTransstatus(int n)
          Sets the status of the transformation.
 void setTransversion(String n)
          Sets the version of the transformation.
 void setUsingThreadPriorityManagment(boolean usingThreadPriorityManagment)
          Sets whether the transformation is using thread priority management.
 void setUsingUniqueConnections(boolean usingUniqueConnections)
          Sets whether the transformation is using unique database connections.
 void setVariable(String variableName, String variableValue)
          Sets the specified variable to the specified value
 void shareVariablesWith(VariableSpace space)
          Share variables with the specified variable space.
 void sortHops()
          Sorts all the hops in the transformation.
 void sortHopsNatural()
          Sorts the hops in a natural way: from beginning to end.
 void sortSteps()
          Puts the steps in alphabetical order.
 Map<StepMeta,Map<StepMeta,Boolean>> sortStepsNatural()
          Puts the steps in a more natural order: from start to finish.
 String toString()
          Gets a textual representation of the transformation.
 void unselectAll()
          Clear the selection of all steps.
 TransAction viewNextUndo()
          Gets the next undo transaction on the list.
 TransAction viewPreviousUndo()
          Views previous undo action.
 TransAction viewThisUndo()
          Views current undo action.
 void writeXML(String filename)
          Utility method to write the XML of this transformation to a file, mostly for testing purposes.
 
Methods inherited from class org.pentaho.di.core.changed.ChangedFlag
addObserver, deleteObserver, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_TAG

public static final String XML_TAG
A constant specifying the tag value for the XML node of the transformation.

See Also:
Constant Field Values

STRING_TRANSMETA

public static final String STRING_TRANSMETA
A constant used by the logging operations to indicate any logged messages are related to transformation meta-data.

See Also:
Constant Field Values

REPOSITORY_ELEMENT_TYPE

public static final RepositoryObjectType REPOSITORY_ELEMENT_TYPE
A constant specifying the repository element type as a Transformation.


TYPE_UNDO_CHANGE

public static final int TYPE_UNDO_CHANGE
A constant indicating a Change action, used in "undo/redo" operations.

See Also:
Constant Field Values

TYPE_UNDO_NEW

public static final int TYPE_UNDO_NEW
A constant indicating a New action, used in "undo/redo" operations.

See Also:
Constant Field Values

TYPE_UNDO_DELETE

public static final int TYPE_UNDO_DELETE
A constant indicating a Delete action, used in "undo/redo" operations.

See Also:
Constant Field Values

TYPE_UNDO_POSITION

public static final int TYPE_UNDO_POSITION
A constant indicating a Position Change action, used in "undo/redo" operations.

See Also:
Constant Field Values

desc_type_undo

public static final String[] desc_type_undo
A list of localized strings corresponding to string descriptions of the undo/redo actions.


XML_TAG_NOTEPADS

public static final String XML_TAG_NOTEPADS
A constant specifying the tag value for the XML node of the notes.

See Also:
Constant Field Values

XML_TAG_PARAMETERS

public static final String XML_TAG_PARAMETERS
A constant specifying the tag value for the XML node of the transformation parameters.

See Also:
Constant Field Values

XML_TAG_PARTITIONSCHEMAS

public static final String XML_TAG_PARTITIONSCHEMAS
A constant specifying the tag value for the XML node of the transformation's partition schemas.

See Also:
Constant Field Values

XML_TAG_SLAVESERVERS

public static final String XML_TAG_SLAVESERVERS
A constant specifying the tag value for the XML node of the slave servers.

See Also:
Constant Field Values

XML_TAG_CLUSTERSCHEMAS

public static final String XML_TAG_CLUSTERSCHEMAS
A constant specifying the tag value for the XML node of the cluster schemas.

See Also:
Constant Field Values
Constructor Detail

TransMeta

public TransMeta()
Builds a new empty transformation. The transformation will have default logging capability and no variables, and all internal meta-data is cleared to defaults.


TransMeta

public TransMeta(VariableSpace parent)
Builds a new empty transformation with a set of variables to inherit from.

Parameters:
parent - the variable space to inherit from

TransMeta

public TransMeta(String filename,
                 String name,
                 String[] arguments)
Constructs a new transformation specifying the filename, name and arguments.

Parameters:
filename - The filename of the transformation
name - The name of the transformation
arguments - The arguments as Strings

TransMeta

public TransMeta(String fname)
          throws KettleXMLException
Parses a file containing the XML that describes the transformation. No default connections are loaded since no repository is available at this time. Since the filename is set, internal variables are being set that relate to this.

Parameters:
fname - The filename
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

TransMeta

public TransMeta(String fname,
                 VariableSpace parentVariableSpace)
          throws KettleXMLException
Parses a file containing the XML that describes the transformation. No default connections are loaded since no repository is available at this time. Since the filename is set, variables are set in the specified variable space that relate to this.

Parameters:
fname - The filename
parentVariableSpace - the parent variable space
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

TransMeta

public TransMeta(String fname,
                 boolean setInternalVariables)
          throws KettleXMLException
Parses a file containing the XML that describes the transformation. No default connections are loaded since no repository is available at this time.

Parameters:
fname - The filename
setInternalVariables - true if you want to set the internal variables based on this transformation information
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

TransMeta

public TransMeta(String fname,
                 Repository rep)
          throws KettleXMLException
Parses a file containing the XML that describes the transformation.

Parameters:
fname - The filename
rep - The repository to load the default set of connections from, null if no repository is available
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

TransMeta

public TransMeta(String fname,
                 Repository rep,
                 boolean setInternalVariables)
          throws KettleXMLException
Parses a file containing the XML that describes the transformation.

Parameters:
fname - The filename
rep - The repository to load the default set of connections from, null if no repository is available
setInternalVariables - true if you want to set the internal variables based on this transformation information
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

TransMeta

public TransMeta(String fname,
                 Repository rep,
                 boolean setInternalVariables,
                 VariableSpace parentVariableSpace)
          throws KettleXMLException
Parses a file containing the XML that describes the transformation.

Parameters:
fname - The filename
rep - The repository to load the default set of connections from, null if no repository is available
setInternalVariables - true if you want to set the internal variables based on this transformation information
parentVariableSpace - the parent variable space to use during TransMeta construction
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

TransMeta

public TransMeta(String fname,
                 Repository rep,
                 boolean setInternalVariables,
                 VariableSpace parentVariableSpace,
                 OverwritePrompter prompter)
          throws KettleXMLException
Parses a file containing the XML that describes the transformation.

Parameters:
fname - The filename
rep - The repository to load the default set of connections from, null if no repository is available
setInternalVariables - true if you want to set the internal variables based on this transformation information
parentVariableSpace - the parent variable space to use during TransMeta construction
prompter - the changed/replace listener or null if there is none
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

TransMeta

public TransMeta(InputStream xmlStream,
                 Repository rep,
                 boolean setInternalVariables,
                 VariableSpace parentVariableSpace,
                 OverwritePrompter prompter)
          throws KettleXMLException
Instantiates a new transformation meta-data object.

Parameters:
xmlStream - the XML input stream from which to read the transformation definition
rep - the repository
setInternalVariables - whether to set internal variables as a result of the creation
parentVariableSpace - the parent variable space
prompter - a GUI component that will prompt the user if the new transformation will overwrite an existing one
Throws:
KettleXMLException - if any errors occur during parsing of the specified stream

TransMeta

public TransMeta(Node transnode,
                 Repository rep)
          throws KettleXMLException
Parse a file containing the XML that describes the transformation. Specify a repository to load default list of database connections from and to reference in mappings etc.

Parameters:
transnode - The XML node to load from
rep - the repository to reference.
Throws:
KettleXMLException - if any errors occur during parsing of the specified file
Method Detail

compare

public int compare(TransMeta t1,
                   TransMeta t2)
Compares two transformation on name, filename, repository directory, etc. The comparison algorithm is as follows:
  1. The first transformation's filename is checked first; if it has none, the transformation comes from a repository. If the second transformation does not come from a repository, -1 is returned.
  2. If the transformations are both from a repository, the transformations' names are compared. If the first transformation has no name and the second one does, a -1 is returned. If the opposite is true, a 1 is returned.
  3. If they both have names they are compared as strings. If the result is non-zero it is returned. Otherwise the repository directories are compared using the same technique of checking empty values and then performing a string comparison, returning any non-zero result.
  4. If the names and directories are equal, the object revision strings are compared using the same technique of checking empty values and then performing a string comparison, this time ultimately returning the result of the string compare.
  5. If the first transformation does not come from a repository and the second one does, a 1 is returned. Otherwise the transformation names and filenames are subsequently compared using the same technique of checking empty values and then performing a string comparison, ultimately returning the result of the filename string comparison.

Specified by:
compare in interface Comparator<TransMeta>
Parameters:
t1 - the first transformation to compare
t2 - the second transformation to compare
Returns:
0 if the two transformations are equal, 1 or -1 depending on the values (see description above)

compareTo

public int compareTo(TransMeta o)
Compares this transformation's meta-data to the specified transformation's meta-data. This method simply calls compare(this, o)

Specified by:
compareTo in interface Comparable<TransMeta>
Parameters:
o - the o
Returns:
the int
See Also:
compare(TransMeta, TransMeta), Comparable.compareTo(java.lang.Object)

equals

public boolean equals(Object obj)
Checks whether this transformation's meta-data object is equal to the specified object. If the specified object is not an instance of TransMeta, false is returned. Otherwise the method returns whether a call to compare() indicates equality (i.e. compare(this, (TransMeta)obj)==0).

Specified by:
equals in interface Comparator<TransMeta>
Overrides:
equals in class Object
Parameters:
obj - the obj
Returns:
true, if successful
See Also:
compare(TransMeta, TransMeta), Object.equals(java.lang.Object)

clone

public Object clone()
Clones the transformation meta-data object.

Overrides:
clone in class Object
Returns:
a clone of the transformation meta-data object
See Also:
Object.clone()

realClone

public Object realClone(boolean doClear)
Perform a real clone of the transformation meta-data object, including cloning all lists and copying all values. If the doClear parameter is true, the clone will be cleared of ALL values before the copy. If false, only the copied fields will be cleared.

Parameters:
doClear - Whether to clear all of the clone's data before copying from the source object
Returns:
a real clone of the calling object

getObjectId

public ObjectId getObjectId()
Get the database ID in the repository for this object.

Specified by:
getObjectId in interface LoggingObjectInterface
Specified by:
getObjectId in interface RepositoryElementInterface
Specified by:
getObjectId in interface RepositoryObjectInterface
Returns:
the database ID in the repository for this object.

setObjectId

public void setObjectId(ObjectId id)
Set the database ID for this object in the repository.

Specified by:
setObjectId in interface EngineMetaInterface
Specified by:
setObjectId in interface RepositoryElementInterface
Parameters:
id - the database ID for this object in the repository.

clear

public void clear()
Clears the transformation's meta-data, including the lists of databases, steps, hops, notes, dependencies, partition schemas, slave servers, and cluster schemas. Logging information and timeouts are reset to defaults, and recent connection info is cleared.


clearUndo

public void clearUndo()
Clears the list of undo actions. Also resets the undo position (index).


getDatabases

public List<DatabaseMeta> getDatabases()
Gets the list of databases associated with the transformation.

Specified by:
getDatabases in interface HasDatabasesInterface
Returns:
the list of databases associated with the transformation
See Also:
org.pentaho.di.trans.HasDatabaseInterface#getDatabases()

setDatabases

public void setDatabases(List<DatabaseMeta> databases)
Sets the databases associated with the transformation.

Specified by:
setDatabases in interface HasDatabasesInterface
Parameters:
databases - the new databases
See Also:
org.pentaho.di.trans.HasDatabaseInterface#setDatabases(java.util.ArrayList)

addDatabase

public void addDatabase(DatabaseMeta databaseMeta)
Adds the specified database (via database meta-data) to the list of associated databases for the transformation.

Specified by:
addDatabase in interface HasDatabasesInterface
Parameters:
databaseMeta - the database meta to add
See Also:
org.pentaho.di.trans.HasDatabaseInterface#addDatabase(org.pentaho.di.core.database.DatabaseMeta)

addOrReplaceDatabase

public void addOrReplaceDatabase(DatabaseMeta databaseMeta)
Adds the specified database (via database meta-data) to the list of associated databases for the transformation, or replaces the database if it already exists in the list

Specified by:
addOrReplaceDatabase in interface HasDatabasesInterface
Parameters:
databaseMeta - the database meta to add or replace
See Also:
org.pentaho.di.trans.HasDatabaseInterface#addOrReplaceDatabase(org.pentaho.di.core.database.DatabaseMeta)

addStep

public void addStep(StepMeta stepMeta)
Add a new step to the transformation. Also marks that the transformation's steps have changed.

Parameters:
stepMeta - The meta-data for the step to be added.

addOrReplaceStep

public void addOrReplaceStep(StepMeta stepMeta)
Add a new step to the transformation if that step didn't exist yet. Otherwise, replace the step. This method also marks that the transformation's steps have changed.

Parameters:
stepMeta - The meta-data for the step to be added.

addTransHop

public void addTransHop(TransHopMeta hi)
Add a new hop to the transformation. The hop information (source and target steps, e.g.) should be configured in the TransHopMeta object before calling addTransHop(). Also marks that the transformation's hops have changed.

Parameters:
hi - The hop meta-data to be added.

addNote

public void addNote(NotePadMeta ni)
Add a new note to the transformation. Also marks that the transformation's notes have changed.

Parameters:
ni - The note to be added.

addDependency

public void addDependency(TransDependency td)
Add a new dependency to the transformation.

Parameters:
td - The transformation dependency to be added.

addDatabase

public void addDatabase(int p,
                        DatabaseMeta ci)
Adds a database association to the transformation at the given index

Specified by:
addDatabase in interface HasDatabasesInterface
Parameters:
p - the index into the database list
ci - the database meta-data
See Also:
org.pentaho.di.trans.HasDatabaseInterface#addDatabase(int, org.pentaho.di.core.database.DatabaseMeta)

addStep

public void addStep(int p,
                    StepMeta stepMeta)
Add a new step to the transformation at the specified index. This method sets the step's parent transformation to the this transformation, and marks that the transformations' steps have changed.

Parameters:
p - The index into the step list
stepMeta - The step to be added.

addTransHop

public void addTransHop(int p,
                        TransHopMeta hi)
Add a new hop to the transformation on a certain location (i.e. the specified index). Also marks that the transformation's hops have changed.

Parameters:
p - the index into the hop list
hi - The hop to be added.

addNote

public void addNote(int p,
                    NotePadMeta ni)
Add a new note to the transformation on a certain location (i.e. the specified index). Also marks that the transformation's notes have changed.

Parameters:
p - The index into the notes list
ni - The note to be added.

addDependency

public void addDependency(int p,
                          TransDependency td)
Add a new dependency to the transformation on a certain location (i.e. the specified index).

Parameters:
p - The index into the dependencies list.
td - The transformation dependency to be added.

getDatabase

public DatabaseMeta getDatabase(int i)
Gets the database at the specified index.

Specified by:
getDatabase in interface HasDatabasesInterface
Parameters:
i - the index into the database list
Returns:
the database meta-data object at the specified index
See Also:
org.pentaho.di.trans.HasDatabaseInterface#getDatabase(int)

getSteps

public List<StepMeta> getSteps()
Get a list of defined steps in this transformation.

Returns:
an ArrayList of defined steps.

getStep

public StepMeta getStep(int i)
Retrieves a step on a certain location (i.e. the specified index).

Parameters:
i - The index into the steps list.
Returns:
The desired step's meta-data.

getTransHop

public TransHopMeta getTransHop(int i)
Retrieves a hop on a certain location (i.e. the specified index).

Parameters:
i - The index into the hops list.
Returns:
The desired hop's meta-data.

getNote

public NotePadMeta getNote(int i)
Retrieves notepad information on a certain location (i.e. the specified index).

Parameters:
i - The index into the notes list.
Returns:
The notepad information.

getDependency

public TransDependency getDependency(int i)
Retrieves a dependency on a certain location (i.e. the specified index).

Parameters:
i - The index into the dependencies list.
Returns:
The dependency object.

removeDatabase

public void removeDatabase(int i)
Removes the database at the specified index. Also marks that the transformation's databases have changed.

Specified by:
removeDatabase in interface HasDatabasesInterface
Parameters:
i - the index at which to remove the database
See Also:
org.pentaho.di.trans.HasDatabaseInterface#removeDatabase(int)

removeStep

public void removeStep(int i)
Removes a step from the transformation on a certain location (i.e. the specified index). Also marks that the transformation's steps have changed.

Parameters:
i - The index

removeTransHop

public void removeTransHop(int i)
Removes a hop from the transformation on a certain location (i.e. the specified index). Also marks that the transformation's hops have changed.

Parameters:
i - The index into the hops list

removeNote

public void removeNote(int i)
Removes a note from the transformation on a certain location (i.e. the specified index). Also marks that the transformation's notes have changed.

Parameters:
i - The index into the notes list

raiseNote

public void raiseNote(int p)
Raises a note to the "top" of the list by removing the note at the specified index and re-inserting it at the end. Also marks that the transformation's notes have changed.

Parameters:
p - the index into the notes list.

lowerNote

public void lowerNote(int p)
Lowers a note to the "bottom" of the list by removing the note at the specified index and re-inserting it at the front. Also marks that the transformation's notes have changed.

Parameters:
p - the index into the notes list.

removeDependency

public void removeDependency(int i)
Removes a dependency from the transformation on a certain location (i.e. the specified index).

Parameters:
i - The location

removeAllDependencies

public void removeAllDependencies()
Clears all the dependencies from the transformation.


nrDatabases

public int nrDatabases()
Gets the number of databases associated with the transformation.

Specified by:
nrDatabases in interface HasDatabasesInterface
Returns:
the number of databases associated with the transformation
See Also:
org.pentaho.di.trans.HasDatabaseInterface#nrDatabases()

nrSteps

public int nrSteps()
Gets the number of steps in the transformation.

Returns:
The number of steps in the transformation.

nrTransHops

public int nrTransHops()
Gets the number of hops in the transformation.

Returns:
The number of hops in the transformation.

nrNotes

public int nrNotes()
Gets the number of notes in the transformation.

Returns:
The number of notes in the transformation.

nrDependencies

public int nrDependencies()
Gets the number of dependencies in the transformation.

Returns:
The number of dependencies in the transformation.

setStep

public void setStep(int i,
                    StepMeta stepMeta)
Changes the content of a step on a certain position. This is accomplished by setting the step's metadata at the specified index to the specified meta-data object. The new step's parent transformation is updated to be this transformation.

Parameters:
i - The index into the steps list
stepMeta - The step meta-data to set

setTransHop

public void setTransHop(int i,
                        TransHopMeta hi)
Changes the content of a hop on a certain position. This is accomplished by setting the hop's metadata at the specified index to the specified meta-data object.

Parameters:
i - The index into the hops list
hi - The hop meta-data to set

getUsedSteps

public List<StepMeta> getUsedSteps()
Gets the list of used steps, which are the steps that are connected by hops.

Returns:
a list with all the used steps

findDatabase

public DatabaseMeta findDatabase(String name)
Find a database (associated with the transformation) by name

Specified by:
findDatabase in interface HasDatabasesInterface
Parameters:
name - the name of the desired database
Returns:
the desired database's meta-data, or null if no database is found
See Also:
org.pentaho.di.trans.HasDatabaseInterface#findDatabase(java.lang.String)

findStep

public StepMeta findStep(String name)
Searches the list of steps for a step with a certain name.

Parameters:
name - The name of the step to look for
Returns:
The step information or null if no nothing was found.

findStep

public StepMeta findStep(String name,
                         StepMeta exclude)
Searches the list of steps for a step with a certain name while excluding one step.

Parameters:
name - The name of the step to look for
exclude - The step information to exclude.
Returns:
The step information or null if nothing was found.

findTransHop

public TransHopMeta findTransHop(String name)
Searches the list of hops for a hop with a certain name.

Parameters:
name - The name of the hop to look for
Returns:
The hop information or null if nothing was found.

findTransHopFrom

public TransHopMeta findTransHopFrom(StepMeta fromstep)
Search all hops for a hop where a certain step is at the start.

Parameters:
fromstep - The step at the start of the hop.
Returns:
The hop or null if no hop was found.

findTransHop

public TransHopMeta findTransHop(TransHopMeta hi)
Find a certain hop in the transformation.

Parameters:
hi - The hop information to look for.
Returns:
The hop or null if no hop was found.

findTransHop

public TransHopMeta findTransHop(StepMeta from,
                                 StepMeta to)
Search all hops for a hop where a certain step is at the start and another is at the end.

Parameters:
from - The step at the start of the hop.
to - The step at the end of the hop.
Returns:
The hop or null if no hop was found.

findTransHop

public TransHopMeta findTransHop(StepMeta from,
                                 StepMeta to,
                                 boolean disabledToo)
Search all hops for a hop where a certain step is at the start and another is at the end.

Parameters:
from - The step at the start of the hop.
to - The step at the end of the hop.
disabledToo - the disabled too
Returns:
The hop or null if no hop was found.

findTransHopTo

public TransHopMeta findTransHopTo(StepMeta tostep)
Search all hops for a hop where a certain step is at the end.

Parameters:
tostep - The step at the end of the hop.
Returns:
The hop or null if no hop was found.

isStepInformative

public boolean isStepInformative(StepMeta this_step,
                                 StepMeta prev_step)
Determines whether or not a certain step is informative. This means that the previous step is sending information to this step, but only informative. This means that this step is using the information to process the actual stream of data. We use this in StreamLookup, TableInput and other types of steps.

Parameters:
this_step - The step that is receiving information.
prev_step - The step that is sending information
Returns:
true if prev_step if informative for this_step.

findNrPrevSteps

public int findNrPrevSteps(String stepname)
Deprecated. 

Counts the number of previous steps for a step name.

Parameters:
stepname - The name of the step to start from
Returns:
The number of preceding steps.

findNrPrevSteps

public int findNrPrevSteps(String stepname,
                           boolean info)
Deprecated. 

Counts the number of previous steps for a step name taking into account whether or not they are informational.

Parameters:
stepname - The name of the step to start from
info - true if only the informational steps are desired, false otherwise
Returns:
The number of preceding steps.

findNrPrevSteps

public int findNrPrevSteps(StepMeta stepMeta)
Find the number of steps that precede the indicated step.

Parameters:
stepMeta - The source step
Returns:
The number of preceding steps found.

findPrevStep

public StepMeta findPrevStep(String stepname,
                             int nr)
Deprecated. 

Find the previous step on a certain location (i.e. the specified index).

Parameters:
stepname - The source step name
nr - the index into the step list
Returns:
The preceding step found.

findPrevStep

public StepMeta findPrevStep(String stepname,
                             int nr,
                             boolean info)
Deprecated. 

Find the previous step on a certain location taking into account the steps being informational or not.

Parameters:
stepname - The name of the step
nr - The index into the step list
info - true if only the informational steps are desired, false otherwise
Returns:
The step information

findPrevStep

public StepMeta findPrevStep(StepMeta stepMeta,
                             int nr)
Find the previous step on a certain location (i.e. the specified index).

Parameters:
stepMeta - The source step information
nr - the index into the hops list
Returns:
The preceding step found.

findNrPrevSteps

public int findNrPrevSteps(StepMeta stepMeta,
                           boolean info)
Deprecated. please use method findPreviousSteps

Count the number of previous steps on a certain location taking into account the steps being informational or not.

Parameters:
stepMeta - The name of the step
info - true if only the informational steps are desired, false otherwise
Returns:
The number of preceding steps

findPrevStep

public StepMeta findPrevStep(StepMeta stepMeta,
                             int nr,
                             boolean info)
Deprecated. please use method findPreviousSteps

Find the previous step on a certain location taking into account the steps being informational or not.

Parameters:
stepMeta - The step
nr - The index into the hops list
info - true if we only want the informational steps.
Returns:
The preceding step information

findPreviousSteps

public List<StepMeta> findPreviousSteps(StepMeta stepMeta)
Get the list of previous steps for a certain reference step. This includes the info steps.

Parameters:
stepMeta - The reference step
Returns:
The list of the preceding steps, including the info steps.

findPreviousSteps

public List<StepMeta> findPreviousSteps(StepMeta stepMeta,
                                        boolean info)
Get the previous steps on a certain location taking into account the steps being informational or not.

Parameters:
stepMeta - The name of the step
info - true if we only want the informational steps.
Returns:
The list of the preceding steps

getInfoStep

public StepMeta[] getInfoStep(StepMeta stepMeta)
Get the informational steps for a certain step. An informational step is a step that provides information for lookups, etc.

Parameters:
stepMeta - The name of the step
Returns:
An array of the informational steps found

findNrInfoSteps

public int findNrInfoSteps(StepMeta stepMeta)
Find the the number of informational steps for a certain step.

Parameters:
stepMeta - The step
Returns:
The number of informational steps found.

getPrevInfoFields

public RowMetaInterface getPrevInfoFields(String stepname)
                                   throws KettleStepException
Find the informational fields coming from an informational step into the step specified.

Parameters:
stepname - The name of the step
Returns:
A row containing fields with origin.
Throws:
KettleStepException - the kettle step exception

getPrevInfoFields

public RowMetaInterface getPrevInfoFields(StepMeta stepMeta)
                                   throws KettleStepException
Find the informational fields coming from an informational step into the step specified.

Parameters:
stepMeta - The receiving step
Returns:
A row containing fields with origin.
Throws:
KettleStepException - the kettle step exception

findNrNextSteps

public int findNrNextSteps(StepMeta stepMeta)
Deprecated. just get the next steps as an array

Find the number of succeeding steps for a certain originating step.

Parameters:
stepMeta - The originating step
Returns:
The number of succeeding steps.

findNextStep

public StepMeta findNextStep(StepMeta stepMeta,
                             int nr)
Deprecated. just get the next steps as an array

Find the succeeding step at a location for an originating step.

Parameters:
stepMeta - The originating step
nr - The location
Returns:
The step found.

getPrevSteps

public StepMeta[] getPrevSteps(StepMeta stepMeta)
Retrieve an array of preceding steps for a certain destination step. This includes the info steps.

Parameters:
stepMeta - The destination step
Returns:
An array containing the preceding steps.

getPrevStepNames

public String[] getPrevStepNames(String stepname)
Retrieve an array of succeeding step names for a certain originating step name.

Parameters:
stepname - The originating step name
Returns:
An array of succeeding step names

getPrevStepNames

public String[] getPrevStepNames(StepMeta stepMeta)
Retrieve an array of preceding steps for a certain destination step.

Parameters:
stepMeta - The destination step
Returns:
an array of preceding step names.

getNextSteps

public StepMeta[] getNextSteps(StepMeta stepMeta)
Deprecated. use findNextSteps instead

Retrieve an array of succeeding steps for a certain originating step.

Parameters:
stepMeta - The originating step
Returns:
an array of succeeding steps.

findNextSteps

public List<StepMeta> findNextSteps(StepMeta stepMeta)
Retrieve a list of succeeding steps for a certain originating step.

Parameters:
stepMeta - The originating step
Returns:
an array of succeeding steps.

getNextStepNames

public String[] getNextStepNames(StepMeta stepMeta)
Retrieve an array of succeeding step names for a certain originating step.

Parameters:
stepMeta - The originating step
Returns:
an array of succeeding step names.

getStep

public StepMeta getStep(int x,
                        int y,
                        int iconsize)
Find the step that is located on a certain point on the canvas, taking into account the icon size.

Parameters:
x - the x-coordinate of the point queried
y - the y-coordinate of the point queried
iconsize - the iconsize
Returns:
The step information if a step is located at the point. Otherwise, if no step was found: null.

getNote

public NotePadMeta getNote(int x,
                           int y)
Find the note that is located on a certain point on the canvas.

Parameters:
x - the x-coordinate of the point queried
y - the y-coordinate of the point queried
Returns:
The note information if a note is located at the point. Otherwise, if nothing was found: null.

partOfTransHop

public boolean partOfTransHop(StepMeta stepMeta)
Determines whether or not a certain step is part of a hop.

Parameters:
stepMeta - The step queried
Returns:
true if the step is part of a hop.

getStepFields

public RowMetaInterface getStepFields(String stepname)
                               throws KettleStepException
Returns the fields that are emitted by a certain step name.

Parameters:
stepname - The stepname of the step to be queried.
Returns:
A row containing the fields emitted.
Throws:
KettleStepException - the kettle step exception

getStepFields

public RowMetaInterface getStepFields(StepMeta stepMeta)
                               throws KettleStepException
Returns the fields that are emitted by a certain step.

Parameters:
stepMeta - The step to be queried.
Returns:
A row containing the fields emitted.
Throws:
KettleStepException - the kettle step exception

getStepFields

public RowMetaInterface getStepFields(StepMeta[] stepMeta)
                               throws KettleStepException
Gets the fields for each of the specified steps and merges them into a single set

Parameters:
stepMeta - the step meta
Returns:
an interface to the step fields
Throws:
KettleStepException - the kettle step exception

getStepFields

public RowMetaInterface getStepFields(StepMeta stepMeta,
                                      ProgressMonitorListener monitor)
                               throws KettleStepException
Returns the fields that are emitted by a certain step.

Parameters:
stepMeta - The step to be queried.
monitor - The progress monitor for progress dialog. (null if not used!)
Returns:
A row containing the fields emitted.
Throws:
KettleStepException - the kettle step exception

getStepFields

public RowMetaInterface getStepFields(StepMeta stepMeta,
                                      StepMeta targetStep,
                                      ProgressMonitorListener monitor)
                               throws KettleStepException
Returns the fields that are emitted by a certain step.

Parameters:
stepMeta - The step to be queried.
targetStep - the target step
monitor - The progress monitor for progress dialog. (null if not used!)
Returns:
A row containing the fields emitted.
Throws:
KettleStepException - the kettle step exception

getPrevStepFields

public RowMetaInterface getPrevStepFields(String stepname)
                                   throws KettleStepException
Find the fields that are entering a step with a certain name.

Parameters:
stepname - The name of the step queried
Returns:
A row containing the fields (w/ origin) entering the step
Throws:
KettleStepException - the kettle step exception

getPrevStepFields

public RowMetaInterface getPrevStepFields(StepMeta stepMeta)
                                   throws KettleStepException
Find the fields that are entering a certain step.

Parameters:
stepMeta - The step queried
Returns:
A row containing the fields (w/ origin) entering the step
Throws:
KettleStepException - the kettle step exception

getPrevStepFields

public RowMetaInterface getPrevStepFields(StepMeta stepMeta,
                                          ProgressMonitorListener monitor)
                                   throws KettleStepException
Find the fields that are entering a certain step.

Parameters:
stepMeta - The step queried
monitor - The progress monitor for progress dialog. (null if not used!)
Returns:
A row containing the fields (w/ origin) entering the step
Throws:
KettleStepException - the kettle step exception

getThisStepFields

public RowMetaInterface getThisStepFields(String stepname,
                                          RowMetaInterface row)
                                   throws KettleStepException
Return the fields that are emitted by a step with a certain name.

Parameters:
stepname - The name of the step that's being queried.
row - A row containing the input fields or an empty row if no input is required.
Returns:
A Row containing the output fields.
Throws:
KettleStepException - the kettle step exception

getThisStepFields

public RowMetaInterface getThisStepFields(StepMeta stepMeta,
                                          StepMeta nextStep,
                                          RowMetaInterface row)
                                   throws KettleStepException
Returns the fields that are emitted by a step.

Parameters:
stepMeta - : The StepMeta object that's being queried
nextStep - : if non-null this is the next step that's call back to ask what's being sent
row - : A row containing the input fields or an empty row if no input is required.
Returns:
A Row containing the output fields.
Throws:
KettleStepException - the kettle step exception

getThisStepFields

public RowMetaInterface getThisStepFields(StepMeta stepMeta,
                                          StepMeta nextStep,
                                          RowMetaInterface row,
                                          ProgressMonitorListener monitor)
                                   throws KettleStepException
Returns the fields that are emitted by a step.

Parameters:
stepMeta - : The StepMeta object that's being queried
nextStep - : if non-null this is the next step that's call back to ask what's being sent
row - : A row containing the input fields or an empty row if no input is required.
monitor - the monitor
Returns:
A Row containing the output fields.
Throws:
KettleStepException - the kettle step exception

isUsingPartitionSchema

public boolean isUsingPartitionSchema(PartitionSchema partitionSchema)
Checks if the transformation is using the specified partition schema.

Parameters:
partitionSchema - the partition schema
Returns:
true if the transformation is using the partition schema, false otherwise

isUsingAClusterSchema

public boolean isUsingAClusterSchema()
Checks if the transformation is using a cluster schema.

Returns:
true if a cluster schema is used on one or more steps in this transformation, false otherwise

isUsingClusterSchema

public boolean isUsingClusterSchema(ClusterSchema clusterSchema)
Checks if the transformation is using the specified cluster schema.

Parameters:
clusterSchema - the cluster schema to check
Returns:
true if the specified cluster schema is used on one or more steps in this transformation

isUsingSlaveServer

public boolean isUsingSlaveServer(SlaveServer slaveServer)
                           throws KettleException
Checks if the transformation is using the specified slave server.

Parameters:
slaveServer - the slave server
Returns:
true if the transformation is using the slave server, false otherwise
Throws:
KettleException - if any errors occur while checking for the slave server

isRepReference

public boolean isRepReference()
Checks if the transformation is referenced by a repository.

Returns:
true if the transformation is referenced by a repository, false otherwise

isFileReference

public boolean isFileReference()
Checks if the transformation is referenced by a file. If the transformation is not referenced by a repository, it is assumed to be referenced by a file.

Returns:
true if the transformation is referenced by a file, false otherwise
See Also:
isRepReference()

isRepReference

public static boolean isRepReference(String exactFilename,
                                     String exactTransname)
Checks (using the exact filename and transformation name) if the transformation is referenced by a repository. If referenced by a repository, the exact filename should be empty and the exact transformation name should be non-empty.

Parameters:
exactFilename - the exact filename
exactTransname - the exact transformation name
Returns:
true if the transformation is referenced by a repository, false otherwise

isFileReference

public static boolean isFileReference(String exactFilename,
                                      String exactTransname)
Checks (using the exact filename and transformation name) if the transformation is referenced by a file. If referenced by a repository, the exact filename should be non-empty and the exact transformation name should be empty.

Parameters:
exactFilename - the exact filename
exactTransname - the exact transformation name
Returns:
true if the transformation is referenced by a file, false otherwise
See Also:
isRepReference(String, String)

indexOfTransHop

public int indexOfTransHop(TransHopMeta hi)
Finds the location (index) of the specified hop.

Parameters:
hi - The hop queried
Returns:
The location of the hop, or -1 if nothing was found.

indexOfStep

public int indexOfStep(StepMeta stepMeta)
Finds the location (index) of the specified step.

Parameters:
stepMeta - The step queried
Returns:
The location of the step, or -1 if nothing was found.

indexOfDatabase

public int indexOfDatabase(DatabaseMeta ci)
Finds the location (index) of the specified database.

Specified by:
indexOfDatabase in interface HasDatabasesInterface
Parameters:
ci - the database queried
Returns:
the index of the database, or -1 if nothing was found
See Also:
org.pentaho.di.trans.HasDatabaseInterface#indexOfDatabase(org.pentaho.di.core.database.DatabaseMeta)

indexOfNote

public int indexOfNote(NotePadMeta ni)
Finds the location (index) of the specified note.

Parameters:
ni - The note queried
Returns:
The location of the note, or -1 if nothing was found.

getFileType

public String getFileType()
Gets the file type. For TransMeta, this returns a value corresponding to Transformation

Specified by:
getFileType in interface EngineMetaInterface
Returns:
the file type
See Also:
EngineMetaInterface.getFileType()

getFilterNames

public String[] getFilterNames()
Gets the transformation filter names.

Specified by:
getFilterNames in interface EngineMetaInterface
Returns:
the filter names
See Also:
EngineMetaInterface.getFilterNames()

getFilterExtensions

public String[] getFilterExtensions()
Gets the transformation filter extensions. For TransMeta, this method returns the value of Const.STRING_TRANS_FILTER_EXT

Specified by:
getFilterExtensions in interface EngineMetaInterface
Returns:
the filter extensions
See Also:
EngineMetaInterface.getFilterExtensions()

getDefaultExtension

public String getDefaultExtension()
Gets the default extension for a transformation. For TransMeta, this method returns the value of Const.STRING_TRANS_DEFAULT_EXT

Specified by:
getDefaultExtension in interface EngineMetaInterface
Returns:
the default extension
See Also:
EngineMetaInterface.getDefaultExtension()

getXML

public String getXML()
              throws KettleException
Gets the XML representation of this transformation.

Specified by:
getXML in interface EngineMetaInterface
Specified by:
getXML in interface XMLInterface
Returns:
the XML representation of this transformation
Throws:
KettleException - if any errors occur during generation of the XML
See Also:
XMLInterface.getXML()

getXML

public String getXML(boolean includeSteps,
                     boolean includeDatabase,
                     boolean includeSlaves,
                     boolean includeClusters,
                     boolean includePartitions)
              throws KettleException
Gets the XML representation of this transformation, including or excluding step, database, slave server, cluster, or partition information as specified by the parameters

Parameters:
includeSteps - whether to include step data
includeDatabase - whether to include database data
includeSlaves - whether to include slave server data
includeClusters - whether to include cluster data
includePartitions - whether to include partition data
Returns:
the XML representation of this transformation
Throws:
KettleException - if any errors occur during generation of the XML

loadXML

public void loadXML(Node transnode,
                    Repository rep,
                    boolean setInternalVariables)
             throws KettleXMLException
Parses an XML DOM (starting at the specified Node) that describes the transformation.

Parameters:
transnode - The XML node to load from
rep - The repository to load the default list of database connections from (null if no repository is available)
setInternalVariables - true if you want to set the internal variables based on this transformation information
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

loadXML

public void loadXML(Node transnode,
                    Repository rep,
                    boolean setInternalVariables,
                    VariableSpace parentVariableSpace)
             throws KettleXMLException
Parses an XML DOM (starting at the specified Node) that describes the transformation.

Parameters:
transnode - The XML node to load from
rep - The repository to load the default list of database connections from (null if no repository is available)
setInternalVariables - true if you want to set the internal variables based on this transformation information
parentVariableSpace - the parent variable space to use during TransMeta construction
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

loadXML

public void loadXML(Node transnode,
                    Repository rep,
                    boolean setInternalVariables,
                    VariableSpace parentVariableSpace,
                    OverwritePrompter prompter)
             throws KettleXMLException
Parses an XML DOM (starting at the specified Node) that describes the transformation.

Parameters:
transnode - The XML node to load from
rep - The repository to load the default list of database connections from (null if no repository is available)
setInternalVariables - true if you want to set the internal variables based on this transformation information
parentVariableSpace - the parent variable space to use during TransMeta construction
prompter - the changed/replace listener or null if there is none
Throws:
KettleXMLException - if any errors occur during parsing of the specified file

readSharedObjects

public SharedObjects readSharedObjects()
                                throws KettleException
Reads the shared objects (steps, connections, etc.).

Returns:
the shared objects
Throws:
KettleException - if any errors occur while reading the shared objects

getTransHopSteps

public List<StepMeta> getTransHopSteps(boolean all)
Gets a List of all the steps that are used in at least one active hop. These steps will be used to execute the transformation. The others will not be executed.
Update 3.0 : we also add those steps that are not linked to another hop, but have at least one remote input or output step defined.

Parameters:
all - true if you want to get ALL the steps from the transformation, false otherwise
Returns:
A List of steps

getName

public String getName()
Get the name of the transformation.

Specified by:
getName in interface EngineMetaInterface
Specified by:
getName in interface RepositoryElementInterface
Specified by:
getName in interface RepositoryObjectInterface
Returns:
The name of the transformation

setName

public void setName(String newName)
Set the name of the transformation.

Specified by:
setName in interface RepositoryElementInterface
Parameters:
newName - The new name of the transformation

nameFromFilename

public void nameFromFilename()
Builds a name for the transformation. If no name is yet set, create the name from the filename.

Specified by:
nameFromFilename in interface EngineMetaInterface

getFilename

public String getFilename()
Get the filename (if any) of the transformation.

Specified by:
getFilename in interface EngineMetaInterface
Specified by:
getFilename in interface LoggingObjectInterface
Returns:
The filename of the transformation.

setFilename

public void setFilename(String fname)
Set the filename of the transformation.

Specified by:
setFilename in interface EngineMetaInterface
Parameters:
fname - The new filename of the transformation.

isStepUsedInTransHops

public boolean isStepUsedInTransHops(StepMeta stepMeta)
Checks if a step has been used in a hop or not.

Parameters:
stepMeta - The step queried.
Returns:
true if a step is used in a hop (active or not), false otherwise

setChanged

public void setChanged(boolean ch)
Sets whether the transformation has changed.

Specified by:
setChanged in interface ChangedFlagInterface
Overrides:
setChanged in class ChangedFlag
Parameters:
ch - true if you want to mark the transformation as changed, false otherwise

clearChanged

public void clearChanged()
Clears the different changed flags of the transformation.

Specified by:
clearChanged in interface ChangedFlagInterface
Specified by:
clearChanged in interface EngineMetaInterface
Overrides:
clearChanged in class ChangedFlag

clearChangedDatabases

public void clearChangedDatabases()
Clears the flags for whether the transformation's databases have changed.


haveConnectionsChanged

public boolean haveConnectionsChanged()
Checks for whether the transformation's connections have changed.

Specified by:
haveConnectionsChanged in interface HasDatabasesInterface
Returns:
true if the transformation's connections have changed, false otherwise
See Also:
org.pentaho.di.trans.HasDatabaseInterface#haveConnectionsChanged()

haveStepsChanged

public boolean haveStepsChanged()
Checks whether or not the steps have changed.

Returns:
true if the steps have been changed, false otherwise

haveHopsChanged

public boolean haveHopsChanged()
Checks whether or not any of the hops have been changed.

Returns:
true if a hop has been changed, false otherwise

haveNotesChanged

public boolean haveNotesChanged()
Checks whether or not any of the notes have been changed.

Returns:
true if the notes have been changed, false otherwise

havePartitionSchemasChanged

public boolean havePartitionSchemasChanged()
Checks whether or not any of the partitioning schemas have been changed.

Returns:
true if the partitioning schemas have been changed, false otherwise

haveClusterSchemasChanged

public boolean haveClusterSchemasChanged()
Checks whether or not any of the clustering schemas have been changed.

Returns:
true if the clustering schemas have been changed, false otherwise

hasChanged

public boolean hasChanged()
Checks whether or not the transformation has changed.

Specified by:
hasChanged in interface ChangedFlagInterface
Overrides:
hasChanged in class ChangedFlag
Returns:
true if the transformation has changed, false otherwise

hasLoop

public boolean hasLoop(StepMeta stepMeta)
See if there are any loops in the transformation, starting at the indicated step. This works by looking at all the previous steps. If you keep going backward and find the step, there is a loop. Both the informational and the normal steps need to be checked for loops!

Parameters:
stepMeta - The step position to start looking
Returns:
true if a loop has been found, false if no loop is found.

selectAll

public void selectAll()
Mark all steps in the transformation as selected.


unselectAll

public void unselectAll()
Clear the selection of all steps.


getSelectedStepLocations

public Point[] getSelectedStepLocations()
Get an array of all the selected step locations.

Returns:
The selected step locations.

getSelectedNoteLocations

public Point[] getSelectedNoteLocations()
Get an array of all the selected note locations.

Returns:
The selected note locations.

getSelectedSteps

public List<StepMeta> getSelectedSteps()
Gets a list of the selected steps.

Returns:
A list of all the selected steps.

getSelectedNotes

public List<NotePadMeta> getSelectedNotes()
Gets an array of all the selected notes.

Returns:
An array of all the selected notes.

getSelectedStepNames

public String[] getSelectedStepNames()
Gets an array of all the selected step names.

Returns:
An array of all the selected step names.

getStepIndexes

public int[] getStepIndexes(List<StepMeta> steps)
Gets an array of the locations of an array of steps.

Parameters:
steps - An array of steps
Returns:
an array of the locations of an array of steps

getNoteIndexes

public int[] getNoteIndexes(List<NotePadMeta> notes)
Gets an array of the locations of an array of notes.

Parameters:
notes - An array of notes
Returns:
an array of the locations of an array of notes

getMaxUndo

public int getMaxUndo()
Gets the maximum number of undo operations possible.

Specified by:
getMaxUndo in interface UndoInterface
Returns:
The maximum number of undo operations that are allowed.

setMaxUndo

public void setMaxUndo(int mu)
Sets the maximum number of undo operations that are allowed.

Specified by:
setMaxUndo in interface UndoInterface
Parameters:
mu - The maximum number of undo operations that are allowed.

addUndo

public void addUndo(Object[] from,
                    Object[] to,
                    int[] pos,
                    Point[] prev,
                    Point[] curr,
                    int type_of_change,
                    boolean nextAlso)
Adds an undo operation to the undo list.

Specified by:
addUndo in interface UndoInterface
Parameters:
from - array of objects representing the old state
to - array of objectes representing the new state
pos - An array of object locations
prev - An array of points representing the old positions
curr - An array of points representing the new positions
type_of_change - The type of change that's being done to the transformation.
nextAlso - indicates that the next undo operation needs to follow this one.

previousUndo

public TransAction previousUndo()
Gets the previous undo operation and change the undo pointer.

Specified by:
previousUndo in interface UndoInterface
Returns:
The undo transaction to be performed.

viewThisUndo

public TransAction viewThisUndo()
Views current undo action. This method does not change the undo position.

Specified by:
viewThisUndo in interface UndoInterface
Returns:
The current undo transaction

viewPreviousUndo

public TransAction viewPreviousUndo()
Views previous undo action. This method does not change the undo position.

Specified by:
viewPreviousUndo in interface UndoInterface
Returns:
The previous undo transaction

nextUndo

public TransAction nextUndo()
Gets the next undo transaction on the list. This method changes the undo pointer.

Specified by:
nextUndo in interface UndoInterface
Returns:
The next undo transaction (for redo)

viewNextUndo

public TransAction viewNextUndo()
Gets the next undo transaction on the list. This method does not change the undo position.

Specified by:
viewNextUndo in interface UndoInterface
Returns:
The next undo transaction (for redo)

getMaximum

public Point getMaximum()
Gets the maximum size of the canvas by calculating the maximum location of a step.

Returns:
Maximum coordinate of a step in the transformation + (100,100) for safety.

getMinimum

public Point getMinimum()
Gets the minimum point on the canvas of a transformation.

Returns:
Minimum coordinate of a step in the transformation

getStepNames

public String[] getStepNames()
Gets the names of all the steps.

Returns:
An array of step names.

getStepsArray

public StepMeta[] getStepsArray()
Gets all the steps as an array.

Returns:
An array of all the steps in the transformation.

findPrevious

public boolean findPrevious(StepMeta startStep,
                            StepMeta stepToFind)
Looks in the transformation to find a step in a previous location starting somewhere.

Parameters:
startStep - The starting step
stepToFind - The step to look for backward in the transformation
Returns:
true if we can find the step in an earlier location in the transformation.

sortSteps

public void sortSteps()
Puts the steps in alphabetical order.


sortHops

public void sortHops()
Sorts all the hops in the transformation.


sortStepsNatural

public Map<StepMeta,Map<StepMeta,Boolean>> sortStepsNatural()
Puts the steps in a more natural order: from start to finish. For the moment, we ignore splits and joins. Splits and joins can't be listed sequentially in any case!

Returns:
a map containing all the previous steps per step

sortHopsNatural

public void sortHopsNatural()
Sorts the hops in a natural way: from beginning to end.


analyseImpact

public void analyseImpact(List<DatabaseImpact> impact,
                          ProgressMonitorListener monitor)
                   throws KettleStepException
Determines the impact of the different steps in a transformation on databases, tables and field.

Parameters:
impact - An ArrayList of DatabaseImpact objects.
monitor - a progress monitor listener to be updated as the transformation is analyzed
Throws:
KettleStepException - if any errors occur during analysis

getAlternativeStepname

public String getAlternativeStepname(String stepname)
Proposes an alternative stepname when the original already exists.

Parameters:
stepname - The stepname to find an alternative for
Returns:
The suggested alternative stepname.

getSQLStatements

public List<SQLStatement> getSQLStatements()
                                    throws KettleStepException
Builds a list of all the SQL statements that this transformation needs in order to work properly.

Returns:
An ArrayList of SQLStatement objects.
Throws:
KettleStepException - if any errors occur during SQL statement generation

getSQLStatements

public List<SQLStatement> getSQLStatements(ProgressMonitorListener monitor)
                                    throws KettleStepException
Builds a list of all the SQL statements that this transformation needs in order to work properly.

Parameters:
monitor - a progress monitor listener to be updated as the SQL statements are generated
Returns:
An ArrayList of SQLStatement objects.
Throws:
KettleStepException - if any errors occur during SQL statement generation

getSQLStatementsString

public String getSQLStatementsString()
                              throws KettleStepException
Get the SQL statements (needed to run this transformation) as a single String.

Returns:
the SQL statements needed to run this transformation
Throws:
KettleStepException - if any errors occur during SQL statement generation

checkSteps

public void checkSteps(List<CheckResultInterface> remarks,
                       boolean only_selected,
                       ProgressMonitorListener monitor)
Checks all the steps and fills a List of (CheckResult) remarks.

Parameters:
remarks - The remarks list to add to.
only_selected - true to check only the selected steps, false for all steps
monitor - a progress monitor listener to be updated as the SQL statements are generated

getResultRows

public List<RowMetaAndData> getResultRows()
Gets the result rows.

Returns:
a list containing the result rows.

setResultRows

public void setResultRows(List<RowMetaAndData> resultRows)
Sets the list of result rows.

Parameters:
resultRows - The list of result rows to set.

getRepositoryDirectory

public RepositoryDirectoryInterface getRepositoryDirectory()
Gets the repository directory.

Specified by:
getRepositoryDirectory in interface EngineMetaInterface
Specified by:
getRepositoryDirectory in interface LoggingObjectInterface
Specified by:
getRepositoryDirectory in interface RepositoryElementInterface
Returns:
Returns the repository directory.

setRepositoryDirectory

public void setRepositoryDirectory(RepositoryDirectoryInterface directory)
Sets the repository directory.

Specified by:
setRepositoryDirectory in interface RepositoryElementInterface
Parameters:
directory - The directory to set.

getPathAndName

public String getPathAndName()
Gets the repository directory path and name of the transformation.

Returns:
The repository directory path plus the name of the transformation

getArguments

public String[] getArguments()
Gets the arguments used for this transformation.

Returns:
an array of String arguments for the transformation

setArguments

public void setArguments(String[] arguments)
Sets the arguments used for this transformation.

Parameters:
arguments - The arguments to set.

getCounters

public Hashtable<String,Counter> getCounters()
Gets the counters (database sequence values, e.g.) for the transformation.

Returns:
a named table of counters.

setCounters

public void setCounters(Hashtable<String,Counter> counters)
Sets the counters (database sequence values, e.g.) for the transformation.

Parameters:
counters - The counters to set.

getDependencies

public List<TransDependency> getDependencies()
Gets a list of dependencies for the transformation

Returns:
a list of the dependencies for the transformation

setDependencies

public void setDependencies(List<TransDependency> dependencies)
Sets the dependencies for the transformation.

Parameters:
dependencies - The dependency list to set.

getMaxDateConnection

public DatabaseMeta getMaxDateConnection()
Gets the database connection associated with "max date" processing. The connection, along with a specified table and field, allows for the filtering of the number of rows to process in a transformation by time, such as only processing the rows/records since the last time the transformation ran correctly. This can be used for auditing and throttling data during warehousing operations.

Returns:
Returns the meta-data associated with the most recent database connection.

setMaxDateConnection

public void setMaxDateConnection(DatabaseMeta maxDateConnection)
Sets the database connection associated with "max date" processing.

Parameters:
maxDateConnection - the database meta-data to set
See Also:
getMaxDateConnection()

getMaxDateDifference

public double getMaxDateDifference()
Gets the maximum date difference between start and end dates for row/record processing. This can be used for auditing and throttling data during warehousing operations.

Returns:
the maximum date difference

setMaxDateDifference

public void setMaxDateDifference(double maxDateDifference)
Sets the maximum date difference between start and end dates for row/record processing.

Parameters:
maxDateDifference - The date difference to set.
See Also:
getMaxDateDifference()

getMaxDateField

public String getMaxDateField()
Gets the date field associated with "max date" processing. This allows for the filtering of the number of rows to process in a transformation by time, such as only processing the rows/records since the last time the transformation ran correctly. This can be used for auditing and throttling data during warehousing operations.

Returns:
a string representing the date for the most recent database connection.
See Also:
getMaxDateConnection()

setMaxDateField

public void setMaxDateField(String maxDateField)
Sets the date field associated with "max date" processing.

Parameters:
maxDateField - The date field to set.
See Also:
getMaxDateField()

getMaxDateOffset

public double getMaxDateOffset()
Gets the amount by which to increase the "max date" difference. This is used in "max date" processing, and can be used to provide more fine-grained control of the date range. For example, if the end date specifies a minute for which the data is not complete, you can "roll-back" the end date by one minute by

Returns:
Returns the maxDateOffset.
See Also:
setMaxDateOffset(double)

setMaxDateOffset

public void setMaxDateOffset(double maxDateOffset)
Sets the amount by which to increase the end date in "max date" processing. This can be used to provide more fine-grained control of the date range. For example, if the end date specifies a minute for which the data is not complete, you can "roll-back" the end date by one minute by setting the offset to -60.

Parameters:
maxDateOffset - The maxDateOffset to set.

getMaxDateTable

public String getMaxDateTable()
Gets the database table providing a date to be used in "max date" processing. This allows for the filtering of the number of rows to process in a transformation by time, such as only processing the rows/records since the last time the transformation ran correctly.

Returns:
Returns the maxDateTable.
See Also:
getMaxDateConnection()

setMaxDateTable

public void setMaxDateTable(String maxDateTable)
Sets the table name associated with "max date" processing.

Parameters:
maxDateTable - The maxDateTable to set.
See Also:
getMaxDateTable()

getSizeRowset

public int getSizeRowset()
Gets the size of the rowsets.

Returns:
Returns the size of the rowsets.

setSizeRowset

public void setSizeRowset(int sizeRowset)
Sets the size of the rowsets. This method allows you to change the size of the buffers between the connected steps in a transformation. NOTE: Do not change this parameter unless you are running low on memory, for example.

Parameters:
sizeRowset - The sizeRowset to set.

getDbCache

public DBCache getDbCache()
Gets the database cache object.

Returns:
the database cache object.

setDbCache

public void setDbCache(DBCache dbCache)
Sets the database cache object.

Parameters:
dbCache - the database cache object to set

getCreatedDate

public Date getCreatedDate()
Gets the date the transformation was created.

Specified by:
getCreatedDate in interface EngineMetaInterface
Returns:
the date the transformation was created.

setCreatedDate

public void setCreatedDate(Date createdDate)
Sets the date the transformation was created.

Specified by:
setCreatedDate in interface EngineMetaInterface
Parameters:
createdDate - The creation date to set.

setCreatedUser

public void setCreatedUser(String createdUser)
Sets the user by whom the transformation was created.

Specified by:
setCreatedUser in interface EngineMetaInterface
Parameters:
createdUser - The user to set.

getCreatedUser

public String getCreatedUser()
Gets the user by whom the transformation was created.

Specified by:
getCreatedUser in interface EngineMetaInterface
Returns:
the user by whom the transformation was created.

setModifiedDate

public void setModifiedDate(Date modifiedDate)
Sets the date the transformation was modified.

Specified by:
setModifiedDate in interface EngineMetaInterface
Parameters:
modifiedDate - The modified date to set.

getModifiedDate

public Date getModifiedDate()
Gets the date the transformation was modified.

Specified by:
getModifiedDate in interface EngineMetaInterface
Returns:
the date the transformation was modified.

setModifiedUser

public void setModifiedUser(String modifiedUser)
Sets the user who last modified the transformation.

Specified by:
setModifiedUser in interface EngineMetaInterface
Parameters:
modifiedUser - The user name to set.

getModifiedUser

public String getModifiedUser()
Gets the user who last modified the transformation.

Specified by:
getModifiedUser in interface EngineMetaInterface
Returns:
the user who last modified the transformation.

getDescription

public String getDescription()
Gets the description of the transformation.

Specified by:
getDescription in interface RepositoryElementInterface
Returns:
The description of the transformation.

setDescription

public void setDescription(String n)
Sets the description of the transformation.

Specified by:
setDescription in interface RepositoryElementInterface
Parameters:
n - The description of the transformation to set.

setExtendedDescription

public void setExtendedDescription(String n)
Sets the extended description of the transformation.

Parameters:
n - The extended description of the transformation to set.

getExtendedDescription

public String getExtendedDescription()
Gets the extended description of the transformation.

Returns:
The extended description of the transformation.

getTransversion

public String getTransversion()
Gets the version of the transformation.

Returns:
The version of the transformation

setTransversion

public void setTransversion(String n)
Sets the version of the transformation.

Parameters:
n - The new version description of the transformation

setTransstatus

public void setTransstatus(int n)
Sets the status of the transformation.

Parameters:
n - The new status description of the transformation

getTransstatus

public int getTransstatus()
Gets the status of the transformation.

Returns:
The status of the transformation

toString

public String toString()
Gets a textual representation of the transformation. If its name has been set, it will be returned, otherwise the classname is returned.

Overrides:
toString in class Object
Returns:
the textual representation of the transformation.

cancelQueries

public void cancelQueries()
                   throws KettleDatabaseException
Cancels queries opened for checking & fieldprediction.

Throws:
KettleDatabaseException - if any errors occur during query cancellation

getUsedArguments

public Map<String,String> getUsedArguments(String[] arguments)
Gets the arguments (and their values) used by this transformation. If argument values are supplied by parameter, the values will used for the arguments. If the values are null or empty, the method will attempt to use argument values from a previous execution.

Parameters:
arguments - the values for the arguments
Returns:
A row with the used arguments (and their values) in it.

getSleepTimeEmpty

public int getSleepTimeEmpty()
Gets the amount of time (in nano-seconds) to wait while the input buffer is empty.

Returns:
the number of nano-seconds to wait while the input buffer is empty.

getSleepTimeFull

public int getSleepTimeFull()
Gets the amount of time (in nano-seconds) to wait while the input buffer is full.

Returns:
the number of nano-seconds to wait while the input buffer is full.

setSleepTimeEmpty

public void setSleepTimeEmpty(int sleepTimeEmpty)
Sets the amount of time (in nano-seconds) to wait while the input buffer is empty.

Parameters:
sleepTimeEmpty - the number of nano-seconds to wait while the input buffer is empty.

setSleepTimeFull

public void setSleepTimeFull(int sleepTimeFull)
Sets the amount of time (in nano-seconds) to wait while the input buffer is full.

Parameters:
sleepTimeFull - the number of nano-seconds to wait while the input buffer is full.

isDatabaseConnectionUsed

public boolean isDatabaseConnectionUsed(DatabaseMeta databaseMeta)
This method asks all steps in the transformation whether or not the specified database connection is used. The connection is used in the transformation if any of the steps uses it or if it is being used to log to.

Parameters:
databaseMeta - The connection to check
Returns:
true if the connection is used in this transformation.

getStringList

public List<StringSearchResult> getStringList(boolean searchSteps,
                                              boolean searchDatabases,
                                              boolean searchNotes,
                                              boolean includePasswords)
Gets a list of all the strings used in this transformation. The parameters indicate which collections to search and which to exclude.

Parameters:
searchSteps - true if steps should be searched, false otherwise
searchDatabases - true if databases should be searched, false otherwise
searchNotes - true if notes should be searched, false otherwise
includePasswords - true if passwords should be searched, false otherwise
Returns:
a list of search results for strings used in the transformation.

getStringList

public List<StringSearchResult> getStringList(boolean searchSteps,
                                              boolean searchDatabases,
                                              boolean searchNotes)
Get a list of all the strings used in this transformation. The parameters indicate which collections to search and which to exclude.

Parameters:
searchSteps - true if steps should be searched, false otherwise
searchDatabases - true if databases should be searched, false otherwise
searchNotes - true if notes should be searched, false otherwise
Returns:
a list of search results for strings used in the transformation.

getUsedVariables

public List<String> getUsedVariables()
Gets a list of the used variables in this transformation.

Returns:
a list of the used variables in this transformation.

getPreviousResult

public Result getPreviousResult()
Gets the previous result.

Returns:
the previous Result.

setPreviousResult

public void setPreviousResult(Result previousResult)
Sets the previous result.

Parameters:
previousResult - The previous Result to set.

getResultFiles

public List<ResultFile> getResultFiles()
Gets a list of the files in the result.

Returns:
a list of ResultFiles.

setResultFiles

public void setResultFiles(List<ResultFile> resultFiles)
Sets the list of the files in the result.

Parameters:
resultFiles - The list of ResultFiles to set.

getPartitionSchemas

public List<PartitionSchema> getPartitionSchemas()
Gets a list of partition schemas for this transformation.

Returns:
a list of PartitionSchemas

setPartitionSchemas

public void setPartitionSchemas(List<PartitionSchema> partitionSchemas)
Sets the list of partition schemas for this transformation.

Parameters:
partitionSchemas - the list of PartitionSchemas to set

getPartitionSchemasNames

public String[] getPartitionSchemasNames()
Gets the partition schemas' names.

Returns:
a String array containing the available partition schema names.

isFeedbackShown

public boolean isFeedbackShown()
Checks if is feedback shown.

Returns:
true if feedback is shown, false otherwise

setFeedbackShown

public void setFeedbackShown(boolean feedbackShown)
Sets whether the feedback should be shown.

Parameters:
feedbackShown - true if feedback should be shown, false otherwise

getFeedbackSize

public int getFeedbackSize()
Gets the feedback size.

Returns:
the feedback size

setFeedbackSize

public void setFeedbackSize(int feedbackSize)
Sets the feedback size.

Parameters:
feedbackSize - the feedback size to set

isUsingUniqueConnections

public boolean isUsingUniqueConnections()
Checks if the transformation is using unique database connections.

Returns:
true if the transformation is using unique database connections, false otherwise

setUsingUniqueConnections

public void setUsingUniqueConnections(boolean usingUniqueConnections)
Sets whether the transformation is using unique database connections.

Parameters:
usingUniqueConnections - true if the transformation is using unique database connections, false otherwise

getClusterSchemas

public List<ClusterSchema> getClusterSchemas()
Gets a list of the cluster schemas used by the transformation.

Returns:
a list of ClusterSchemas

setClusterSchemas

public void setClusterSchemas(List<ClusterSchema> clusterSchemas)
Sets list of the cluster schemas used by the transformation.

Parameters:
clusterSchemas - the list of ClusterSchemas to set

getClusterSchemaNames

public String[] getClusterSchemaNames()
Gets the cluster schema names.

Returns:
a String array containing the cluster schemas' names

findPartitionSchema

public PartitionSchema findPartitionSchema(String name)
Find a partition schema using its name.

Parameters:
name - The name of the partition schema to look for.
Returns:
the partition with the specified name of null if nothing was found

findClusterSchema

public ClusterSchema findClusterSchema(String name)
Find a clustering schema using its name.

Parameters:
name - The name of the clustering schema to look for.
Returns:
the cluster schema with the specified name of null if nothing was found

addOrReplacePartitionSchema

public void addOrReplacePartitionSchema(PartitionSchema partitionSchema)
Add a new partition schema to the transformation if that didn't exist yet. Otherwise, replace it.

Parameters:
partitionSchema - The partition schema to be added.

addOrReplaceSlaveServer

public void addOrReplaceSlaveServer(SlaveServer slaveServer)
Add a new slave server to the transformation if that didn't exist yet. Otherwise, replace it.

Parameters:
slaveServer - The slave server to be added.

addOrReplaceClusterSchema

public void addOrReplaceClusterSchema(ClusterSchema clusterSchema)
Add a new cluster schema to the transformation if that didn't exist yet. Otherwise, replace it.

Parameters:
clusterSchema - The cluster schema to be added.

getSharedObjectsFile

public String getSharedObjectsFile()
Gets the shared objects file.

Returns:
the shared objects file

setSharedObjectsFile

public void setSharedObjectsFile(String sharedObjectsFile)
Sets the shared objects file.

Parameters:
sharedObjectsFile - the new shared objects file

saveSharedObjects

public void saveSharedObjects()
                       throws KettleException
Save shared objects, including databases, steps, partition schemas, slave servers, and cluster schemas, to a file

Specified by:
saveSharedObjects in interface EngineMetaInterface
Throws:
KettleException - the kettle exception
See Also:
EngineMetaInterface.saveSharedObjects(), SharedObjects.saveToFile()

isUsingThreadPriorityManagment

public boolean isUsingThreadPriorityManagment()
Checks whether the transformation is using thread priority management.

Returns:
true if the transformation is using thread priority management, false otherwise

setUsingThreadPriorityManagment

public void setUsingThreadPriorityManagment(boolean usingThreadPriorityManagment)
Sets whether the transformation is using thread priority management.

Parameters:
usingThreadPriorityManagment - true if the transformation is using thread priority management, false otherwise

findSlaveServer

public SlaveServer findSlaveServer(String serverString)
Find a slave server with the given name. This method performs a case-insensitive search of the slave servers by name. If no slave server is found, null is returned

Parameters:
serverString - the name of the slave server to find
Returns:
the slave server with the specified name, or null if no slave server is found

getSlaveServerNames

public String[] getSlaveServerNames()
Gets the slave server names.

Returns:
a String array containing the slave server names

getSlaveServers

public List<SlaveServer> getSlaveServers()
Gets a list of the slave servers.

Specified by:
getSlaveServers in interface HasSlaveServersInterface
Returns:
a list of SlaveServers.

setSlaveServers

public void setSlaveServers(List<SlaveServer> slaveServers)
Sets the list of slave servers.

Parameters:
slaveServers - the list of SlaveServers to set

checkRowMixingStatically

public void checkRowMixingStatically(StepMeta stepMeta,
                                     ProgressMonitorListener monitor)
                              throws KettleRowException
Check a step to see if there are no multiple steps to read from. If so, check to see if the receiving rows are all the same in layout. We only want to ONLY use the DBCache for this to prevent GUI stalls.

Parameters:
stepMeta - the step to check
monitor - the monitor
Throws:
KettleRowException - in case we detect a row mixing violation

setInternalKettleVariables

public void setInternalKettleVariables()
Sets the internal kettle variables.

Specified by:
setInternalKettleVariables in interface EngineMetaInterface
See Also:
EngineMetaInterface.setInternalKettleVariables()

setInternalKettleVariables

public void setInternalKettleVariables(VariableSpace var)
Sets the internal kettle variables.

Parameters:
var - the new internal kettle variables

copyVariablesFrom

public void copyVariablesFrom(VariableSpace space)
Copies variables from the specified variable space into this transformation's variable space.

Specified by:
copyVariablesFrom in interface VariableSpace
Parameters:
space - the variable space from which to copy
See Also:
VariableSpace.copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace)

environmentSubstitute

public String environmentSubstitute(String aString)
Resolves the given string against environment variables by performing substitution. The resolved string is returned.

Specified by:
environmentSubstitute in interface VariableSpace
Parameters:
aString - the string to resolve
Returns:
the string after been resolved against environment variables
See Also:
VariableSpace.environmentSubstitute(java.lang.String)

environmentSubstitute

public String[] environmentSubstitute(String[] aString)
Resolves the given strings against environment variables by performing substitution. The array of resolved strings is returned.

Specified by:
environmentSubstitute in interface VariableSpace
Parameters:
aString - the string array to resolve
Returns:
the array strings after having been resolved against environment variables
See Also:
VariableSpace.environmentSubstitute(java.lang.String[])

getParentVariableSpace

public VariableSpace getParentVariableSpace()
Gets the parent variable space.

Specified by:
getParentVariableSpace in interface VariableSpace
Returns:
the parent variable space
See Also:
VariableSpace.getParentVariableSpace()

setParentVariableSpace

public void setParentVariableSpace(VariableSpace parent)
Sets the parent variable space.

Specified by:
setParentVariableSpace in interface VariableSpace
Parameters:
parent - the new parent variable space
See Also:
VariableSpace.setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace)

getVariable

public String getVariable(String variableName,
                          String defaultValue)
Gets the value for a variable with the specified name. If the variable has no value assigned, the specified default value is returned

Specified by:
getVariable in interface VariableSpace
Parameters:
variableName - the variable name
defaultValue - the default value
Returns:
the variable value (or default value if the variable is unassigned)
See Also:
VariableSpace.getVariable(java.lang.String, java.lang.String)

getVariable

public String getVariable(String variableName)
Gets the value for a variable with the specified name.

Specified by:
getVariable in interface VariableSpace
Parameters:
variableName - the variable name
Returns:
the variable's value
See Also:
VariableSpace.getVariable(java.lang.String)

getBooleanValueOfVariable

public boolean getBooleanValueOfVariable(String variableName,
                                         boolean defaultValue)
Returns a boolean representation of the specified variable after performing any necessary substitution. Truth values include case-insensitive versions of "Y", "YES", "TRUE" or "1".

Specified by:
getBooleanValueOfVariable in interface VariableSpace
Parameters:
variableName - the name of the variable to interrogate
defaultValue - The default value to return.
Returns:
a boolean representation of the specified variable after performing any necessary substitution
See Also:
VariableSpace.getBooleanValueOfVariable(java.lang.String, boolean)

initializeVariablesFrom

public void initializeVariablesFrom(VariableSpace parent)
Initialize variables from the specified variable space.

Specified by:
initializeVariablesFrom in interface VariableSpace
Parameters:
parent - the parent variable space
See Also:
VariableSpace.initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace)

listVariables

public String[] listVariables()
Gets an array of variable names.

Specified by:
listVariables in interface VariableSpace
Returns:
the string array of variable names
See Also:
VariableSpace.listVariables()

setVariable

public void setVariable(String variableName,
                        String variableValue)
Sets the specified variable to the specified value

Specified by:
setVariable in interface VariableSpace
Parameters:
variableName - the variable name
variableValue - the variable value
See Also:
VariableSpace.setVariable(java.lang.String, java.lang.String)

shareVariablesWith

public void shareVariablesWith(VariableSpace space)
Share variables with the specified variable space.

Specified by:
shareVariablesWith in interface VariableSpace
Parameters:
space - the variable space with which to share variables
See Also:
VariableSpace.shareVariablesWith(org.pentaho.di.core.variables.VariableSpace)

injectVariables

public void injectVariables(Map<String,String> prop)
Inject variables from a properties map.

Specified by:
injectVariables in interface VariableSpace
Parameters:
prop - the properties Map from which to inject variables
See Also:
VariableSpace.injectVariables(java.util.Map)

findMappingInputStep

public StepMeta findMappingInputStep(String stepname)
                              throws KettleStepException
Finds the mapping input step with the specified name. If no mapping input step is found, null is returned

Parameters:
stepname - the name to search for
Returns:
the step meta-data corresponding to the desired mapping input step, or null if no step was found
Throws:
KettleStepException - if any errors occur during the search

findMappingOutputStep

public StepMeta findMappingOutputStep(String stepname)
                               throws KettleStepException
Finds the mapping output step with the specified name. If no mapping output step is found, null is returned.

Parameters:
stepname - the name to search for
Returns:
the step meta-data corresponding to the desired mapping input step, or null if no step was found
Throws:
KettleStepException - if any errors occur during the search

getResourceDependencies

public List<ResourceReference> getResourceDependencies()
Gets a list of the resource dependencies.

Returns:
a list of ResourceReferences

exportResources

public String exportResources(VariableSpace space,
                              Map<String,ResourceDefinition> definitions,
                              ResourceNamingInterface resourceNamingInterface,
                              Repository repository)
                       throws KettleException
Exports the specified objects 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 export
definitions - the definitions to export
resourceNamingInterface - the resource naming interface
repository - the repository
Returns:
the name of the exported file
Throws:
KettleException - if any errors occur during the export
See Also:
ResourceExportInterface.exportResources(org.pentaho.di.core.variables.VariableSpace, java.util.Map, org.pentaho.di.resource.ResourceNamingInterface, org.pentaho.di.repository.Repository)

getSlaveStepCopyPartitionDistribution

public SlaveStepCopyPartitionDistribution getSlaveStepCopyPartitionDistribution()
Gets the slave step copy partition distribution.

Returns:
the SlaveStepCopyPartitionDistribution

setSlaveStepCopyPartitionDistribution

public void setSlaveStepCopyPartitionDistribution(SlaveStepCopyPartitionDistribution slaveStepCopyPartitionDistribution)
Sets the slave step copy partition distribution.

Parameters:
slaveStepCopyPartitionDistribution - the slaveStepCopyPartitionDistribution to set

findFirstUsedClusterSchema

public ClusterSchema findFirstUsedClusterSchema()
Finds the first used cluster schema.

Returns:
the first used cluster schema

isSlaveTransformation

public boolean isSlaveTransformation()
Checks whether the transformation is a slave transformation.

Returns:
true if the transformation is a slave transformation, false otherwise

setSlaveTransformation

public void setSlaveTransformation(boolean slaveTransformation)
Sets whether the transformation is a slave transformation.

Parameters:
slaveTransformation - true if the transformation is a slave transformation, false otherwise

getRepository

public Repository getRepository()
Gets the repository.

Returns:
the repository

setRepository

public void setRepository(Repository repository)
Sets the repository.

Parameters:
repository - the repository to set

isCapturingStepPerformanceSnapShots

public boolean isCapturingStepPerformanceSnapShots()
Checks whether the transformation is capturing step performance snapshots.

Returns:
true if the transformation is capturing step performance snapshots, false otherwise

setCapturingStepPerformanceSnapShots

public void setCapturingStepPerformanceSnapShots(boolean capturingStepPerformanceSnapShots)
Sets whether the transformation is capturing step performance snapshots.

Parameters:
capturingStepPerformanceSnapShots - true if the transformation is capturing step performance snapshots, false otherwise

getStepPerformanceCapturingDelay

public long getStepPerformanceCapturingDelay()
Gets the step performance capturing delay.

Returns:
the step performance capturing delay

setStepPerformanceCapturingDelay

public void setStepPerformanceCapturingDelay(long stepPerformanceCapturingDelay)
Sets the step performance capturing delay.

Parameters:
stepPerformanceCapturingDelay - the stepPerformanceCapturingDelay to set

getStepPerformanceCapturingSizeLimit

public String getStepPerformanceCapturingSizeLimit()
Gets the step performance capturing size limit.

Returns:
the step performance capturing size limit

setStepPerformanceCapturingSizeLimit

public void setStepPerformanceCapturingSizeLimit(String stepPerformanceCapturingSizeLimit)
Sets the step performance capturing size limit.

Parameters:
stepPerformanceCapturingSizeLimit - the step performance capturing size limit to set

getSharedObjects

public SharedObjects getSharedObjects()
Gets the shared objects.

Returns:
the shared objects

setSharedObjects

public void setSharedObjects(SharedObjects sharedObjects)
Sets the shared objects.

Parameters:
sharedObjects - the SharedObjects to set

clearCaches

public void clearCaches()
Clears the step fields and loop caches.


addNameChangedListener

public void addNameChangedListener(NameChangedListener listener)
Adds a listener for "name changed" events.

Parameters:
listener - the listener to add

removeNameChangedListener

public void removeNameChangedListener(NameChangedListener listener)
Removes the specified NameChangedListener.

Parameters:
listener - the listener

addFilenameChangedListener

public void addFilenameChangedListener(FilenameChangedListener listener)
Adds a listener for "filename changed" events.

Parameters:
listener - the listener to add

removeFilenameChangedListener

public void removeFilenameChangedListener(FilenameChangedListener listener)
Removes the specified FilenameChangedListener.

Parameters:
listener - the listener

activateParameters

public void activateParameters()
Activates the parameters.

Specified by:
activateParameters in interface NamedParams
See Also:
NamedParams.activateParameters()

addParameterDefinition

public void addParameterDefinition(String key,
                                   String defaultValue,
                                   String description)
                            throws DuplicateParamException
Adds the parameter definition.

Specified by:
addParameterDefinition in interface NamedParams
Parameters:
key - the key
defaultValue - the default value
description - the description
Throws:
DuplicateParamException - the duplicate param exception
See Also:
NamedParams.addParameterDefinition(java.lang.String, java.lang.String, java.lang.String)

getParameterDescription

public String getParameterDescription(String key)
                               throws UnknownParamException
Gets the parameter description.

Specified by:
getParameterDescription in interface NamedParams
Parameters:
key - the key
Returns:
the parameter description
Throws:
UnknownParamException - the unknown param exception
See Also:
NamedParams.getParameterDescription(java.lang.String)

getParameterDefault

public String getParameterDefault(String key)
                           throws UnknownParamException
Gets the parameter default.

Specified by:
getParameterDefault in interface NamedParams
Parameters:
key - the key
Returns:
the parameter default
Throws:
UnknownParamException - the unknown param exception
See Also:
NamedParams.getParameterDefault(java.lang.String)

getParameterValue

public String getParameterValue(String key)
                         throws UnknownParamException
Gets the parameter value.

Specified by:
getParameterValue in interface NamedParams
Parameters:
key - the name of the parameter
Returns:
the parameter value
Throws:
UnknownParamException - if no such parameter exists
See Also:
NamedParams.getParameterValue(java.lang.String)

listParameters

public String[] listParameters()
Gets an array of parameter names.

Specified by:
listParameters in interface NamedParams
Returns:
an array of parameter names.
See Also:
NamedParams.listParameters()

setParameterValue

public void setParameterValue(String key,
                              String value)
                       throws UnknownParamException
Sets the specified parameter to the specified value.

Specified by:
setParameterValue in interface NamedParams
Parameters:
key - the name of the parameter
value - the value to set
Throws:
UnknownParamException - if no such parameter exists
See Also:
NamedParams.setParameterValue(java.lang.String, java.lang.String)

eraseParameters

public void eraseParameters()
Erases all parameters (both name and value)

Specified by:
eraseParameters in interface NamedParams
See Also:
NamedParams.eraseParameters()

clearParameters

public void clearParameters()
Clears the parameters' values.

Specified by:
clearParameters in interface NamedParams
See Also:
NamedParams.clearParameters()

copyParametersFrom

public void copyParametersFrom(NamedParams params)
Copy parameters from the specified parameters.

Specified by:
copyParametersFrom in interface NamedParams
Parameters:
params - the parameters from which to copy
See Also:
NamedParams.copyParametersFrom(org.pentaho.di.core.parameters.NamedParams)

getRepositoryElementType

public RepositoryObjectType getRepositoryElementType()
Gets the repository element type.

Specified by:
getRepositoryElementType in interface RepositoryElementInterface
Returns:
the repository element type
See Also:
RepositoryElementInterface.getRepositoryElementType()

setObjectRevision

public void setObjectRevision(ObjectRevision objectRevision)
Sets the object revision.

Specified by:
setObjectRevision in interface RepositoryElementInterface
Parameters:
objectRevision - the new object revision
See Also:
RepositoryElementInterface.setObjectRevision(org.pentaho.di.repository.ObjectRevision)

getObjectRevision

public ObjectRevision getObjectRevision()
Gets the object revision.

Specified by:
getObjectRevision in interface LoggingObjectInterface
Specified by:
getObjectRevision in interface RepositoryElementInterface
Returns:
the object revision
See Also:
RepositoryElementInterface.getObjectRevision()

getLogChannel

public LogChannelInterface getLogChannel()
Gets the log channel.

Returns:
the log channel

getLogChannelId

public String getLogChannelId()
Gets the log channel ID.

Specified by:
getLogChannelId in interface LoggingObjectInterface
Returns:
the log channel ID
See Also:
LoggingObjectInterface.getLogChannelId()

getObjectName

public String getObjectName()
Gets the object name.

Specified by:
getObjectName in interface LoggingObjectInterface
Returns:
the object name
See Also:
LoggingObjectInterface.getObjectName()

getObjectCopy

public String getObjectCopy()
Gets the object copy.

Specified by:
getObjectCopy in interface LoggingObjectInterface
Returns:
the object copy
See Also:
LoggingObjectInterface.getObjectCopy()

getObjectType

public LoggingObjectType getObjectType()
Gets the object type.

Specified by:
getObjectType in interface LoggingObjectInterface
Returns:
the object type
See Also:
LoggingObjectInterface.getObjectType()

getParent

public LoggingObjectInterface getParent()
Gets the interface to the parent log object. For TransMeta, this method always returns null.

Specified by:
getParent in interface LoggingObjectInterface
Returns:
null
See Also:
LoggingObjectInterface.getParent()

getLogLevel

public LogLevel getLogLevel()
Gets the log level for the transformation.

Specified by:
getLogLevel in interface LoggingObjectInterface
Returns:
the log level
See Also:
LoggingObjectInterface.getLogLevel()

setLogLevel

public void setLogLevel(LogLevel logLevel)
Sets the log level for the transformation.

Parameters:
logLevel - the new log level

getTransLogTable

public TransLogTable getTransLogTable()
Gets the log table for the transformation.

Returns:
the log table for the transformation

setTransLogTable

public void setTransLogTable(TransLogTable transLogTable)
Sets the log table for the transformation.

Parameters:
the - log table to set

getDatabaseNames

public String[] getDatabaseNames()
Gets the database names.

Returns:
an array of database names

getPerformanceLogTable

public PerformanceLogTable getPerformanceLogTable()
Gets the performance log table for the transformation.

Returns:
the performance log table for the transformation

setPerformanceLogTable

public void setPerformanceLogTable(PerformanceLogTable performanceLogTable)
Sets the performance log table for the transformation.

Parameters:
performanceLogTable - the performance log table to set

getChannelLogTable

public ChannelLogTable getChannelLogTable()
Gets the channel log table for the transformation.

Returns:
the channel log table for the transformation

setChannelLogTable

public void setChannelLogTable(ChannelLogTable channelLogTable)
Sets the channel log table for the transformation.

Parameters:
channelLogTable - the channel log table to set

getStepLogTable

public StepLogTable getStepLogTable()
Gets the step log table for the transformation.

Returns:
the step log table for the transformation

setStepLogTable

public void setStepLogTable(StepLogTable stepLogTable)
Sets the step log table for the transformation.

Parameters:
stepLogTable - the step log table to set

getLogTables

public List<LogTableInterface> getLogTables()
Gets a list of the log tables (transformation, step, performance, channel) for the transformation.

Returns:
a list of LogTableInterfaces for the transformation

getTransformationType

public TransMeta.TransformationType getTransformationType()
Gets the transformation type.

Returns:
the transformationType

setTransformationType

public void setTransformationType(TransMeta.TransformationType transformationType)
Sets the transformation type.

Parameters:
transformationType - the transformationType to set

canSave

public boolean canSave()
Checks whether the transformation can be saved. For TransMeta, this method always returns true

Specified by:
canSave in interface EngineMetaInterface
Returns:
true
See Also:
EngineMetaInterface.canSave()

getContainerObjectId

public String getContainerObjectId()
Gets the container object ID.

Specified by:
getContainerObjectId in interface LoggingObjectInterface
Returns:
the container object ID to set

setCarteObjectId

public void setCarteObjectId(String containerObjectId)
Sets the carte object ID.

Parameters:
containerObjectId - the container object ID to set

writeXML

public void writeXML(String filename)
              throws KettleXMLException
Utility method to write the XML of this transformation to a file, mostly for testing purposes.

Parameters:
filename - The filename to save to
Throws:
KettleXMLException - in case something goes wrong.

getRegistrationDate

public Date getRegistrationDate()
Gets the registration date for the transformation. For TransMeta, this method always returns null.

Specified by:
getRegistrationDate in interface LoggingObjectInterface
Returns:
null

hasRepositoryReferences

public boolean hasRepositoryReferences()
Checks whether the transformation has repository references.

Returns:
true if the transformation has repository references, false otherwise

lookupRepositoryReferences

public void lookupRepositoryReferences(Repository repository)
                                throws KettleException
Looks up the references after a repository import.

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