org.pentaho.di.www
Class TransformationMap

java.lang.Object
  extended by org.pentaho.di.www.TransformationMap

public class TransformationMap
extends Object

This is a map between the transformation name and the (running/waiting/finished) transformation.

Author:
Matt

Constructor Summary
TransformationMap()
           
 
Method Summary
 void addTransformation(String transformationName, String containerObjectId, Trans trans, TransConfiguration transConfiguration)
          Add a transformation to the map
 SocketPortAllocation allocateServerSocketPort(int portRangeStart, String hostname, String clusteredRunId, String transformationName, String sourceSlaveName, String sourceStepName, String sourceStepCopy, String targetSlaveName, String targetStepName, String targetStepCopy)
          This is the meat of the whole problem.
 SlaveSequence createSlaveSequence(String name)
           
 void deallocateServerSocketPort(int port, String hostname)
           
 void deallocateServerSocketPorts(CarteObjectEntry entry)
          Deallocate all the ports for the given transformation entry, across all hosts.
 void deallocateServerSocketPorts(String transName, String carteObjectId)
          Deallocate all the ports for the given transformation name, across all hosts.
 TransConfiguration getConfiguration(CarteObjectEntry entry)
           
 TransConfiguration getConfiguration(String transformationName)
           
 Map<CarteObjectEntry,TransConfiguration> getConfigurationMap()
           
 CarteObjectEntry getFirstCarteObjectEntry(String transName)
           
 Map<String,List<SocketPortAllocation>> getHostServerSocketPortsMap()
           
 SlaveSequence getSlaveSequence(String name)
           
 SlaveServerConfig getSlaveServerConfig()
           
 Trans getTransformation(CarteObjectEntry entry)
           
 Trans getTransformation(String transformationName)
          Find the first transformation in the list that comes to mind!
 List<CarteObjectEntry> getTransformationObjects()
           
 boolean isAutomaticSlaveSequenceCreationAllowed()
           
 void removeTransformation(CarteObjectEntry entry)
           
 void setConfigurationMap(Map<CarteObjectEntry,TransConfiguration> configurationMap)
           
 void setHostServerSocketPortsMap(Map<String,List<SocketPortAllocation>> hostServerSocketPortsMap)
           
 void setSlaveServerConfig(SlaveServerConfig slaveServerConfig)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformationMap

public TransformationMap()
Method Detail

addTransformation

public void addTransformation(String transformationName,
                              String containerObjectId,
                              Trans trans,
                              TransConfiguration transConfiguration)
Add a transformation to the map

Parameters:
transformationName - The name of the transformation to add
containerObjectId - the unique ID of the transformation in this container.
trans - The transformation to add
transConfiguration - the transformation configuration to add

getTransformation

public Trans getTransformation(String transformationName)
Find the first transformation in the list that comes to mind!

Parameters:
transformationName -
Returns:
the first transformation with the specified name

getTransformation

public Trans getTransformation(CarteObjectEntry entry)
Parameters:
entry - The Carte transformation object
Returns:
the transformation with the specified entry

getConfiguration

public TransConfiguration getConfiguration(String transformationName)
Parameters:
transformationName -
Returns:
The first transformation configuration with the specified name

getConfiguration

public TransConfiguration getConfiguration(CarteObjectEntry entry)
Parameters:
entry - The Carte transformation object
Returns:
the transformation configuration with the specified entry

removeTransformation

public void removeTransformation(CarteObjectEntry entry)
Parameters:
entry - the Carte object entry

getTransformationObjects

public List<CarteObjectEntry> getTransformationObjects()

getConfigurationMap

public Map<CarteObjectEntry,TransConfiguration> getConfigurationMap()
Returns:
the configurationMap

setConfigurationMap

public void setConfigurationMap(Map<CarteObjectEntry,TransConfiguration> configurationMap)
Parameters:
configurationMap - the configurationMap to set

allocateServerSocketPort

public SocketPortAllocation allocateServerSocketPort(int portRangeStart,
                                                     String hostname,
                                                     String clusteredRunId,
                                                     String transformationName,
                                                     String sourceSlaveName,
                                                     String sourceStepName,
                                                     String sourceStepCopy,
                                                     String targetSlaveName,
                                                     String targetStepName,
                                                     String targetStepCopy)
This is the meat of the whole problem. We'll allocate a port for a given slave, transformation and step copy, always on the same host. Algorithm: 1) Search for the right map in the hostPortMap

Parameters:
portRangeStart - the start of the port range as described in the used cluster schema
hostname - the host name to allocate this address for
clusteredRunId - A unique id, created for each new clustered run during transformation split.
transformationName -
sourceStepName -
sourceStepCopy -
Returns:

deallocateServerSocketPorts

public void deallocateServerSocketPorts(String transName,
                                        String carteObjectId)
Deallocate all the ports for the given transformation name, across all hosts.

Parameters:
transName - the transformation name to release
carteObjectId - the carte object ID to reference

deallocateServerSocketPorts

public void deallocateServerSocketPorts(CarteObjectEntry entry)
Deallocate all the ports for the given transformation entry, across all hosts.

Parameters:
entry - the transformation object entry name to release the sockets for

deallocateServerSocketPort

public void deallocateServerSocketPort(int port,
                                       String hostname)

getFirstCarteObjectEntry

public CarteObjectEntry getFirstCarteObjectEntry(String transName)

getSlaveServerConfig

public SlaveServerConfig getSlaveServerConfig()
Returns:
the slaveServerConfig

setSlaveServerConfig

public void setSlaveServerConfig(SlaveServerConfig slaveServerConfig)
Parameters:
slaveServerConfig - the slaveServerConfig to set

getHostServerSocketPortsMap

public Map<String,List<SocketPortAllocation>> getHostServerSocketPortsMap()
Returns:
the hostServerSocketPortsMap

setHostServerSocketPortsMap

public void setHostServerSocketPortsMap(Map<String,List<SocketPortAllocation>> hostServerSocketPortsMap)
Parameters:
hostServerSocketPortsMap - the hostServerSocketPortsMap to set

getSlaveSequence

public SlaveSequence getSlaveSequence(String name)

isAutomaticSlaveSequenceCreationAllowed

public boolean isAutomaticSlaveSequenceCreationAllowed()

createSlaveSequence

public SlaveSequence createSlaveSequence(String name)
                                  throws KettleException
Throws:
KettleException