本文整理了Java中hudson.model.Node.canTake()
方法的一些代码示例,展示了Node.canTake()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.canTake()
方法的具体详情如下:
包路径:hudson.model.Node
类名称:Node
方法名:canTake
[英]Called by the Queue to determine whether or not this node can take the given task. The default checks include whether or not this node is part of the task's assigned label, whether this node is in Mode#EXCLUSIVE mode if it is not in the task's assigned label, and whether or not any of this node's NodePropertys say that the task cannot be run.
[中]由队列调用以确定此节点是否可以执行给定任务。默认检查包括此节点是否是任务分配标签的一部分,如果不在任务分配标签中,此节点是否处于模式#独占模式,以及此节点的任何节点属性是否表示任务无法运行。
代码示例来源:origin: jenkinsci/jenkins
private void _getBuildableItems(Computer c, List<BuildableItem> col, List<BuildableItem> result) {
Node node = c.getNode();
if (node == null) // Deleted computers cannot take build items...
return;
for (BuildableItem p : col) {
if (node.canTake(p) == null)
result.add(p);
}
}
代码示例来源:origin: jenkinsci/jenkins
for (Computer o : Collections.unmodifiableSet(availableComputers.keySet())) {
Node otherNode = o.getNode();
if (otherNode != null && otherNode.canTake(item) == null) {
needExecutor = false;
final int availableExecutors = availableComputers.remove(o);
if (needExecutor && checkedNode != null && checkedNode.canTake(item) == null) {
demandMilliseconds = System.currentTimeMillis() - item.buildableStartMilliseconds;
needComputer = demandMilliseconds > inDemandDelay * 1000 * 60 /*MINS->MILLIS*/;
代码示例来源:origin: jenkinsci/jenkins
continue;
if (n.canTake(p) != null) {
continue;
代码示例来源:origin: jenkinsci/jenkins
return CauseOfBlockage.fromMessage(Messages._Queue_node_has_been_removed_from_configuration(executor.getOwner().getDisplayName()));
CauseOfBlockage reason = node.canTake(item);
if (reason != null) {
return reason;
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
public CauseOfBlockage superCanTake(Queue.BuildableItem item) {
return super.canTake(item);
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
public CauseOfBlockage superCanTake(Task task) {
return super.canTake(task);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
private void _getBuildableItems(Computer c, List<BuildableItem> col, List<BuildableItem> result) {
Node node = c.getNode();
if (node == null) // Deleted computers cannot take build items...
return;
for (BuildableItem p : col) {
if (node.canTake(p) == null)
result.add(p);
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
private void _getBuildableItems(Computer c, ItemList<BuildableItem> col, List<BuildableItem> result) {
Node node = c.getNode();
for (BuildableItem p : col.values()) {
if (node.canTake(p.task) == null)
result.add(p);
}
}
代码示例来源:origin: hudson/hudson-2.x
private void _getBuildableItems(Computer c, ItemList<BuildableItem> col, List<BuildableItem> result) {
Node node = c.getNode();
for (BuildableItem p : col.values()) {
if (node.canTake(p.task) == null)
result.add(p);
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
private void _getBuildableItems(Computer c, ItemList<BuildableItem> col, List<BuildableItem> result) {
Node node = c.getNode();
for (BuildableItem p : col.values()) {
if (node.canTake(p) == null) {
result.add(p);
}
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
private void _getBuildableItems(Computer c, ItemList<BuildableItem> col, List<BuildableItem> result) {
Node node = c.getNode();
for (BuildableItem p : col.values()) {
if (node.canTake(p.task) == null)
result.add(p);
}
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@Override
public CauseOfBlockage canTake(Task task) {
initPython();
if (pexec.isImplemented(7)) {
return (CauseOfBlockage) pexec.execPython("can_take", task);
} else {
return super.canTake(task);
}
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@Override
public CauseOfBlockage canTake(Queue.BuildableItem item) {
initPython();
if (pexec.isImplemented(8)) {
return (CauseOfBlockage) pexec.execPython("can_take", item);
} else {
return super.canTake(item);
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Verifies that the {@link Executor} represented by this object is capable of executing the given task.
*/
public boolean canTake(Task task) {
Node node = getNode();
if (node==null) return false; // this executor is about to die
if(node.canTake(task)!=null)
return false; // this node is not able to take the task
for (QueueTaskDispatcher d : QueueTaskDispatcher.all())
if (d.canTake(node,task)!=null)
return false;
return isAvailable();
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Verifies that the {@link Executor} represented by this object is capable of executing the given task.
*/
public boolean canTake(Task task) {
Node node = getNode();
if (node==null) return false; // this executor is about to die
if(node.canTake(task)!=null)
return false; // this node is not able to take the task
for (QueueTaskDispatcher d : QueueTaskDispatcher.all())
if (d.canTake(node,task)!=null)
return false;
return isAvailable();
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Verifies that the {@link Executor} represented by this object is capable of executing the given task.
*/
public boolean canTake(Task task) {
Node node = getNode();
if (node==null) return false; // this executor is about to die
if(node.canTake(task)!=null)
return false; // this node is not able to take the task
for (QueueTaskDispatcher d : QueueTaskDispatcher.all())
if (d.canTake(node,task)!=null)
return false;
return isAvailable();
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Verifies that the {@link Executor} represented by this object is
* capable of executing the given task.
*/
public boolean canTake(BuildableItem item) {
Node node = getNode();
if (node == null) {
return false; // this executor is about to die
}
if (node.canTake(item) != null) {
return false; // this node is not able to take the task
}
for (QueueTaskDispatcher d : QueueTaskDispatcher.all()) {
if (d.canTake(node, item) != null) {
return false;
}
}
return isAvailable();
}
代码示例来源:origin: com.sonymobile.jenkins.plugins.lenientshutdown/lenientshutdown
Computer otherComputer = otherNode.toComputer();
if (otherComputer != null && otherComputer.isOnline() && !otherNode.equals(node)
&& otherNode.canTake(buildableItem) == null) {
otherNodeCanBuild = true;
break;
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
return CauseOfBlockage.fromMessage(Messages._Queue_node_has_been_removed_from_configuration(executor.getOwner().getDisplayName()));
CauseOfBlockage reason = node.canTake(item);
if (reason != null) {
return reason;
代码示例来源:origin: org.eclipse.hudson/hudson-core
continue;
if (n.canTake(p) != null) {
continue;
内容来源于网络,如有侵权,请联系作者删除!