Package org.pentaho.di.cluster
Class SlaveServer
- java.lang.Object
-
- org.pentaho.di.core.changed.ChangedFlag
-
- org.pentaho.di.cluster.SlaveServer
-
- All Implemented Interfaces:
Cloneable,ChangedFlagInterface,org.pentaho.di.core.variables.VariableSpace,org.pentaho.di.core.xml.XMLInterface,org.pentaho.di.repository.RepositoryElementInterface,org.pentaho.di.repository.RepositoryObjectInterface,org.pentaho.di.shared.SharedObjectInterface
public class SlaveServer extends ChangedFlag implements Cloneable, org.pentaho.di.shared.SharedObjectInterface, org.pentaho.di.core.variables.VariableSpace, org.pentaho.di.repository.RepositoryElementInterface, org.pentaho.di.core.xml.XMLInterface
-
-
Field Summary
Fields Modifier and Type Field Description static intKETTLE_CARTE_RETRIESstatic intKETTLE_CARTE_RETRY_BACKOFF_INCREMENTSstatic org.pentaho.di.repository.RepositoryObjectTypeREPOSITORY_ELEMENT_TYPEstatic StringSSL_MODE_TAGstatic StringSTRING_SLAVESERVERstatic StringXML_TAG
-
Constructor Summary
Constructors Constructor Description SlaveServer()SlaveServer(String name, String hostname, String port, String username, String password)SlaveServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts, boolean master)SlaveServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts, boolean master, boolean ssl)SlaveServer(Node slaveNode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intallocateServerSocket(String runId, int portRangeStart, String hostname, String transformationName, String sourceSlaveName, String sourceStepName, String sourceStepCopy, String targetSlaveName, String targetStepName, String targetStepCopy)org.pentaho.di.www.WebResultcleanupTransformation(String transName, String carteObjectId)Objectclone()StringconstructUrl(String serviceAndArguments)voidcopyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)org.pentaho.di.www.WebResultdeAllocateServerSockets(String transName, String clusteredRunId)StringenvironmentSubstitute(String aString)String[]environmentSubstitute(String[] aString)booleanequals(Object obj)StringexecService(String service)StringexecService(String service, boolean retry)StringexecService(String service, Map<String,String> headerValues)StringfieldSubstitute(String aString, org.pentaho.di.core.row.RowMetaInterface rowMeta, Object[] rowData)static SlaveServerfindSlaveServer(List<SlaveServer> slaveServers, String name)static SlaveServerfindSlaveServer(List<SlaveServer> slaveServers, org.pentaho.di.repository.ObjectId id)protected org.apache.http.client.protocol.HttpClientContextgetAuthContext()static intgetBackoffIncrements()booleangetBooleanValueOfVariable(String variableName, boolean defaultValue)DategetChangedDate()SlaveServergetClient()static longgetDelay(int trial)StringgetDescription()StringgetHostname()SlaveServerJobStatusgetJobStatus(String jobName, String carteObjectId, int startLogLineNr)PropertiesgetKettleProperties()org.pentaho.di.core.logging.LogChannelInterfacegetLogChannel()StringgetName()longgetNextSlaveSequenceValue(String slaveSequenceName, long incrementValue)StringgetNonProxyHosts()org.pentaho.di.repository.ObjectIdgetObjectId()org.pentaho.di.repository.ObjectRevisiongetObjectRevision()org.pentaho.di.core.variables.VariableSpacegetParentVariableSpace()StringgetPassword()StringgetPort()StringgetPortSpecification()StringgetPropertiesMasterName()StringgetProxyHostname()StringgetProxyPort()org.pentaho.di.repository.RepositoryDirectoryInterfacegetRepositoryDirectory()Not used in this case, simply return root /org.pentaho.di.repository.RepositoryObjectTypegetRepositoryElementType()StringgetServerAndPort()List<SlaveServerDetection>getSlaveServerDetections()static String[]getSlaveServerNames(List<SlaveServer> slaveServers)SslConfigurationgetSslConfig()SlaveServerStatusgetStatus()SlaveServerTransStatusgetTransStatus(String transName, String carteObjectId, int startLogLineNr)SlaveServerTransStatusgetTransStatus(String transName, String carteObjectId, int startLogLineNr, boolean sendResultXmlWithStatus)StringgetUsername()StringgetVariable(String variableName)StringgetVariable(String variableName, String defaultValue)StringgetWebAppName()StringgetXML()inthashCode()voidinitializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)voidinjectVariables(Map<String,String> prop)booleanisMaster()booleanisOverrideExistingProperties()booleanisShared()booleanisSslMode()String[]listVariables()org.pentaho.di.www.WebResultpauseResumeTransformation(String transName, String carteObjectId)org.pentaho.di.www.WebResultremoveJob(String jobName, String carteObjectId)org.pentaho.di.www.WebResultremoveTransformation(String transName, String carteObjectId)voidreplaceMeta(SlaveServer slaveServer)StringsendExport(String filename, String type, String load)Send an exported archive over to this slave serverStringsendXML(String xml, String service)voidsetDescription(String description)voidsetHostname(String urlString)voidsetMaster(boolean master)voidsetName(String name)voidsetNonProxyHosts(String nonProxyHosts)voidsetObjectId(org.pentaho.di.repository.ObjectId id)voidsetObjectRevision(org.pentaho.di.repository.ObjectRevision objectRevision)voidsetParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)voidsetPassword(String password)voidsetPort(String port)voidsetProxyHostname(String proxyHostname)voidsetProxyPort(String proxyPort)voidsetRepositoryDirectory(org.pentaho.di.repository.RepositoryDirectoryInterface repositoryDirectory)voidsetShared(boolean shared)voidsetSslMode(boolean sslMode)voidsetUsername(String username)voidsetVariable(String variableName, String variableValue)voidsetWebAppName(String webAppName)voidshareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)StringsniffStep(String transName, String stepName, String copyNr, int lines, String type)Sniff rows on a the slave server, return xml containing the row metadata and data.org.pentaho.di.www.WebResultstartJob(String jobName, String carteObjectId)org.pentaho.di.www.WebResultstartTransformation(String transName, String carteObjectId)org.pentaho.di.www.WebResultstopJob(String transName, String carteObjectId)org.pentaho.di.www.WebResultstopTransformation(String transName, String carteObjectId)StringtoString()StringverifyAndModifySlaveServerName(List<SlaveServer> slaveServers, String oldname)Verify the name of the slave server and if required, change it if it already exists in the list of slave servers.-
Methods inherited from class org.pentaho.di.core.changed.ChangedFlag
addObserver, clearChanged, deleteObserver, hasChanged, notifyObservers, setChanged, setChanged
-
-
-
-
Field Detail
-
STRING_SLAVESERVER
public static final String STRING_SLAVESERVER
- See Also:
- Constant Field Values
-
XML_TAG
public static final String XML_TAG
- See Also:
- Constant Field Values
-
REPOSITORY_ELEMENT_TYPE
public static final org.pentaho.di.repository.RepositoryObjectType REPOSITORY_ELEMENT_TYPE
-
SSL_MODE_TAG
public static final String SSL_MODE_TAG
- See Also:
- Constant Field Values
-
KETTLE_CARTE_RETRIES
public static final int KETTLE_CARTE_RETRIES
-
KETTLE_CARTE_RETRY_BACKOFF_INCREMENTS
public static final int KETTLE_CARTE_RETRY_BACKOFF_INCREMENTS
-
-
Constructor Detail
-
SlaveServer
public SlaveServer()
-
SlaveServer
public SlaveServer(String name, String hostname, String port, String username, String password)
-
SlaveServer
public SlaveServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts, boolean master)
-
SlaveServer
public SlaveServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts, boolean master, boolean ssl)
-
SlaveServer
public SlaveServer(Node slaveNode)
-
-
Method Detail
-
getBackoffIncrements
public static int getBackoffIncrements()
-
getLogChannel
public org.pentaho.di.core.logging.LogChannelInterface getLogChannel()
-
getXML
public String getXML()
- Specified by:
getXMLin interfaceorg.pentaho.di.shared.SharedObjectInterface- Specified by:
getXMLin interfaceorg.pentaho.di.core.xml.XMLInterface
-
replaceMeta
public void replaceMeta(SlaveServer slaveServer)
-
getServerAndPort
public String getServerAndPort()
-
getHostname
public String getHostname()
-
setHostname
public void setHostname(String urlString)
-
getPassword
public String getPassword()
- Returns:
- the password
-
setPassword
public void setPassword(String password)
- Parameters:
password- the password to set
-
getUsername
public String getUsername()
- Returns:
- the username
-
setUsername
public void setUsername(String username)
- Parameters:
username- the username to set
-
getWebAppName
public String getWebAppName()
- Returns:
- the username
-
setWebAppName
public void setWebAppName(String webAppName)
- Parameters:
webAppName- the web application name to set
-
getNonProxyHosts
public String getNonProxyHosts()
- Returns:
- the nonProxyHosts
-
setNonProxyHosts
public void setNonProxyHosts(String nonProxyHosts)
- Parameters:
nonProxyHosts- the nonProxyHosts to set
-
getProxyHostname
public String getProxyHostname()
- Returns:
- the proxyHostname
-
setProxyHostname
public void setProxyHostname(String proxyHostname)
- Parameters:
proxyHostname- the proxyHostname to set
-
getProxyPort
public String getProxyPort()
- Returns:
- the proxyPort
-
setProxyPort
public void setProxyPort(String proxyPort)
- Parameters:
proxyPort- the proxyPort to set
-
getPropertiesMasterName
public String getPropertiesMasterName()
- Returns:
- the Master name for read properties
-
isOverrideExistingProperties
public boolean isOverrideExistingProperties()
- Returns:
- flag for read properties from Master
-
getPort
public String getPort()
- Returns:
- the port
-
setPort
public void setPort(String port)
- Parameters:
port- the port to set
-
getPortSpecification
public String getPortSpecification()
-
constructUrl
public String constructUrl(String serviceAndArguments) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
sendExport
public String sendExport(String filename, String type, String load) throws Exception
Send an exported archive over to this slave server- Parameters:
filename- The archive to sendtype- The type of file to add to the slave server (AddExportServlet.TYPE_*)load- The filename to load in the archive (the .kjb or .ktr)- Returns:
- the XML of the web result
- Throws:
Exception- in case something goes awry
-
getAuthContext
protected org.apache.http.client.protocol.HttpClientContext getAuthContext()
- Returns:
- HttpClientContext with authorization credentials
-
isMaster
public boolean isMaster()
- Returns:
- the master
-
setMaster
public void setMaster(boolean master)
- Parameters:
master- the master to set
-
execService
public String execService(String service, boolean retry) throws Exception
- Throws:
Exception
-
getDelay
public static long getDelay(int trial)
-
execService
public String execService(String service, Map<String,String> headerValues) throws Exception
- Throws:
Exception
-
getStatus
public SlaveServerStatus getStatus() throws Exception
- Throws:
Exception
-
getSlaveServerDetections
public List<SlaveServerDetection> getSlaveServerDetections() throws Exception
- Throws:
Exception
-
getTransStatus
public SlaveServerTransStatus getTransStatus(String transName, String carteObjectId, int startLogLineNr) throws Exception
- Throws:
Exception
-
getTransStatus
public SlaveServerTransStatus getTransStatus(String transName, String carteObjectId, int startLogLineNr, boolean sendResultXmlWithStatus) throws Exception
- Throws:
Exception
-
getJobStatus
public SlaveServerJobStatus getJobStatus(String jobName, String carteObjectId, int startLogLineNr) throws Exception
- Throws:
Exception
-
stopTransformation
public org.pentaho.di.www.WebResult stopTransformation(String transName, String carteObjectId) throws Exception
- Throws:
Exception
-
pauseResumeTransformation
public org.pentaho.di.www.WebResult pauseResumeTransformation(String transName, String carteObjectId) throws Exception
- Throws:
Exception
-
removeTransformation
public org.pentaho.di.www.WebResult removeTransformation(String transName, String carteObjectId) throws Exception
- Throws:
Exception
-
removeJob
public org.pentaho.di.www.WebResult removeJob(String jobName, String carteObjectId) throws Exception
- Throws:
Exception
-
stopJob
public org.pentaho.di.www.WebResult stopJob(String transName, String carteObjectId) throws Exception
- Throws:
Exception
-
startTransformation
public org.pentaho.di.www.WebResult startTransformation(String transName, String carteObjectId) throws Exception
- Throws:
Exception
-
startJob
public org.pentaho.di.www.WebResult startJob(String jobName, String carteObjectId) throws Exception
- Throws:
Exception
-
cleanupTransformation
public org.pentaho.di.www.WebResult cleanupTransformation(String transName, String carteObjectId) throws Exception
- Throws:
Exception
-
deAllocateServerSockets
public org.pentaho.di.www.WebResult deAllocateServerSockets(String transName, String clusteredRunId) throws Exception
- Throws:
Exception
-
getKettleProperties
public Properties getKettleProperties() throws Exception
- Throws:
Exception
-
findSlaveServer
public static SlaveServer findSlaveServer(List<SlaveServer> slaveServers, String name)
-
findSlaveServer
public static SlaveServer findSlaveServer(List<SlaveServer> slaveServers, org.pentaho.di.repository.ObjectId id)
-
getSlaveServerNames
public static String[] getSlaveServerNames(List<SlaveServer> slaveServers)
-
allocateServerSocket
public int allocateServerSocket(String runId, int portRangeStart, String hostname, String transformationName, String sourceSlaveName, String sourceStepName, String sourceStepCopy, String targetSlaveName, String targetStepName, String targetStepCopy) throws Exception
- Throws:
Exception
-
getName
public String getName()
- Specified by:
getNamein interfaceorg.pentaho.di.repository.RepositoryElementInterface- Specified by:
getNamein interfaceorg.pentaho.di.repository.RepositoryObjectInterface- Specified by:
getNamein interfaceorg.pentaho.di.shared.SharedObjectInterface
-
setName
public void setName(String name)
- Specified by:
setNamein interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
isShared
public boolean isShared()
- Specified by:
isSharedin interfaceorg.pentaho.di.shared.SharedObjectInterface
-
setShared
public void setShared(boolean shared)
- Specified by:
setSharedin interfaceorg.pentaho.di.shared.SharedObjectInterface
-
copyVariablesFrom
public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
- Specified by:
copyVariablesFromin interfaceorg.pentaho.di.core.variables.VariableSpace
-
environmentSubstitute
public String environmentSubstitute(String aString)
- Specified by:
environmentSubstitutein interfaceorg.pentaho.di.core.variables.VariableSpace
-
environmentSubstitute
public String[] environmentSubstitute(String[] aString)
- Specified by:
environmentSubstitutein interfaceorg.pentaho.di.core.variables.VariableSpace
-
fieldSubstitute
public String fieldSubstitute(String aString, org.pentaho.di.core.row.RowMetaInterface rowMeta, Object[] rowData) throws org.pentaho.di.core.exception.KettleValueException
- Specified by:
fieldSubstitutein interfaceorg.pentaho.di.core.variables.VariableSpace- Throws:
org.pentaho.di.core.exception.KettleValueException
-
getParentVariableSpace
public org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
- Specified by:
getParentVariableSpacein interfaceorg.pentaho.di.core.variables.VariableSpace
-
setParentVariableSpace
public void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
- Specified by:
setParentVariableSpacein interfaceorg.pentaho.di.core.variables.VariableSpace
-
getVariable
public String getVariable(String variableName, String defaultValue)
- Specified by:
getVariablein interfaceorg.pentaho.di.core.variables.VariableSpace
-
getVariable
public String getVariable(String variableName)
- Specified by:
getVariablein interfaceorg.pentaho.di.core.variables.VariableSpace
-
getBooleanValueOfVariable
public boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
- Specified by:
getBooleanValueOfVariablein interfaceorg.pentaho.di.core.variables.VariableSpace
-
initializeVariablesFrom
public void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
- Specified by:
initializeVariablesFromin interfaceorg.pentaho.di.core.variables.VariableSpace
-
listVariables
public String[] listVariables()
- Specified by:
listVariablesin interfaceorg.pentaho.di.core.variables.VariableSpace
-
setVariable
public void setVariable(String variableName, String variableValue)
- Specified by:
setVariablein interfaceorg.pentaho.di.core.variables.VariableSpace
-
shareVariablesWith
public void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
- Specified by:
shareVariablesWithin interfaceorg.pentaho.di.core.variables.VariableSpace
-
injectVariables
public void injectVariables(Map<String,String> prop)
- Specified by:
injectVariablesin interfaceorg.pentaho.di.core.variables.VariableSpace
-
getObjectId
public org.pentaho.di.repository.ObjectId getObjectId()
- Specified by:
getObjectIdin interfaceorg.pentaho.di.repository.RepositoryElementInterface- Specified by:
getObjectIdin interfaceorg.pentaho.di.repository.RepositoryObjectInterface
-
setObjectId
public void setObjectId(org.pentaho.di.repository.ObjectId id)
- Specified by:
setObjectIdin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getRepositoryDirectory
public org.pentaho.di.repository.RepositoryDirectoryInterface getRepositoryDirectory()
Not used in this case, simply return root /- Specified by:
getRepositoryDirectoryin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setRepositoryDirectory
public void setRepositoryDirectory(org.pentaho.di.repository.RepositoryDirectoryInterface repositoryDirectory)
- Specified by:
setRepositoryDirectoryin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getRepositoryElementType
public org.pentaho.di.repository.RepositoryObjectType getRepositoryElementType()
- Specified by:
getRepositoryElementTypein interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getObjectRevision
public org.pentaho.di.repository.ObjectRevision getObjectRevision()
- Specified by:
getObjectRevisionin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setObjectRevision
public void setObjectRevision(org.pentaho.di.repository.ObjectRevision objectRevision)
- Specified by:
setObjectRevisionin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setDescription
public void setDescription(String description)
- Specified by:
setDescriptionin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
verifyAndModifySlaveServerName
public String verifyAndModifySlaveServerName(List<SlaveServer> slaveServers, String oldname)
Verify the name of the slave server and if required, change it if it already exists in the list of slave servers.- Parameters:
slaveServers- the slave servers to check against.oldname- the old name of the slave server- Returns:
- the new slave server name
-
sniffStep
public String sniffStep(String transName, String stepName, String copyNr, int lines, String type) throws Exception
Sniff rows on a the slave server, return xml containing the row metadata and data.- Parameters:
transName- transformation namestepName- step namecopyNr- step copy numberlines- lines numbertype- step type- Returns:
- xml with row metadata and data
- Throws:
Exception
-
getNextSlaveSequenceValue
public long getNextSlaveSequenceValue(String slaveSequenceName, long incrementValue) throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.KettleException
-
getClient
public SlaveServer getClient()
-
getChangedDate
public Date getChangedDate()
- Specified by:
getChangedDatein interfaceorg.pentaho.di.shared.SharedObjectInterface- Returns:
- the changedDate
-
setSslMode
public void setSslMode(boolean sslMode)
- Parameters:
sslMode-
-
isSslMode
public boolean isSslMode()
- Returns:
- the sslMode
-
getSslConfig
public SslConfiguration getSslConfig()
- Returns:
- the sslConfig
-
-