/** * Number of total {@link Executor}s that belong to this label. * <p> * This includes executors that belong to offline nodes, so the result * can be thought of as a potential capacity, whereas {@link #getTotalExecutors()} * is the currently functioning total number of executors. * <p> * This method doesn't take the dynamically allocatable nodes (via {@link Cloud}) * into account. If you just want to test if there's some executors, use {@link #isAssignable()}. */ public int getTotalConfiguredExecutors() { int r=0; for (Node n : getNodes()) r += n.getNumExecutors(); return r; }
Node node = f.future.get(); if (node != null) { additionalPlannedCapacity += node.getNumExecutors();
/** * Can jobs be assigned to this label? * <p> * The answer is yes if there is a reasonable basis to believe that Hudson can have * an executor under this label, given the current configuration. This includes * situations such as (1) there are offline agents that have this label (2) clouds exist * that can provision agents that have this label. */ public boolean isAssignable() { for (Node n : getNodes()) if(n.getNumExecutors()>0) return true; return !getClouds().isEmpty(); }
/** * Called to notify {@link Computer} that its corresponding {@link Node} * configuration is updated. */ protected void setNode(Node node) { assert node!=null; if(node instanceof Slave) this.nodeName = node.getNodeName(); else this.nodeName = null; setNumExecutors(node.getNumExecutors()); if (this.temporarilyOffline) { // When we get a new node, push our current temp offline // status to it (as the status is not carried across // configuration changes that recreate the node). // Since this is also called the very first time this // Computer is created, avoid pushing an empty status // as that could overwrite any status that the Node // brought along from its persisted config data. node.setTemporaryOfflineCause(this.offlineCause); } }
if(n.getNumExecutors()>0 || n==Jenkins.getInstance()) { try { c = n.createComputer();
hashSource.put(n, n.getNumExecutors() * 100);
public Computer(Node node) { assert node.getNumExecutors()!=0 : "Computer created with 0 executors"; setNode(node); }
private boolean eligibleNode(Node node) { if (node == null) { return false; } if (node.getRootPath() == null) { return false; } return node.getNumExecutors() != 0; }
public Computer(Node node) { assert node.getNumExecutors()!=0 : "Computer created with 0 executors"; setNode(node); }
public Computer(Node node) { assert node.getNumExecutors() != 0 : "Computer created with 0 executors"; setNode(node); }
public Computer(Node node) { assert node.getNumExecutors()!=0 : "Computer created with 0 executors"; setNode(node); }
/** * Number of total {@link Executor}s that belong to this label. * <p> * This includes executors that belong to offline nodes, so the result * can be thought of as a potential capacity, whereas {@link #getTotalExecutors()} * is the currently functioning total number of executors. * <p> * This method doesn't take the dynamically allocatable nodes (via {@link Cloud}) * into account. If you just want to test if there's some executors, use {@link #isAssignable()}. */ public int getTotalConfiguredExecutors() { int r=0; for (Node n : getNodes()) r += n.getNumExecutors(); return r; }
/** * Can jobs be assigned to this label? * <p> * The answer is yes if there is a reasonable basis to believe that Hudson can have * an executor under this label, given the current configuration. This includes * situations such as (1) there are offline agents that have this label (2) clouds exist * that can provision agents that have this label. */ public boolean isAssignable() { for (Node n : getNodes()) if(n.getNumExecutors()>0) return true; return !getClouds().isEmpty(); }
/** * Can jobs be assigned to this label? * <p> * The answer is yes if there is a reasonable basis to believe that Hudson can have * an executor under this label, given the current configuration. This includes * situations such as (1) there are offline slaves that have this label (2) clouds exist * that can provision slaves that have this label. */ public boolean isAssignable() { for (Node n : getNodes()) if(n.getNumExecutors()>0) return true; return !getClouds().isEmpty(); }
/** * Can jobs be assigned to this label? * <p> * The answer is yes if there is a reasonable basis to believe that Hudson can have * an executor under this label, given the current configuration. This includes * situations such as (1) there are offline slaves that have this label (2) clouds exist * that can provision slaves that have this label. */ public boolean isAssignable() { for (Node n : getNodes()) if(n.getNumExecutors()>0) return true; return !getClouds().isEmpty(); }
/** * Can jobs be assigned to this label? <p> The answer is yes if there is a * reasonable basis to believe that Hudson can have an executor under this * label, given the current configuration. This includes situations such as * (1) there are offline slaves that have this label (2) clouds exist that * can provision slaves that have this label. */ public boolean isAssignable() { for (Node n : getNodes()) { if (n.getNumExecutors() > 0) { return true; } } return !getClouds().isEmpty(); }
/** * Can jobs be assigned to this label? * <p> * The answer is yes if there is a reasonable basis to believe that Hudson can have * an executor under this label, given the current configuration. This includes * situations such as (1) there are offline slaves that have this label (2) clouds exist * that can provision slaves that have this label. */ public boolean isAssignable() { for (Node n : getNodes()) if(n.getNumExecutors()>0) return true; return !getClouds().isEmpty(); }
/** * Called to notify {@link Computer} that its corresponding {@link Node} * configuration is updated. */ protected void setNode(Node node) { assert node!=null; if(node instanceof Slave) this.nodeName = node.getNodeName(); else this.nodeName = null; setNumExecutors(node.getNumExecutors()); if (temporarilyOffline) { node.setOfflineCause(offlineCause); } }
/** * Called to notify {@link Computer} that its corresponding {@link Node} * configuration is updated. */ protected void setNode(Node node) { assert node!=null; if(node instanceof Slave) this.nodeName = node.getNodeName(); else this.nodeName = null; setNumExecutors(node.getNumExecutors()); if (temporarilyOffline) { node.setOfflineCause(offlineCause); } }
public NodeDTO convert(final hudson.model.Node source) { assert source != null; log.trace("Converting: {}", source); NodeDTO target = new NodeDTO(); target.setName(source.getNodeName()); target.setDescription(source.getNodeDescription()); target.setExecutors(source.getNumExecutors()); target.setMode(convert(source.getMode())); // target.setConnected(); // target.setOnline(); // target.setOfflineCause(); // target.setConnectTime(); return target; }