public int compare(Computer c1, Computer c2) { return COLL.compare(c1.getDisplayName(), c2.getDisplayName()); } });
public Executor(@Nonnull Computer owner, int n) { super("Executor #"+n+" for "+owner.getDisplayName()); this.owner = owner; this.queue = Jenkins.get().getQueue(); this.number = n; }
/** * Performs monitoring across the board. * * @return * For all the computers, report the monitored values. */ protected Map<Computer,T> monitor() throws InterruptedException { Map<Computer,T> data = new HashMap<Computer,T>(); for( Computer c : Jenkins.getInstance().getComputers() ) { try { Thread.currentThread().setName("Monitoring "+c.getDisplayName()+" for "+getDisplayName()); if(c.getChannel()==null) data.put(c,null); else data.put(c,monitor(c)); } catch (RuntimeException e) { LOGGER.log(Level.WARNING, "Failed to monitor "+c.getDisplayName()+" for "+getDisplayName(), e); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to monitor "+c.getDisplayName()+" for "+getDisplayName(), e); } catch (InterruptedException e) { throw (InterruptedException)new InterruptedException("Node monitoring "+c.getDisplayName()+" for "+getDisplayName()+" aborted.").initCause(e); } } return data; }
StringWriter writer = new StringWriter(); try (PrintWriter pw = new PrintWriter(writer)) { pw.printf("%s grabbed %s from queue but %s %s. ", getName(), workUnit, owner.getDisplayName(), reason); if (owner.getTerminatedBy().isEmpty()) { pw.print("No termination trace available.");
LOGGER.log(WARNING, "Failed to monitor "+c.getDisplayName()+" for "+getDisplayName(), e); } catch (IOException e) { LOGGER.log(WARNING, "Failed to monitor "+c.getDisplayName()+" for "+getDisplayName(), e); data.put(c,f.get(Math.max(0,end-System.currentTimeMillis()), MILLISECONDS)); } catch (RuntimeException x) { LOGGER.log(WARNING, "Failed to monitor " + c.getDisplayName() + " for " + getDisplayName(), x); } catch (ExecutionException x) { LOGGER.log(WARNING, "Failed to monitor " + c.getDisplayName() + " for " + getDisplayName(), x); } catch (TimeoutException x) { LOGGER.log(WARNING, "Failed to monitor " + c.getDisplayName() + " for " + getDisplayName(), x);
@Override public String getShortDescription() { Computer computer = node.toComputer(); String name = computer != null ? computer.getDisplayName() : node.getDisplayName(); return Messages.Node_BecauseNodeIsNotAcceptingTasks(name); }
private void rss(StaplerRequest req, StaplerResponse rsp, String suffix, RunList runs) throws IOException, ServletException { RSS.forwardToRss(getDisplayName() + suffix, getUrl(), runs.newBuilds(), Run.FEED_ADAPTER, req, rsp); }
@Override @GuardedBy("hudson.model.Queue.lock") public long check(T c) { if (!c.isConnecting() && c.isAcceptingTasks()) { if (isIdleForTooLong(c)) { try { Node n = c.getNode(); if (n!=null) // rare, but n==null if the node is deleted and being checked roughly at the same time kill(n); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to remove "+c.getDisplayName(),e); } } } return checkCycle(); }
public String getShortDescription() { String name = (node.toComputer() != null) ? node.toComputer().getDisplayName() : node.getDisplayName(); return Messages.Queue_NodeOffline(name); }
public String getShortDescription() { String name = (node.toComputer() != null) ? node.toComputer().getDisplayName() : node.getDisplayName(); return Messages.Queue_WaitingForNextAvailableExecutorOn(name); }
/** * Performs an installation. */ private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException { Run b = p.getBuildByNumber(Integer.parseInt(id.number)); if (b==null) throw new IllegalStateException("No such build: "+id.number); Executor exec = b.getExecutor(); if (exec==null) throw new IllegalStateException(b.getFullDisplayName()+" is not building"); Node node = exec.getOwner().getNode(); if (node == null) { throw new IllegalStateException("The node " + exec.getOwner().getDisplayName() + " has been deleted"); } t = t.translate(node, EnvVars.getRemote(checkChannel()), new StreamTaskListener(stderr)); stdout.println(t.getHome()); return 0; }
/** * Adds a computer * * @since 1.513 */ public ContextMenu add(Computer c) { return add(new MenuItem() .withDisplayName(c.getDisplayName()) .withStockIcon(c.getIcon()) .withContextRelativeUrl(c.getUrl())); }
/** * Serves the workspace files. */ public DirectoryBrowserSupport doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException { checkPermission(Item.WORKSPACE); FilePath ws = getSomeWorkspace(); if ((ws == null) || (!ws.exists())) { // if there's no workspace, report a nice error message // Would be good if when asked for *plain*, do something else! // (E.g. return 404, or send empty doc.) // Not critical; client can just check if content type is not text/plain, // which also serves to detect old versions of Hudson. req.getView(this,"noWorkspace.jelly").forward(req,rsp); return null; } else { Computer c = ws.toComputer(); String title; if (c == null) { title = Messages.AbstractProject_WorkspaceTitle(getDisplayName()); } else { title = Messages.AbstractProject_WorkspaceTitleOnComputer(getDisplayName(), c.getDisplayName()); } return new DirectoryBrowserSupport(this, ws, title, "folder.png", true); } }
Node node = getNode(); if (node == null) { return CauseOfBlockage.fromMessage(Messages._Queue_node_has_been_removed_from_configuration(executor.getOwner().getDisplayName()));
public int compare(Computer lhs, Computer rhs) { if (lhs.getNode() == Hudson.this) { return -1; } if (rhs.getNode() == Hudson.this) { return 1; } return collator.compare(lhs.getDisplayName(), rhs.getDisplayName()); } });
public int compare(Computer lhs, Computer rhs) { if (lhs.getNode() == Hudson.this) { return -1; } if (rhs.getNode() == Hudson.this) { return 1; } return collator.compare(lhs.getDisplayName(), rhs.getDisplayName()); } });
public Executor(@Nonnull Computer owner, int n) { super("Executor #"+n+" for "+owner.getDisplayName()); this.owner = owner; this.queue = Jenkins.getInstance().getQueue(); this.number = n; }
public Executor(Computer owner, int n) { super("Executor #"+n+" for "+owner.getDisplayName()); this.owner = owner; this.queue = Hudson.getInstance().getQueue(); this.number = n; }
@Override public String getShortDescription() { Computer computer = node.toComputer(); String name = computer != null ? computer.getDisplayName() : node.getDisplayName(); return Messages.Node_BecauseNodeIsNotAcceptingTasks(name); }
/** * Adds a computer * * @since 1.513 */ public ContextMenu add(Computer c) { return add(new MenuItem() .withDisplayName(c.getDisplayName()) .withStockIcon(c.getIcon()) .withContextRelativeUrl(c.getUrl())); }