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
-
Constructor Summary
ConstructorDescriptionSlaveServer
(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 TypeMethodDescriptionint
allocateServerSocket
(String runId, int portRangeStart, String hostname, String transformationName, String sourceSlaveName, String sourceStepName, String sourceStepCopy, String targetSlaveName, String targetStepName, String targetStepCopy) org.pentaho.di.www.WebResult
cleanupTransformation
(String transName, String carteObjectId) clone()
constructUrl
(String serviceAndArguments) void
copyVariablesFrom
(org.pentaho.di.core.variables.VariableSpace space) org.pentaho.di.www.WebResult
deAllocateServerSockets
(String transName, String clusteredRunId) environmentSubstitute
(String aString) String[]
environmentSubstitute
(String[] aString) boolean
execService
(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 SlaveServer
findSlaveServer
(List<SlaveServer> slaveServers, String name) static SlaveServer
findSlaveServer
(List<SlaveServer> slaveServers, org.pentaho.di.repository.ObjectId id) protected org.apache.http.client.protocol.HttpClientContext
static int
boolean
getBooleanValueOfVariable
(String variableName, boolean defaultValue) static long
getDelay
(int trial) getJobStatus
(String jobName, String carteObjectId, int startLogLineNr) getJobStatusTail
(String jobName, String carteObjectId, int maxNumberOfLines) org.pentaho.di.core.logging.LogChannelInterface
getName()
long
getNextSlaveSequenceValue
(String slaveSequenceName, long incrementValue) org.pentaho.di.repository.ObjectId
org.pentaho.di.repository.ObjectRevision
org.pentaho.di.core.variables.VariableSpace
getPort()
org.pentaho.di.repository.RepositoryDirectoryInterface
Not used in this case, simply return root /org.pentaho.di.repository.RepositoryObjectType
static 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()
int
hashCode()
void
initializeVariablesFrom
(org.pentaho.di.core.variables.VariableSpace parent) void
injectVariables
(Map<String, String> prop) boolean
isMaster()
boolean
boolean
isShared()
boolean
String[]
org.pentaho.di.www.WebResult
pauseResumeTransformation
(String transName, String carteObjectId) org.pentaho.di.www.WebResult
org.pentaho.di.www.WebResult
removeTransformation
(String transName, String carteObjectId) void
replaceMeta
(SlaveServer slaveServer) sendExport
(String filename, String type, String load) Send an exported archive over to this slave servervoid
setDescription
(String description) void
setHostname
(String urlString) void
setMaster
(boolean master) void
void
setNonProxyHosts
(String nonProxyHosts) void
setObjectId
(org.pentaho.di.repository.ObjectId id) void
setObjectRevision
(org.pentaho.di.repository.ObjectRevision objectRevision) void
setParentVariableSpace
(org.pentaho.di.core.variables.VariableSpace parent) void
setPassword
(String password) void
void
setProxyHostname
(String proxyHostname) void
setProxyPort
(String proxyPort) void
setRepositoryDirectory
(org.pentaho.di.repository.RepositoryDirectoryInterface repositoryDirectory) void
setShared
(boolean shared) void
setSslMode
(boolean sslMode) void
setUsername
(String username) void
setVariable
(String variableName, String variableValue) void
setWebAppName
(String webAppName) void
shareVariablesWith
(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.WebResult
org.pentaho.di.www.WebResult
startTransformation
(String transName, String carteObjectId) org.pentaho.di.www.WebResult
org.pentaho.di.www.WebResult
stopTransformation
(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, setChanged
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
getXML
in interfaceorg.pentaho.di.shared.SharedObjectInterface
- Specified by:
getXML
in 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:
getName
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
- Specified by:
getName
in interfaceorg.pentaho.di.repository.RepositoryObjectInterface
- Specified by:
getName
in interfaceorg.pentaho.di.shared.SharedObjectInterface
-
setName
- Specified by:
setName
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
copyVariablesFrom
public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space) - Specified by:
copyVariablesFrom
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
environmentSubstitute
- Specified by:
environmentSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
environmentSubstitute
- Specified by:
environmentSubstitute
in 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:
fieldSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Throws:
org.pentaho.di.core.exception.KettleValueException
-
getParentVariableSpace
public org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()- Specified by:
getParentVariableSpace
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
setParentVariableSpace
public void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent) - Specified by:
setParentVariableSpace
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
getVariable
- Specified by:
getVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
getVariable
- Specified by:
getVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
getBooleanValueOfVariable
- Specified by:
getBooleanValueOfVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
initializeVariablesFrom
public void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent) - Specified by:
initializeVariablesFrom
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
listVariables
- Specified by:
listVariables
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
setVariable
- Specified by:
setVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
injectVariables
- Specified by:
injectVariables
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
getObjectId
public org.pentaho.di.repository.ObjectId getObjectId()- Specified by:
getObjectId
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
- Specified by:
getObjectId
in interfaceorg.pentaho.di.repository.RepositoryObjectInterface
-
setObjectId
public void setObjectId(org.pentaho.di.repository.ObjectId id) - Specified by:
setObjectId
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getRepositoryDirectory
public org.pentaho.di.repository.RepositoryDirectoryInterface getRepositoryDirectory()Not used in this case, simply return root /- Specified by:
getRepositoryDirectory
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setRepositoryDirectory
public void setRepositoryDirectory(org.pentaho.di.repository.RepositoryDirectoryInterface repositoryDirectory) - Specified by:
setRepositoryDirectory
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getRepositoryElementType
public org.pentaho.di.repository.RepositoryObjectType getRepositoryElementType()- Specified by:
getRepositoryElementType
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getObjectRevision
public org.pentaho.di.repository.ObjectRevision getObjectRevision()- Specified by:
getObjectRevision
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setObjectRevision
public void setObjectRevision(org.pentaho.di.repository.ObjectRevision objectRevision) - Specified by:
setObjectRevision
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getDescription
- Specified by:
getDescription
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setDescription
- Specified by:
setDescription
in 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:
getChangedDate
in 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
-