org.pentaho.di.trans.steps.scriptvalues_mod
Class ScriptValuesModDummy

java.lang.Object
  extended by org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesModDummy
All Implemented Interfaces:
org.pentaho.di.core.variables.VariableSpace, StepInterface, ScriptValuesModInterface

public class ScriptValuesModDummy
extends Object
implements StepInterface, ScriptValuesModInterface

Dummy class used for test().


Constructor Summary
ScriptValuesModDummy(org.pentaho.di.core.row.RowMetaInterface inputRowMeta, org.pentaho.di.core.row.RowMetaInterface outputRowMeta)
           
 
Method Summary
 void addRowListener(RowListener rowListener)
          Add a rowlistener to the step allowing you to inspect (or manipulate, be careful) the rows coming in or exiting the step.
 void addStepListener(StepListener stepListener)
          Attach a step listener to be notified when a step arrives in a certain state.
 void cleanup()
          Call this method typically, after ALL the slave transformations in a clustered run have finished.
 void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
           
 void dispose(StepMetaInterface sii, StepDataInterface sdi)
          Dispose of this step: close files, empty logs, etc.
 String environmentSubstitute(String aString)
           
 String[] environmentSubstitute(String[] string)
           
 boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
           
 int getCopy()
           
 long getErrors()
          Get the number of errors
 org.pentaho.di.core.row.RowMetaInterface getInputRowMeta()
           
 List<org.pentaho.di.core.RowSet> getInputRowSets()
           
 long getLinesInput()
           
 long getLinesOutput()
           
 long getLinesRead()
           
 long getLinesRejected()
           
 long getLinesUpdated()
           
 long getLinesWritten()
           
 org.pentaho.di.core.row.RowMetaInterface getOutputRowMeta()
           
 List<org.pentaho.di.core.RowSet> getOutputRowSets()
           
 org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
           
 String getPartitionID()
           
 Object[] getRow()
           
 List<RowListener> getRowListeners()
           
 String getStepID()
           
 StepMeta getStepMeta()
           
 String getStepname()
          Get the name of the step.
 String getVariable(String variableName)
           
 String getVariable(String variableName, String defaultValue)
           
 boolean init(StepMetaInterface stepMetaInterface, StepDataInterface stepDataInterface)
          Initialise and do work where other steps need to wait for...
 void initBeforeStart()
          This method is executed by Trans right before the threads start and right after initialization.

!!! A plugin implementing this method should make sure to also call super.initBeforeStart(); !!!
 void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
           
 void injectVariables(Map<String,String> prop)
           
 boolean isAlive()
          Is the thread still alive?
 boolean isMapping()
           
 boolean isPartitioned()
           
 boolean isStopped()
           
 String[] listVariables()
           
 void markStart()
          Mark the start time of the step.
 void markStop()
          Mark the end time of the step.
 void pauseRunning()
          Pause a running step
 boolean processRow(StepMetaInterface smi, StepDataInterface sdi)
          Process one row.
 void putRow(org.pentaho.di.core.row.RowMetaInterface rowMeta, Object[] row)
          Put a row on the destination rowsets.
 void removeRowListener(RowListener rowListener)
          Remove a rowlistener from this step.
 void resumeRunning()
          Resume a running step
 void run()
          Run is where the action happens in a step...
 void setErrors(long errors)
          Sets the number of errors
 void setLinesRejected(long linesRejected)
           
 void setOutputDone()
          Signal output done to destination steps
 void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
           
 void setPartitionID(String partitionID)
           
 void setVariable(String variableName, String variableValue)
           
 void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
           
 void start()
          Starts the thread...
 void stopAll()
          Flags all rowsets as stopped/completed/finished.
 void stopRunning(StepMetaInterface stepMetaInterface, StepDataInterface stepDataInterface)
          Stop running operations...
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptValuesModDummy

public ScriptValuesModDummy(org.pentaho.di.core.row.RowMetaInterface inputRowMeta,
                            org.pentaho.di.core.row.RowMetaInterface outputRowMeta)
Method Detail

processRow

public boolean processRow(StepMetaInterface smi,
                          StepDataInterface sdi)
                   throws org.pentaho.di.core.exception.KettleException
Description copied from interface: StepInterface
Process one row.

Specified by:
processRow in interface StepInterface
Specified by:
processRow in interface ScriptValuesModInterface
Parameters:
smi - The metadata to work with
sdi - The temporary working data to work with (database connections, resultsets, caches, temporary variables, etc.)
Returns:
false if no more rows can be processed or an error occurred.
Throws:
org.pentaho.di.core.exception.KettleException

addRowListener

public void addRowListener(RowListener rowListener)
Description copied from interface: StepInterface
Add a rowlistener to the step allowing you to inspect (or manipulate, be careful) the rows coming in or exiting the step.

Specified by:
addRowListener in interface StepInterface
Specified by:
addRowListener in interface ScriptValuesModInterface
Parameters:
rowListener - the rowlistener to add

dispose

public void dispose(StepMetaInterface sii,
                    StepDataInterface sdi)
Description copied from interface: StepInterface
Dispose of this step: close files, empty logs, etc.

Specified by:
dispose in interface StepInterface
Specified by:
dispose in interface ScriptValuesModInterface
Parameters:
sii - The metadata to work with
sdi - The data to dispose of

getErrors

public long getErrors()
Description copied from interface: StepInterface
Get the number of errors

Specified by:
getErrors in interface StepInterface
Specified by:
getErrors in interface ScriptValuesModInterface
Returns:
the number of errors

getInputRowSets

public List<org.pentaho.di.core.RowSet> getInputRowSets()
Specified by:
getInputRowSets in interface StepInterface
Specified by:
getInputRowSets in interface ScriptValuesModInterface
Returns:
The list of active input rowsets for the step

getLinesInput

public long getLinesInput()
Specified by:
getLinesInput in interface StepInterface
Specified by:
getLinesInput in interface ScriptValuesModInterface
Returns:
Returns the linesInput.

getLinesOutput

public long getLinesOutput()
Specified by:
getLinesOutput in interface StepInterface
Specified by:
getLinesOutput in interface ScriptValuesModInterface
Returns:
Returns the linesOutput.

getLinesRead

public long getLinesRead()
Specified by:
getLinesRead in interface StepInterface
Specified by:
getLinesRead in interface ScriptValuesModInterface
Returns:
Returns the linesRead.

getLinesUpdated

public long getLinesUpdated()
Specified by:
getLinesUpdated in interface StepInterface
Specified by:
getLinesUpdated in interface ScriptValuesModInterface
Returns:
Returns the linesUpdated.

getLinesWritten

public long getLinesWritten()
Specified by:
getLinesWritten in interface StepInterface
Specified by:
getLinesWritten in interface ScriptValuesModInterface
Returns:
Returns the linesWritten.

getLinesRejected

public long getLinesRejected()
Specified by:
getLinesRejected in interface StepInterface
Specified by:
getLinesRejected in interface ScriptValuesModInterface
Returns:
Returns the lines rejected by error handling.

getOutputRowSets

public List<org.pentaho.di.core.RowSet> getOutputRowSets()
Specified by:
getOutputRowSets in interface StepInterface
Specified by:
getOutputRowSets in interface ScriptValuesModInterface
Returns:
The list of active output rowsets for the step

getPartitionID

public String getPartitionID()
Specified by:
getPartitionID in interface StepInterface
Specified by:
getPartitionID in interface ScriptValuesModInterface
Returns:
the steps partition ID

getRow

public Object[] getRow()
                throws org.pentaho.di.core.exception.KettleException
Specified by:
getRow in interface StepInterface
Specified by:
getRow in interface ScriptValuesModInterface
Returns:
a row from the source step(s).
Throws:
org.pentaho.di.core.exception.KettleException

getRowListeners

public List<RowListener> getRowListeners()
Specified by:
getRowListeners in interface StepInterface
Specified by:
getRowListeners in interface ScriptValuesModInterface
Returns:
a list of the installed RowListeners

getStepID

public String getStepID()
Specified by:
getStepID in interface StepInterface
Specified by:
getStepID in interface ScriptValuesModInterface
Returns:
the type ID of the step...

getStepname

public String getStepname()
Description copied from interface: StepInterface
Get the name of the step.

Specified by:
getStepname in interface StepInterface
Specified by:
getStepname in interface ScriptValuesModInterface
Returns:
the name of the step

init

public boolean init(StepMetaInterface stepMetaInterface,
                    StepDataInterface stepDataInterface)
Description copied from interface: StepInterface
Initialise and do work where other steps need to wait for...

Specified by:
init in interface StepInterface
Specified by:
init in interface ScriptValuesModInterface
Parameters:
stepMetaInterface - The metadata to work with
stepDataInterface - The data to initialize

isAlive

public boolean isAlive()
Description copied from interface: StepInterface
Is the thread still alive?

Specified by:
isAlive in interface StepInterface
Specified by:
isAlive in interface ScriptValuesModInterface
Returns:
true if the thread is still alive...

isPartitioned

public boolean isPartitioned()
Specified by:
isPartitioned in interface StepInterface
Specified by:
isPartitioned in interface ScriptValuesModInterface
Returns:
true if the step is running partitioned

isStopped

public boolean isStopped()
Specified by:
isStopped in interface StepInterface
Specified by:
isStopped in interface ScriptValuesModInterface
Returns:
True if the step is marked as stopped. Execution should stop immediate.

markStart

public void markStart()
Description copied from interface: StepInterface
Mark the start time of the step.

Specified by:
markStart in interface StepInterface
Specified by:
markStart in interface ScriptValuesModInterface

markStop

public void markStop()
Description copied from interface: StepInterface
Mark the end time of the step.

Specified by:
markStop in interface StepInterface
Specified by:
markStop in interface ScriptValuesModInterface

putRow

public void putRow(org.pentaho.di.core.row.RowMetaInterface rowMeta,
                   Object[] row)
            throws org.pentaho.di.core.exception.KettleException
Description copied from interface: StepInterface
Put a row on the destination rowsets.

Specified by:
putRow in interface StepInterface
Specified by:
putRow in interface ScriptValuesModInterface
Parameters:
rowMeta - The row to send to the destinations steps
Throws:
org.pentaho.di.core.exception.KettleException

removeRowListener

public void removeRowListener(RowListener rowListener)
Description copied from interface: StepInterface
Remove a rowlistener from this step.

Specified by:
removeRowListener in interface StepInterface
Specified by:
removeRowListener in interface ScriptValuesModInterface
Parameters:
rowListener - the rowlistener to remove

run

public void run()
Description copied from interface: StepInterface
Run is where the action happens in a step...

Specified by:
run in interface StepInterface
Specified by:
run in interface ScriptValuesModInterface

setErrors

public void setErrors(long errors)
Description copied from interface: StepInterface
Sets the number of errors

Specified by:
setErrors in interface StepInterface
Specified by:
setErrors in interface ScriptValuesModInterface
Parameters:
errors - the number of errors to set

setOutputDone

public void setOutputDone()
Description copied from interface: StepInterface
Signal output done to destination steps

Specified by:
setOutputDone in interface StepInterface
Specified by:
setOutputDone in interface ScriptValuesModInterface

setPartitionID

public void setPartitionID(String partitionID)
Specified by:
setPartitionID in interface StepInterface
Specified by:
setPartitionID in interface ScriptValuesModInterface
Parameters:
partitionID - the partitionID to set

start

public void start()
Description copied from interface: StepInterface
Starts the thread...

Specified by:
start in interface StepInterface
Specified by:
start in interface ScriptValuesModInterface

stopAll

public void stopAll()
Description copied from interface: StepInterface
Flags all rowsets as stopped/completed/finished.

Specified by:
stopAll in interface StepInterface
Specified by:
stopAll in interface ScriptValuesModInterface

stopRunning

public void stopRunning(StepMetaInterface stepMetaInterface,
                        StepDataInterface stepDataInterface)
                 throws org.pentaho.di.core.exception.KettleException
Description copied from interface: StepInterface
Stop running operations...

Specified by:
stopRunning in interface StepInterface
Specified by:
stopRunning in interface ScriptValuesModInterface
Parameters:
stepMetaInterface - The metadata that might be needed by the step to stop running.
stepDataInterface - The interface to the step data containing the connections, resultsets, open files, etc.
Throws:
org.pentaho.di.core.exception.KettleException

cleanup

public void cleanup()
Description copied from interface: StepInterface
Call this method typically, after ALL the slave transformations in a clustered run have finished.

Specified by:
cleanup in interface StepInterface
Specified by:
cleanup in interface ScriptValuesModInterface

pauseRunning

public void pauseRunning()
Description copied from interface: StepInterface
Pause a running step

Specified by:
pauseRunning in interface StepInterface
Specified by:
pauseRunning in interface ScriptValuesModInterface

resumeRunning

public void resumeRunning()
Description copied from interface: StepInterface
Resume a running step

Specified by:
resumeRunning in interface StepInterface
Specified by:
resumeRunning in interface ScriptValuesModInterface

copyVariablesFrom

public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
Specified by:
copyVariablesFrom in interface org.pentaho.di.core.variables.VariableSpace

environmentSubstitute

public String environmentSubstitute(String aString)
Specified by:
environmentSubstitute in interface org.pentaho.di.core.variables.VariableSpace

environmentSubstitute

public String[] environmentSubstitute(String[] string)
Specified by:
environmentSubstitute in interface org.pentaho.di.core.variables.VariableSpace

getBooleanValueOfVariable

public boolean getBooleanValueOfVariable(String variableName,
                                         boolean defaultValue)
Specified by:
getBooleanValueOfVariable in interface org.pentaho.di.core.variables.VariableSpace

getParentVariableSpace

public org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
Specified by:
getParentVariableSpace in interface org.pentaho.di.core.variables.VariableSpace

setParentVariableSpace

public void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
Specified by:
setParentVariableSpace in interface org.pentaho.di.core.variables.VariableSpace

getVariable

public String getVariable(String variableName,
                          String defaultValue)
Specified by:
getVariable in interface org.pentaho.di.core.variables.VariableSpace

getVariable

public String getVariable(String variableName)
Specified by:
getVariable in interface org.pentaho.di.core.variables.VariableSpace

initializeVariablesFrom

public void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
Specified by:
initializeVariablesFrom in interface org.pentaho.di.core.variables.VariableSpace

injectVariables

public void injectVariables(Map<String,String> prop)
Specified by:
injectVariables in interface org.pentaho.di.core.variables.VariableSpace

listVariables

public String[] listVariables()
Specified by:
listVariables in interface org.pentaho.di.core.variables.VariableSpace

setVariable

public void setVariable(String variableName,
                        String variableValue)
Specified by:
setVariable in interface org.pentaho.di.core.variables.VariableSpace

shareVariablesWith

public void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
Specified by:
shareVariablesWith in interface org.pentaho.di.core.variables.VariableSpace

getInputRowMeta

public org.pentaho.di.core.row.RowMetaInterface getInputRowMeta()

getOutputRowMeta

public org.pentaho.di.core.row.RowMetaInterface getOutputRowMeta()

initBeforeStart

public void initBeforeStart()
                     throws org.pentaho.di.core.exception.KettleStepException
Description copied from interface: StepInterface
This method is executed by Trans right before the threads start and right after initialization.

!!! A plugin implementing this method should make sure to also call super.initBeforeStart(); !!!

Specified by:
initBeforeStart in interface StepInterface
Throws:
org.pentaho.di.core.exception.KettleStepException - In case there is an error

setLinesRejected

public void setLinesRejected(long linesRejected)
Specified by:
setLinesRejected in interface StepInterface
Parameters:
linesRejected - steps the lines rejected by error handling.

getCopy

public int getCopy()
Specified by:
getCopy in interface StepInterface
Returns:
The steps copy number (default 0)

addStepListener

public void addStepListener(StepListener stepListener)
Description copied from interface: StepInterface
Attach a step listener to be notified when a step arrives in a certain state. (finished)

Specified by:
addStepListener in interface StepInterface
Parameters:
stepListener - The listener to add to the step

isMapping

public boolean isMapping()
Specified by:
isMapping in interface StepInterface
Returns:
true if the thread is a special mapping step

getStepMeta

public StepMeta getStepMeta()
Specified by:
getStepMeta in interface StepInterface
Returns:
The metadata for this step