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 -
Constructor Summary
ConstructorsConstructorDescriptionSlaveServer(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
Modifier and TypeMethodDescriptionintallocateServerSocket(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) clone()constructUrl(String serviceAndArguments) voidcopyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space) org.pentaho.di.www.WebResultdeAllocateServerSockets(String transName, String clusteredRunId) environmentSubstitute(String aString) String[]environmentSubstitute(String[] aString) booleanexecService(String service) execService(String service, boolean retry) execService(String service, Map<String, String> headerValues) fieldSubstitute(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.HttpClientContextstatic intbooleangetBooleanValueOfVariable(String variableName, boolean defaultValue) static longgetDelay(int trial) getJobStatus(String jobName, String carteObjectId, int startLogLineNr) getJobStatusTail(String jobName, String carteObjectId, int maxNumberOfLines) org.pentaho.di.core.logging.LogChannelInterfacegetName()longgetNextSlaveSequenceValue(String slaveSequenceName, long incrementValue) org.pentaho.di.repository.ObjectIdorg.pentaho.di.repository.ObjectRevisionorg.pentaho.di.core.variables.VariableSpacegetPort()org.pentaho.di.repository.RepositoryDirectoryInterfaceNot used in this case, simply return root /org.pentaho.di.repository.RepositoryObjectTypestatic String[]getSlaveServerNames(List<SlaveServer> slaveServers) getTransStatus(String transName, String carteObjectId, int startLogLineNr) getTransStatus(String transName, String carteObjectId, int startLogLineNr, boolean sendResultXmlWithStatus) getVariable(String variableName) getVariable(String variableName, String defaultValue) getXML()inthashCode()voidinitializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent) voidinjectVariables(Map<String, String> prop) booleanisMaster()booleanbooleanisShared()booleanString[]org.pentaho.di.www.WebResultpauseResumeTransformation(String transName, String carteObjectId) org.pentaho.di.www.WebResultorg.pentaho.di.www.WebResultremoveTransformation(String transName, String carteObjectId) voidreplaceMeta(SlaveServer slaveServer) sendExport(String filename, String type, String load) Send an exported archive over to this slave servervoidsetDescription(String description) voidsetHostname(String urlString) voidsetMaster(boolean master) voidvoidsetNonProxyHosts(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) voidvoidsetProxyHostname(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) Sniff rows on a the slave server, return xml containing the row metadata and data.org.pentaho.di.www.WebResultorg.pentaho.di.www.WebResultstartTransformation(String transName, String carteObjectId) org.pentaho.di.www.WebResultorg.pentaho.di.www.WebResultstopTransformation(String transName, String carteObjectId) toString()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.Methods inherited from class org.pentaho.di.core.changed.ChangedFlag
addObserver, clearChanged, deleteObserver, hasChanged, notifyObservers, setChanged, setChangedMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.pentaho.di.core.variables.VariableSpace
environmentSubstitute
-
Field Details
-
STRING_SLAVESERVER
- See Also:
-
XML_TAG
- See Also:
-
REPOSITORY_ELEMENT_TYPE
public static final org.pentaho.di.repository.RepositoryObjectType REPOSITORY_ELEMENT_TYPE -
SSL_MODE_TAG
- See Also:
-
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 Details
-
SlaveServer
public SlaveServer() -
SlaveServer
-
SlaveServer
-
SlaveServer
-
SlaveServer
-
-
Method Details
-
getBackoffIncrements
public static int getBackoffIncrements() -
getLogChannel
public org.pentaho.di.core.logging.LogChannelInterface getLogChannel() -
getXML
- Specified by:
getXMLin interfaceorg.pentaho.di.shared.SharedObjectInterface- Specified by:
getXMLin interfaceorg.pentaho.di.core.xml.XMLInterface
-
clone
-
replaceMeta
-
toString
-
getServerAndPort
-
equals
-
hashCode
public int hashCode() -
getHostname
-
setHostname
-
getPassword
- Returns:
- the password
-
setPassword
- Parameters:
password- the password to set
-
getUsername
- Returns:
- the username
-
setUsername
- Parameters:
username- the username to set
-
getWebAppName
- Returns:
- the username
-
setWebAppName
- Parameters:
webAppName- the web application name to set
-
getNonProxyHosts
- Returns:
- the nonProxyHosts
-
setNonProxyHosts
- Parameters:
nonProxyHosts- the nonProxyHosts to set
-
getProxyHostname
- Returns:
- the proxyHostname
-
setProxyHostname
- Parameters:
proxyHostname- the proxyHostname to set
-
getProxyPort
- Returns:
- the proxyPort
-
setProxyPort
- Parameters:
proxyPort- the proxyPort to set
-
getPropertiesMasterName
- Returns:
- the Master name for read properties
-
isOverrideExistingProperties
public boolean isOverrideExistingProperties()- Returns:
- flag for read properties from Master
-
getPort
- Returns:
- the port
-
setPort
- Parameters:
port- the port to set
-
getPortSpecification
-
constructUrl
- Throws:
UnsupportedEncodingException
-
sendXML
- Throws:
Exception
-
sendExport
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
- Throws:
Exception
-
getDelay
public static long getDelay(int trial) -
execService
- Throws:
Exception
-
execService
- Throws:
Exception
-
getStatus
- Throws:
Exception
-
getSlaveServerDetections
- 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
-
getJobStatusTail
public SlaveServerJobStatus getJobStatusTail(String jobName, String carteObjectId, int maxNumberOfLines) 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
- 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
- Throws:
Exception
-
findSlaveServer
-
findSlaveServer
public static SlaveServer findSlaveServer(List<SlaveServer> slaveServers, org.pentaho.di.repository.ObjectId id) -
getSlaveServerNames
-
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
- 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
- Specified by:
setNamein interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
copyVariablesFrom
public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space) - Specified by:
copyVariablesFromin interfaceorg.pentaho.di.core.variables.VariableSpace
-
environmentSubstitute
- Specified by:
environmentSubstitutein interfaceorg.pentaho.di.core.variables.VariableSpace
-
environmentSubstitute
- 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
- Specified by:
getVariablein interfaceorg.pentaho.di.core.variables.VariableSpace
-
getVariable
- Specified by:
getVariablein interfaceorg.pentaho.di.core.variables.VariableSpace
-
getBooleanValueOfVariable
- 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
- Specified by:
listVariablesin interfaceorg.pentaho.di.core.variables.VariableSpace
-
setVariable
- Specified by:
setVariablein interfaceorg.pentaho.di.core.variables.VariableSpace
-
injectVariables
- 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
- Specified by:
getDescriptionin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setDescription
- Specified by:
setDescriptionin interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
verifyAndModifySlaveServerName
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
-
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
- Returns:
- the sslConfig
-