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 int
KETTLE_CARTE_RETRIES
static int
KETTLE_CARTE_RETRY_BACKOFF_INCREMENTS
static org.pentaho.di.repository.RepositoryObjectType
REPOSITORY_ELEMENT_TYPE
static String
SSL_MODE_TAG
static String
STRING_SLAVESERVER
static String
XML_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 int
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)
Object
clone()
String
constructUrl(String serviceAndArguments)
void
copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
org.pentaho.di.www.WebResult
deAllocateServerSockets(String transName, String clusteredRunId)
String
environmentSubstitute(String aString)
String[]
environmentSubstitute(String[] aString)
boolean
equals(Object obj)
String
execService(String service)
String
execService(String service, boolean retry)
String
execService(String service, Map<String,String> headerValues)
String
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
getAuthContext()
static int
getBackoffIncrements()
boolean
getBooleanValueOfVariable(String variableName, boolean defaultValue)
Date
getChangedDate()
SlaveServer
getClient()
static long
getDelay(int trial)
String
getDescription()
String
getHostname()
SlaveServerJobStatus
getJobStatus(String jobName, String carteObjectId, int startLogLineNr)
Properties
getKettleProperties()
org.pentaho.di.core.logging.LogChannelInterface
getLogChannel()
String
getName()
long
getNextSlaveSequenceValue(String slaveSequenceName, long incrementValue)
String
getNonProxyHosts()
org.pentaho.di.repository.ObjectId
getObjectId()
org.pentaho.di.repository.ObjectRevision
getObjectRevision()
org.pentaho.di.core.variables.VariableSpace
getParentVariableSpace()
String
getPassword()
String
getPort()
String
getPortSpecification()
String
getPropertiesMasterName()
String
getProxyHostname()
String
getProxyPort()
org.pentaho.di.repository.RepositoryDirectoryInterface
getRepositoryDirectory()
Not used in this case, simply return root /org.pentaho.di.repository.RepositoryObjectType
getRepositoryElementType()
String
getServerAndPort()
List<SlaveServerDetection>
getSlaveServerDetections()
static String[]
getSlaveServerNames(List<SlaveServer> slaveServers)
SslConfiguration
getSslConfig()
SlaveServerStatus
getStatus()
SlaveServerTransStatus
getTransStatus(String transName, String carteObjectId, int startLogLineNr)
SlaveServerTransStatus
getTransStatus(String transName, String carteObjectId, int startLogLineNr, boolean sendResultXmlWithStatus)
String
getUsername()
String
getVariable(String variableName)
String
getVariable(String variableName, String defaultValue)
String
getWebAppName()
String
getXML()
int
hashCode()
void
initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
void
injectVariables(Map<String,String> prop)
boolean
isMaster()
boolean
isOverrideExistingProperties()
boolean
isShared()
boolean
isSslMode()
String[]
listVariables()
org.pentaho.di.www.WebResult
pauseResumeTransformation(String transName, String carteObjectId)
org.pentaho.di.www.WebResult
removeJob(String jobName, String carteObjectId)
org.pentaho.di.www.WebResult
removeTransformation(String transName, String carteObjectId)
void
replaceMeta(SlaveServer slaveServer)
String
sendExport(String filename, String type, String load)
Send an exported archive over to this slave serverString
sendXML(String xml, String service)
void
setDescription(String description)
void
setHostname(String urlString)
void
setMaster(boolean master)
void
setName(String name)
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
setPort(String port)
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)
String
sniffStep(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.WebResult
startJob(String jobName, String carteObjectId)
org.pentaho.di.www.WebResult
startTransformation(String transName, String carteObjectId)
org.pentaho.di.www.WebResult
stopJob(String transName, String carteObjectId)
org.pentaho.di.www.WebResult
stopTransformation(String transName, String carteObjectId)
String
toString()
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.-
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:
getXML
in interfaceorg.pentaho.di.shared.SharedObjectInterface
- Specified by:
getXML
in 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:
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
public void setName(String name)
- Specified by:
setName
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
isShared
public boolean isShared()
- Specified by:
isShared
in interfaceorg.pentaho.di.shared.SharedObjectInterface
-
setShared
public void setShared(boolean shared)
- Specified by:
setShared
in interfaceorg.pentaho.di.shared.SharedObjectInterface
-
copyVariablesFrom
public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
- Specified by:
copyVariablesFrom
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
environmentSubstitute
public String environmentSubstitute(String aString)
- Specified by:
environmentSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
environmentSubstitute
public String[] environmentSubstitute(String[] aString)
- 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
public String getVariable(String variableName, String defaultValue)
- Specified by:
getVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
getVariable
public String getVariable(String variableName)
- Specified by:
getVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
getBooleanValueOfVariable
public boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
- 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
public String[] listVariables()
- Specified by:
listVariables
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
setVariable
public void setVariable(String variableName, String variableValue)
- Specified by:
setVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
shareVariablesWith
public void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
- Specified by:
shareVariablesWith
in interfaceorg.pentaho.di.core.variables.VariableSpace
-
injectVariables
public void injectVariables(Map<String,String> prop)
- 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
public String getDescription()
- Specified by:
getDescription
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setDescription
public void setDescription(String description)
- Specified by:
setDescription
in 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:
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
public SslConfiguration getSslConfig()
- Returns:
- the sslConfig
-
-