public class NamedCluster extends Object implements Cloneable, VariableSpace
Modifier and Type | Field and Description |
---|---|
static Comparator<NamedCluster> |
comparator |
Constructor and Description |
---|
NamedCluster() |
Modifier and Type | Method and Description |
---|---|
NamedCluster |
clone() |
void |
copyVariablesFrom(VariableSpace space)
Copy the variables from another space, without initializing with the defaults.
|
String |
environmentSubstitute(String aString)
Substitute the string using the current variable space.
|
String[] |
environmentSubstitute(String[] aString)
Replaces environment variables in an array of strings.
|
boolean |
equals(Object obj) |
String |
fieldSubstitute(String aString,
RowMetaInterface rowMeta,
Object[] rowData)
Substitutes field values in
aString . |
boolean |
getBooleanValueOfVariable(String variableName,
boolean defaultValue)
This method returns a boolean for the new variable check boxes.
|
String |
getHdfsHost() |
String |
getHdfsPassword() |
String |
getHdfsPort() |
String |
getHdfsUsername() |
String |
getJobTrackerHost() |
String |
getJobTrackerPort() |
long |
getLastModifiedDate() |
String |
getName() |
String |
getOozieUrl() |
VariableSpace |
getParentVariableSpace()
Get the parent of the variable space.
|
String |
getVariable(String variableName)
Get the value of a variable.
|
String |
getVariable(String variableName,
String defaultValue)
Get the value of a variable with a default in case the variable is not found.
|
String |
getZooKeeperHost() |
String |
getZooKeeperPort() |
void |
initializeVariablesFrom(VariableSpace parent)
Initialize variable space using the defaults, copy over the variables from the parent (using copyVariablesFrom()),
after this the "injected" variables should be inserted (injectVariables()).
|
void |
injectVariables(Map<String,String> prop)
Inject variables.
|
String[] |
listVariables()
List the variables (not the values) that are currently in the variable space.
|
void |
replaceMeta(NamedCluster nc) |
void |
setHdfsHost(String hdfsHost) |
void |
setHdfsPassword(String hdfsPassword) |
void |
setHdfsPort(String hdfsPort) |
void |
setHdfsUsername(String hdfsUsername) |
void |
setJobTrackerHost(String jobTrackerHost) |
void |
setJobTrackerPort(String jobTrackerPort) |
void |
setLastModifiedDate(long lastModifiedDate) |
void |
setName(String name) |
void |
setOozieUrl(String oozieUrl) |
void |
setParentVariableSpace(VariableSpace parent)
Set the parent variable space
|
void |
setVariable(String variableName,
String variableValue)
Sets a variable in the Kettle Variables list.
|
void |
setZooKeeperHost(String zooKeeperHost) |
void |
setZooKeeperPort(String zooKeeperPort) |
void |
shareVariablesWith(VariableSpace space)
Share a variable space from another variable space.
|
public static final Comparator<NamedCluster> comparator
public void setName(String name)
public String getName()
public void copyVariablesFrom(VariableSpace space)
VariableSpace
copyVariablesFrom
in interface VariableSpace
space
- the space to copy the variables from.public String environmentSubstitute(String aString)
VariableSpace
environmentSubstitute
in interface VariableSpace
aString
- The string to substitute.public String[] environmentSubstitute(String[] aString)
VariableSpace
environmentSubstitute
in interface VariableSpace
aString
- The array of strings that wants its variables to be replaced.public String fieldSubstitute(String aString, RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException
VariableSpace
aString
. Field values are of the form "?{fieldSubstitute
in interface VariableSpace
aString
- the string on which to apply the substitution.rowMeta
- The row metadata to use.rowData
- The row data to useKettleValueException
- In case there is a String conversion errorpublic VariableSpace getParentVariableSpace()
VariableSpace
getParentVariableSpace
in interface VariableSpace
public void setParentVariableSpace(VariableSpace parent)
VariableSpace
setParentVariableSpace
in interface VariableSpace
parent
- The parent variable space to setpublic String getVariable(String variableName, String defaultValue)
VariableSpace
getVariable
in interface VariableSpace
variableName
- The name of the variabledefaultValue
- The default value in case the variable could not be foundpublic String getVariable(String variableName)
VariableSpace
getVariable
in interface VariableSpace
variableName
- The name of the variablepublic boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
VariableSpace
getBooleanValueOfVariable
in interface VariableSpace
variableName
- The variable to look up.defaultValue
- The default value to return.static method ValueMeta.convertStringToBoolean()
public void initializeVariablesFrom(VariableSpace parent)
VariableSpace
initializeVariablesFrom
in interface VariableSpace
parent
- the parent to start from, or null if root.public String[] listVariables()
VariableSpace
listVariables
in interface VariableSpace
public void setVariable(String variableName, String variableValue)
VariableSpace
setVariable
in interface VariableSpace
variableName
- The name of the variable to setvariableValue
- The value of the variable to set. If the variableValue is null, the variable is cleared from the list.public void shareVariablesWith(VariableSpace space)
VariableSpace
shareVariablesWith
in interface VariableSpace
space
- Variable space to be shared.public void injectVariables(Map<String,String> prop)
VariableSpace
injectVariables
in interface VariableSpace
prop
- Properties object containing key-value pairs.public void replaceMeta(NamedCluster nc)
public NamedCluster clone()
public String getHdfsHost()
public void setHdfsHost(String hdfsHost)
public String getHdfsPort()
public void setHdfsPort(String hdfsPort)
public String getHdfsUsername()
public void setHdfsUsername(String hdfsUsername)
public String getHdfsPassword()
public void setHdfsPassword(String hdfsPassword)
public String getJobTrackerHost()
public void setJobTrackerHost(String jobTrackerHost)
public String getJobTrackerPort()
public void setJobTrackerPort(String jobTrackerPort)
public String getZooKeeperHost()
public void setZooKeeperHost(String zooKeeperHost)
public String getZooKeeperPort()
public void setZooKeeperPort(String zooKeeperPort)
public String getOozieUrl()
public void setOozieUrl(String oozieUrl)
public long getLastModifiedDate()
public void setLastModifiedDate(long lastModifiedDate)