hudson.model.Node.canTake()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中hudson.model.Node.canTake()方法的一些代码示例,展示了Node.canTake()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.canTake()方法的具体详情如下:
包路径:hudson.model.Node
类名称:Node
方法名:canTake

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

  1. private void _getBuildableItems(Computer c, List<BuildableItem> col, List<BuildableItem> result) {
  2. Node node = c.getNode();
  3. if (node == null) // Deleted computers cannot take build items...
  4. return;
  5. for (BuildableItem p : col) {
  6. if (node.canTake(p) == null)
  7. result.add(p);
  8. }
  9. }

代码示例来源:origin: jenkinsci/jenkins

  1. for (Computer o : Collections.unmodifiableSet(availableComputers.keySet())) {
  2. Node otherNode = o.getNode();
  3. if (otherNode != null && otherNode.canTake(item) == null) {
  4. needExecutor = false;
  5. final int availableExecutors = availableComputers.remove(o);
  6. if (needExecutor && checkedNode != null && checkedNode.canTake(item) == null) {
  7. demandMilliseconds = System.currentTimeMillis() - item.buildableStartMilliseconds;
  8. needComputer = demandMilliseconds > inDemandDelay * 1000 * 60 /*MINS->MILLIS*/;

代码示例来源:origin: jenkinsci/jenkins

  1. continue;
  2. if (n.canTake(p) != null) {
  3. continue;

代码示例来源:origin: jenkinsci/jenkins

  1. return CauseOfBlockage.fromMessage(Messages._Queue_node_has_been_removed_from_configuration(executor.getOwner().getDisplayName()));
  2. CauseOfBlockage reason = node.canTake(item);
  3. if (reason != null) {
  4. return reason;

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

  1. public CauseOfBlockage superCanTake(Queue.BuildableItem item) {
  2. return super.canTake(item);
  3. }

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

  1. public CauseOfBlockage superCanTake(Task task) {
  2. return super.canTake(task);
  3. }

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. private void _getBuildableItems(Computer c, List<BuildableItem> col, List<BuildableItem> result) {
  2. Node node = c.getNode();
  3. if (node == null) // Deleted computers cannot take build items...
  4. return;
  5. for (BuildableItem p : col) {
  6. if (node.canTake(p) == null)
  7. result.add(p);
  8. }
  9. }

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

  1. private void _getBuildableItems(Computer c, ItemList<BuildableItem> col, List<BuildableItem> result) {
  2. Node node = c.getNode();
  3. for (BuildableItem p : col.values()) {
  4. if (node.canTake(p.task) == null)
  5. result.add(p);
  6. }
  7. }

代码示例来源:origin: hudson/hudson-2.x

  1. private void _getBuildableItems(Computer c, ItemList<BuildableItem> col, List<BuildableItem> result) {
  2. Node node = c.getNode();
  3. for (BuildableItem p : col.values()) {
  4. if (node.canTake(p.task) == null)
  5. result.add(p);
  6. }
  7. }

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. private void _getBuildableItems(Computer c, ItemList<BuildableItem> col, List<BuildableItem> result) {
  2. Node node = c.getNode();
  3. for (BuildableItem p : col.values()) {
  4. if (node.canTake(p) == null) {
  5. result.add(p);
  6. }
  7. }
  8. }

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

  1. private void _getBuildableItems(Computer c, ItemList<BuildableItem> col, List<BuildableItem> result) {
  2. Node node = c.getNode();
  3. for (BuildableItem p : col.values()) {
  4. if (node.canTake(p.task) == null)
  5. result.add(p);
  6. }
  7. }

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

  1. @Override
  2. public CauseOfBlockage canTake(Task task) {
  3. initPython();
  4. if (pexec.isImplemented(7)) {
  5. return (CauseOfBlockage) pexec.execPython("can_take", task);
  6. } else {
  7. return super.canTake(task);
  8. }
  9. }

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

  1. @Override
  2. public CauseOfBlockage canTake(Queue.BuildableItem item) {
  3. initPython();
  4. if (pexec.isImplemented(8)) {
  5. return (CauseOfBlockage) pexec.execPython("can_take", item);
  6. } else {
  7. return super.canTake(item);
  8. }
  9. }

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

  1. /**
  2. * Verifies that the {@link Executor} represented by this object is capable of executing the given task.
  3. */
  4. public boolean canTake(Task task) {
  5. Node node = getNode();
  6. if (node==null) return false; // this executor is about to die
  7. if(node.canTake(task)!=null)
  8. return false; // this node is not able to take the task
  9. for (QueueTaskDispatcher d : QueueTaskDispatcher.all())
  10. if (d.canTake(node,task)!=null)
  11. return false;
  12. return isAvailable();
  13. }

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

  1. /**
  2. * Verifies that the {@link Executor} represented by this object is capable of executing the given task.
  3. */
  4. public boolean canTake(Task task) {
  5. Node node = getNode();
  6. if (node==null) return false; // this executor is about to die
  7. if(node.canTake(task)!=null)
  8. return false; // this node is not able to take the task
  9. for (QueueTaskDispatcher d : QueueTaskDispatcher.all())
  10. if (d.canTake(node,task)!=null)
  11. return false;
  12. return isAvailable();
  13. }

代码示例来源:origin: hudson/hudson-2.x

  1. /**
  2. * Verifies that the {@link Executor} represented by this object is capable of executing the given task.
  3. */
  4. public boolean canTake(Task task) {
  5. Node node = getNode();
  6. if (node==null) return false; // this executor is about to die
  7. if(node.canTake(task)!=null)
  8. return false; // this node is not able to take the task
  9. for (QueueTaskDispatcher d : QueueTaskDispatcher.all())
  10. if (d.canTake(node,task)!=null)
  11. return false;
  12. return isAvailable();
  13. }

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. /**
  2. * Verifies that the {@link Executor} represented by this object is
  3. * capable of executing the given task.
  4. */
  5. public boolean canTake(BuildableItem item) {
  6. Node node = getNode();
  7. if (node == null) {
  8. return false; // this executor is about to die
  9. }
  10. if (node.canTake(item) != null) {
  11. return false; // this node is not able to take the task
  12. }
  13. for (QueueTaskDispatcher d : QueueTaskDispatcher.all()) {
  14. if (d.canTake(node, item) != null) {
  15. return false;
  16. }
  17. }
  18. return isAvailable();
  19. }

代码示例来源:origin: com.sonymobile.jenkins.plugins.lenientshutdown/lenientshutdown

  1. Computer otherComputer = otherNode.toComputer();
  2. if (otherComputer != null && otherComputer.isOnline() && !otherNode.equals(node)
  3. && otherNode.canTake(buildableItem) == null) {
  4. otherNodeCanBuild = true;
  5. break;

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. return CauseOfBlockage.fromMessage(Messages._Queue_node_has_been_removed_from_configuration(executor.getOwner().getDisplayName()));
  2. CauseOfBlockage reason = node.canTake(item);
  3. if (reason != null) {
  4. return reason;

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. continue;
  2. if (n.canTake(p) != null) {
  3. continue;

相关文章