/** deprecated call {@link SubTask#getOwnerTask} directly */ @Deprecated public static @Nonnull Task getOwnerTaskOf(@Nonnull SubTask t) { return t.getOwnerTask(); }
private Label getAssignedLabel(SubTask task) { for (LabelAssignmentAction laa : item.getActions(LabelAssignmentAction.class)) { Label l = laa.getAssignedLabel(task); if (l!=null) return l; } return task.getAssignedLabel(); }
/** * Estimate of how long will it take to execute this executable. * Measured in milliseconds. * * @return -1 if it's impossible to estimate; default, {@link SubTask#getEstimatedDuration} * @since 1.383 */ default long getEstimatedDuration() { return Executables.getParentOf(this).getEstimatedDuration(); }
private WorkChunk(List<SubTask> base, int index) { super(base); assert !base.isEmpty(); this.index = index; this.assignedLabel = base.get(0).getAssignedLabel(); Node lbo = base.get(0).getLastBuiltOn(); for (ExecutorChunk ec : executors) { if (ec.node==lbo) { lastBuiltOn = ec; return; } } lastBuiltOn = null; }
/** @deprecated call {@link SubTask#getSameNodeConstraint} directly */ @Deprecated public static Object getSameNodeConstraintOf(SubTask t) { return t.getSameNodeConstraint(); }
private WorkChunk(List<SubTask> base, int index) { super(base); assert !base.isEmpty(); this.index = index; this.assignedLabel = getAssignedLabel(base.get(0)); Node lbo = base.get(0).getLastBuiltOn(); for (ExecutorChunk ec : executors) { if (ec.node==lbo) { lastBuiltOn = ec; return; } } lastBuiltOn = null; }
task = workUnit.work; startTime = System.currentTimeMillis(); executable = task.createExecutable();
@Override public void executeCommand(Bot bot, IMChat chat, IMMessage message, Sender sender, String[] args) throws IMException { StringBuffer msg = new StringBuffer(); msg.append("Currently building:"); boolean currentlyJobsInProgess = false; for (Computer computer : Hudson.getInstance().getComputers()) { for (Executor executor : computer.getExecutors()) { Executable currentExecutable = executor.getCurrentExecutable(); if (currentExecutable != null) { currentlyJobsInProgess = true; msg.append("\n- "); msg.append(computer.getDisplayName()); msg.append("#"); msg.append(executor.getNumber()); msg.append(": "); msg.append(currentExecutable.getParent().getDisplayName()); msg.append(" (Elapsed time: "); msg.append(Util.getTimeSpanString(executor.getElapsedTime())); msg.append(", Estimated remaining time: "); msg.append(executor.getEstimatedRemainingTime()); msg.append(")"); } } } if (!currentlyJobsInProgess) { msg.append("\n- No jobs are running."); } chat.sendMessage(msg.toString()); }
private WorkChunk(List<SubTask> base, int index) { super(base); assert !base.isEmpty(); this.index = index; this.assignedLabel = base.get(0).getAssignedLabel(); Node lbo = base.get(0).getLastBuiltOn(); for (ExecutorChunk ec : executors) { if (ec.node==lbo) { lastBuiltOn = ec; return; } } lastBuiltOn = null; }
Object c = meu.getSameNodeConstraint(); if (c==null) c = new Object();
private WorkChunk(List<SubTask> base, int index) { super(base); assert !base.isEmpty(); this.index = index; this.assignedLabel = getAssignedLabel(base.get(0)); Node lbo = base.get(0).getLastBuiltOn(); for (ExecutorChunk ec : executors) { if (ec.node==lbo) { lastBuiltOn = ec; return; } } lastBuiltOn = null; }
task = workUnit.work; startTime = System.currentTimeMillis(); executable = task.createExecutable();
msg.append(executor.getNumber()); msg.append(": "); msg.append(item != null ? item.getFullDisplayName() : task.getDisplayName()); msg.append(" (Elapsed time: "); msg.append(Util.getTimeSpanString(executor.getElapsedTime()));
/** * Checks if the current user has a permission to stop this build. */ public boolean hasStopPermission() { lock.readLock().lock(); try { return executable != null && getParentOf(executable).getOwnerTask().hasAbortPermission(); } finally { lock.readLock().unlock(); } }
private WorkChunk(List<SubTask> base, int index) { super(base); assert !base.isEmpty(); this.index = index; this.assignedLabel = base.get(0).getAssignedLabel(); Node lbo = base.get(0).getLastBuiltOn(); for (ExecutorChunk ec : executors) { if (ec.node==lbo) { lastBuiltOn = ec; return; } } lastBuiltOn = null; }
/** * A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067 * on BugParade for more details. */ private static Object _getSameNodeConstraintOf(SubTask t) { return t.getSameNodeConstraint(); }
/** * Estimate of how long will it take to execute this executable. * Measured in milliseconds. * * @return -1 if it's impossible to estimate; default, {@link SubTask#getEstimatedDuration} * @since 1.383 */ default long getEstimatedDuration() { return Executables.getParentOf(this).getEstimatedDuration(); }
/** * Test if the specified {@link SubTask} needs to be run on a node with a particular label. * <p> * This method takes {@link LabelAssignmentAction} into account, the first * non-null assignment will be returned. * Otherwise falls back to {@link SubTask#getAssignedLabel()} * @param st {@link SubTask} to be checked. * @return Required {@link Label}. Otherwise null, indicating it can run on anywhere. */ public @CheckForNull Label getAssignedLabelFor(@Nonnull SubTask st) { for (LabelAssignmentAction laa : getActions(LabelAssignmentAction.class)) { Label l = laa.getAssignedLabel(st); if (l!=null) return l; } return st.getAssignedLabel(); }
private WorkChunk(List<SubTask> base, int index) { super(base); assert !base.isEmpty(); this.index = index; this.assignedLabel = getAssignedLabel(base.get(0)); Node lbo = base.get(0).getLastBuiltOn(); for (ExecutorChunk ec : executors) { if (ec.node == lbo) { lastBuiltOn = ec; return; } } lastBuiltOn = null; }
task = workUnit.work; startTime = System.currentTimeMillis(); executable = task.createExecutable();