public class NodePool extends Object implements hudson.model.Describable<NodePool>
Instances hold configuration data entered in the Jenkins UI and are serialised/deserialised via Stapler. This class does not implement serialisable, it would be useful if it did, as then readObject could be used to initTransients. However making it serialisable causes problems with the Charset field which doesn't implement serialisable but does serialise just fine * via xstreame :/
Modifier and Type | Class and Description |
---|---|
static class |
NodePool.NodePoolDescriptor
Descriptor class to support configuration of a NodePool instance in the
Jenkins UI
|
Constructor and Description |
---|
NodePool(String connectionString,
String credentialsId,
String labelPrefix,
String requestRoot,
String priority,
String requestor,
String zooKeeperRoot,
String nodeRoot,
Integer requestTimeout,
String jdkInstallationScript,
String jdkHome,
Integer installTimeout,
Integer maxAttempts)
Constructor invoked by Jenkins's Stapler library.
|
Modifier and Type | Method and Description |
---|---|
List<NodePoolNode> |
acceptNodes(NodeRequest request)
Accept the node that was created to satisfy the given request.
|
static org.apache.curator.framework.CuratorFramework |
createZKConnection(String connectionString,
String zkRoot)
Create a curator managed connection to ZooKeeper
|
boolean |
equals(Object other)
Equals based on connection string
|
Charset |
getCharset() |
org.apache.curator.framework.CuratorFramework |
getConn() |
String |
getConnectionString() |
String |
getCredentialsId() |
hudson.model.Descriptor<NodePool> |
getDescriptor() |
com.google.gson.Gson |
getGson() |
String |
getJdkHome()
Returns the JDK Home for this node.
|
String |
getJdkInstallationScript()
Returns the JDK installation script.
|
String |
getLabelPrefix() |
String |
getNodeRoot() |
String |
getPriority() |
String |
getRequestor() |
String |
getRequestRoot() |
List<NodeRequest> |
getRequests() |
Integer |
getRequestTimeout() |
String |
getZooKeeperRoot() |
int |
hashCode()
Hash Code based on connection string
|
String |
nodePoolLabelFromJenkinsLabel(String jenkinsLabel)
Convert the given jenkins label into its NodePool equivalent
|
void |
provisionNode(NodePoolJob job)
Submit request for node(s) required to execute the given task based on the nodes associated with the specified
label.
|
void |
setConnectionString(String connectionString) |
void |
setCredentialsId(String credentialsId) |
void |
setLabelPrefix(String labelPrefix) |
void |
setNodeRoot(String nodeRoot) |
void |
setPriority(String priority) |
void |
setRequestor(String requestor) |
void |
setRequestRoot(String requestRoot) |
void |
setRequests(List<NodeRequest> requests) |
void |
setRequestTimeout(Integer requestTimeout) |
void |
setZooKeeperRoot(String zooKeeperRoot) |
String |
toString() |
@DataBoundConstructor public NodePool(String connectionString, String credentialsId, String labelPrefix, String requestRoot, String priority, String requestor, String zooKeeperRoot, String nodeRoot, Integer requestTimeout, String jdkInstallationScript, String jdkHome, Integer installTimeout, Integer maxAttempts)
connectionString
- ZooKeeper connection stringcredentialsId
- Credential information identifierlabelPrefix
- Prefix for labels served by this NodePool clusterrequestRoot
- Prefix of node requestspriority
- Priority value of node requestsrequestor
- Name of process making node requestszooKeeperRoot
- Prefix of all NodePool-related ZNodesnodeRoot
- Prefix of nodesrequestTimeout
- Length of time to wait for node requests to be
fulfilledjdkInstallationScript
- the JDK installation scriptjdkHome
- the JDK homeinstallTimeout
- timeout in seconds to connect to a new node and provision the JREmaxAttempts
- maximum number of times to try to provision the nodepublic static org.apache.curator.framework.CuratorFramework createZKConnection(String connectionString, String zkRoot)
connectionString
- ZooKeeper connection stringzkRoot
- root path to prefix onto all Curator (ZK) requestspublic int hashCode()
public boolean equals(Object other)
public List<NodePoolNode> acceptNodes(NodeRequest request) throws Exception
request
- node requestException
- on ZooKeeper errorpublic Integer getRequestTimeout()
public final void setRequestTimeout(Integer requestTimeout)
public Charset getCharset()
public org.apache.curator.framework.CuratorFramework getConn()
public String getConnectionString()
public String getCredentialsId()
public String getJdkInstallationScript()
public String getJdkHome()
public hudson.model.Descriptor<NodePool> getDescriptor()
getDescriptor
in interface hudson.model.Describable<NodePool>
public com.google.gson.Gson getGson()
public String getLabelPrefix()
public String getNodeRoot()
public String getPriority()
public String getRequestRoot()
public String getRequestor()
public List<NodeRequest> getRequests()
public final String getZooKeeperRoot()
public String nodePoolLabelFromJenkinsLabel(String jenkinsLabel)
jenkinsLabel
- jenkins labelpublic void setConnectionString(String connectionString)
public void setCredentialsId(String credentialsId)
public void setLabelPrefix(String labelPrefix)
public void setNodeRoot(String nodeRoot)
public void setPriority(String priority)
public void setRequestRoot(String requestRoot)
public void setRequestor(String requestor)
public void setRequests(List<NodeRequest> requests)
public void setZooKeeperRoot(String zooKeeperRoot)
public void provisionNode(NodePoolJob job) throws Exception
job
- the job to executeIllegalArgumentException
- if timeout is less than 1 secondException
- if an error occurs managing the provision componentsCopyright © 2016–2018. All rights reserved.