@Override public Mapping map(Task task, MappingWorksheet worksheet) { if (Queue.ifBlockedByHudsonShutdown(task)) { // if we are quieting down, don't start anything new so that // all executors will be eventually free. return null; } return base.map(task, worksheet); }
@Override public Mapping map(Task task, MappingWorksheet worksheet) { if (Queue.ifBlockedByHudsonShutdown(task)) { // if we are quieting down, don't start anything new so that // all executors will be eventually free. return null; } return base.map(task, worksheet); }
@Override public Mapping map(Task task, MappingWorksheet worksheet) { if (Queue.ifBlockedByHudsonShutdown(task)) { // if we are quieting down, don't start anything new so that // all executors will be eventually free. return null; } return base.map(task, worksheet); }
@Override public Mapping map(Task task, MappingWorksheet worksheet) { if (Queue.ifBlockedByHudsonShutdown(task)) { // if we are quieting down, don't start anything new so that // all executors will be eventually free. return null; } return base.map(task, worksheet); }
public CauseOfBlockage getCauseOfBlockage() { Hudson hudson = Hudson.getInstance(); if(ifBlockedByHudsonShutdown(task)) return CauseOfBlockage.fromMessage(Messages._Queue_HudsonIsAboutToShutDown()); Label label = task.getAssignedLabel(); if (hudson.getNodes().isEmpty()) label = null; // no master/slave. pointless to talk about nodes if (label != null) { if (label.isOffline()) { Set<Node> nodes = label.getNodes(); if (nodes.size() != 1) return new BecauseLabelIsOffline(label); else return new BecauseNodeIsOffline(nodes.iterator().next()); } } if(label==null) return CauseOfBlockage.fromMessage(Messages._Queue_WaitingForNextAvailableExecutor()); Set<Node> nodes = label.getNodes(); if (nodes.size() != 1) return new BecauseLabelIsBusy(label); else return new BecauseNodeIsBusy(nodes.iterator().next()); }
public CauseOfBlockage getCauseOfBlockage() { Hudson hudson = Hudson.getInstance(); if(ifBlockedByHudsonShutdown(task)) return CauseOfBlockage.fromMessage(Messages._Queue_HudsonIsAboutToShutDown()); Label label = task.getAssignedLabel(); if (hudson.getNodes().isEmpty()) label = null; // no master/slave. pointless to talk about nodes if (label != null) { if (label.isOffline()) { Set<Node> nodes = label.getNodes(); if (nodes.size() != 1) return new BecauseLabelIsOffline(label); else return new BecauseNodeIsOffline(nodes.iterator().next()); } } if(label==null) return CauseOfBlockage.fromMessage(Messages._Queue_WaitingForNextAvailableExecutor()); Set<Node> nodes = label.getNodes(); if (nodes.size() != 1) return new BecauseLabelIsBusy(label); else return new BecauseNodeIsBusy(nodes.iterator().next()); }
public CauseOfBlockage getCauseOfBlockage() { Hudson hudson = Hudson.getInstance(); if(ifBlockedByHudsonShutdown(task)) return CauseOfBlockage.fromMessage(Messages._Queue_HudsonIsAboutToShutDown()); Label label = task.getAssignedLabel(); if (hudson.getNodes().isEmpty()) label = null; // no master/slave. pointless to talk about nodes if (label != null) { if (label.isOffline()) { Set<Node> nodes = label.getNodes(); if (nodes.size() != 1) return new BecauseLabelIsOffline(label); else return new BecauseNodeIsOffline(nodes.iterator().next()); } } if(label==null) return CauseOfBlockage.fromMessage(Messages._Queue_WaitingForNextAvailableExecutor()); Set<Node> nodes = label.getNodes(); if (nodes.size() != 1) return new BecauseLabelIsBusy(label); else return new BecauseNodeIsBusy(nodes.iterator().next()); }
@Override public CauseOfBlockage getCauseOfBlockage() { Hudson hudson = Hudson.getInstance(); if (ifBlockedByHudsonShutdown(task)) { return CauseOfBlockage.fromMessage(Messages._Queue_HudsonIsAboutToShutDown());
private void makeBuildable(BuildableItem p) { if(Hudson.FLYWEIGHT_SUPPORT && p.task instanceof FlyweightTask && !ifBlockedByHudsonShutdown(p.task)) { ConsistentHash<Node> hash = new ConsistentHash<Node>(new Hash<Node>() { public String hash(Node node) { return node.getNodeName(); } }); Hudson h = Hudson.getInstance(); hash.add(h, h.getNumExecutors()*100); for (Node n : h.getNodes()) hash.add(n,n.getNumExecutors()*100); Label lbl = p.task.getAssignedLabel(); for (Node n : hash.list(p.task.getFullDisplayName())) { Computer c = n.toComputer(); if (c==null || c.isOffline()) continue; if (lbl!=null && !lbl.contains(n)) continue; c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); pendings.add(p); return; } // if the execution get here, it means we couldn't schedule it anywhere. // so do the scheduling like other normal jobs. } buildables.put(p.task,p); }
private void makeBuildable(BuildableItem p) { if(Hudson.FLYWEIGHT_SUPPORT && p.task instanceof FlyweightTask && !ifBlockedByHudsonShutdown(p.task)) { ConsistentHash<Node> hash = new ConsistentHash<Node>(new Hash<Node>() { public String hash(Node node) { return node.getNodeName(); } }); Hudson h = Hudson.getInstance(); hash.add(h, h.getNumExecutors()*100); for (Node n : h.getNodes()) hash.add(n,n.getNumExecutors()*100); Label lbl = p.task.getAssignedLabel(); for (Node n : hash.list(p.task.getFullDisplayName())) { Computer c = n.toComputer(); if (c==null || c.isOffline()) continue; if (lbl!=null && !lbl.contains(n)) continue; c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); pendings.add(p); return; } // if the execution get here, it means we couldn't schedule it anywhere. // so do the scheduling like other normal jobs. } buildables.put(p.task,p); }
private void makeBuildable(BuildableItem p) { if(Hudson.FLYWEIGHT_SUPPORT && p.task instanceof FlyweightTask && !ifBlockedByHudsonShutdown(p.task)) { ConsistentHash<Node> hash = new ConsistentHash<Node>(new Hash<Node>() { public String hash(Node node) { return node.getNodeName(); } }); Hudson h = Hudson.getInstance(); hash.add(h, h.getNumExecutors()*100); for (Node n : h.getNodes()) hash.add(n,n.getNumExecutors()*100); Label lbl = p.task.getAssignedLabel(); for (Node n : hash.list(p.task.getFullDisplayName())) { Computer c = n.toComputer(); if (c==null || c.isOffline()) continue; if (lbl!=null && !lbl.contains(n)) continue; c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); pendings.add(p); return; } // if the execution get here, it means we couldn't schedule it anywhere. // so do the scheduling like other normal jobs. } buildables.put(p.task,p); }
private void makeBuildable(BuildableItem p) { if (Hudson.FLYWEIGHT_SUPPORT && p.task instanceof FlyweightTask && !ifBlockedByHudsonShutdown(p.task)) { ConsistentHash<Node> hash = new ConsistentHash<Node>(new Hash<Node>() { public String hash(Node node) {