public class NodeRequest extends Object
Constructor and Description |
---|
NodeRequest(NodePool nodePool,
String baseId,
NodePoolJob npj)
Create new request
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAllocatedNodes(List<String> nodes)
Adds the specified allocated nodes to the existing list of nodes.
|
void |
delete()
Deletes the Node Request.
|
String |
getAge()
Returns the age of this request.
|
List<String> |
getAllocatedNodeNames()
Get node names only from the local cache of the ZNode
|
List<NodePoolNode> |
getAllocatedNodes()
Get list of NodePool nodes that have been allocated to fulfill this request
|
hudson.model.Label |
getJenkinsLabel()
Returns the jenkins label for this node request.
|
NodePoolJob |
getJob()
Returns the NodePoolJob associated with this request
|
String |
getModelAsJSON()
Returns the node request model as JSON.
|
String |
getNodePoolLabel()
Returns the node pool label for the node request.
|
String |
getPath()
Returns the path associated with this request.
|
NodePoolState |
getState()
Returns the requested state value from the data model.
|
hudson.model.Queue.Task |
getTask()
Returns the task associated with this request.
|
String |
getZKID()
Returns the ID associated with this request.
|
boolean |
setAllocatedNodes(List<String> nodes)
Sets the allocated nodes to the specified value.
|
String |
toString()
Get a string representation of this object, in JSON.
|
boolean |
updateState(NodePoolState state)
Updates the node request state to the specified value.
|
public NodeRequest(NodePool nodePool, String baseId, NodePoolJob npj) throws Exception
nodePool
- NodePool cluster to usebaseId
- the base id string for the request - used to generate the full id which will be a combination of the base ID + a dash + a sequential value, such as 100-0001334443npj
- Associated NodePoolJob which contains the taskException
- on ZooKeeper errorpublic NodePoolState getState()
public boolean updateState(NodePoolState state)
state
- the state value to set in the node request.public NodePoolJob getJob()
public List<String> getAllocatedNodeNames()
public String toString()
public List<NodePoolNode> getAllocatedNodes() throws Exception
Exception
- on ZooKeeper errorpublic boolean setAllocatedNodes(List<String> nodes)
nodes
- a list of node values as a stringpublic boolean addAllocatedNodes(List<String> nodes)
nodes
- a list of node values as a stringpublic String getNodePoolLabel()
public hudson.model.Label getJenkinsLabel()
public String getAge()
public hudson.model.Queue.Task getTask()
public String getZKID()
public String getPath()
public void delete()
public String getModelAsJSON()
Copyright © 2016–2018. All rights reserved.