Integer v = footprint.get(c); if (v==null) v = 0; v += e.getKey().size(); footprint.put(c,v);
/** * Checks if the assignments made thus far are valid an within the constraints. */ public boolean isPartiallyValid() { int[] used = new int[executors.size()]; for (int i=0; i<mapping.length; i++) { ExecutorChunk ec = mapping[i]; if (ec==null) continue; if (!ec.canAccept(works(i))) return false; // invalid assignment if ((used[ec.index] += works(i).size()) > ec.capacity()) return false; } return true; }
Integer v = footprint.get(c); if (v==null) v = 0; v += e.getKey().size(); footprint.put(c,v);
/** * Checks if the assignments made thus far are valid an within the * constraints. */ public boolean isPartiallyValid() { int[] used = new int[executors.size()]; for (int i = 0; i < mapping.length; i++) { ExecutorChunk ec = mapping[i]; if (ec == null) { continue; } if (!ec.canAccept(works(i))) { return false; // invalid assignment } if ((used[ec.index] += works(i).size()) > ec.capacity()) { return false; } } return true; }
/** * Checks if the assignments made thus far are valid an within the constraints. */ public boolean isPartiallyValid() { int[] used = new int[executors.size()]; for (int i=0; i<mapping.length; i++) { ExecutorChunk ec = mapping[i]; if (ec==null) continue; if (!ec.canAccept(works(i))) return false; // invalid assignment if ((used[ec.index] += works(i).size()) > ec.capacity()) return false; } return true; }
/** * Checks if the assignments made thus far are valid an within the constraints. */ public boolean isPartiallyValid() { int[] used = new int[executors.size()]; for (int i=0; i<mapping.length; i++) { ExecutorChunk ec = mapping[i]; if (ec==null) continue; if (!ec.canAccept(works(i))) return false; // invalid assignment if ((used[ec.index] += works(i).size()) > ec.capacity()) return false; } return true; }
/** * Checks if the assignments made thus far are valid an within the constraints. */ public boolean isPartiallyValid() { int[] used = new int[executors.size()]; for (int i=0; i<mapping.length; i++) { ExecutorChunk ec = mapping[i]; if (ec==null) continue; if (!ec.canAccept(works(i))) return false; // invalid assignment if ((used[ec.index] += works(i).size()) > ec.capacity()) return false; } return true; }
/** * Checks if the assignments made thus far are valid an within the constraints. */ public boolean isPartiallyValid() { int[] used = new int[executors.size()]; for (int i=0; i<mapping.length; i++) { ExecutorChunk ec = mapping[i]; if (ec==null) continue; if (!ec.canAccept(works(i))) return false; // invalid assignment if ((used[ec.index] += works(i).size()) > ec.capacity()) return false; } return true; }
private void execute(WorkChunk wc, WorkUnitContext wuc) { assert capacity() >= wc.size(); int e = 0; for (SubTask s : wc) { while (!get(e).isAvailable()) e++; get(e++).set(wuc.createWorkUnit(s)); } } }
/** * Is this executor chunk and the given work chunk compatible? Can the latter be run on the former? */ public boolean canAccept(WorkChunk c) { return this.size() >= c.size() && (c.assignedLabel==null || c.assignedLabel.contains(node)); }
private void execute(WorkChunk wc, WorkUnitContext wuc) { assert capacity() >= wc.size(); int e = 0; for (SubTask s : wc) { while (!get(e).isAvailable()) e++; get(e++).set(wuc.createWorkUnit(s)); } } }
private void execute(WorkChunk wc, WorkUnitContext wuc) { assert capacity() >= wc.size(); int e = 0; for (SubTask s : wc) { while (!get(e).isAvailable()) e++; get(e++).set(wuc.createWorkUnit(s)); } } }
/** * Is this executor chunk and the given work chunk compatible? Can the latter be run on the former? */ public boolean canAccept(WorkChunk c) { return this.size() >= c.size() && (c.assignedLabel==null || c.assignedLabel.contains(node)); }
/** * Is this executor chunk and the given work chunk compatible? Can the latter be run on the former? */ public boolean canAccept(WorkChunk c) { return this.size() >= c.size() && (c.assignedLabel==null || c.assignedLabel.contains(node)); }
private void execute(WorkChunk wc, WorkUnitContext wuc) { assert capacity() >= wc.size(); int e = 0; for (SubTask s : wc) { while (!get(e).isAvailable()) { e++; } get(e++).set(wuc.createWorkUnit(s)); } } }
/** * Is this executor chunk and the given work chunk compatible? Can the * latter be run on the former? */ public boolean canAccept(WorkChunk c) { return this.size() >= c.size() && (c.assignedLabel == null || c.assignedLabel.contains(node)); }
private void execute(WorkChunk wc, WorkUnitContext wuc) { assert capacity() >= wc.size(); int e = 0; for (SubTask s : wc) { while (!get(e).isAvailable()) e++; get(e++).set(wuc.createWorkUnit(s)); } } }
/** * Is this executor chunk and the given work chunk compatible? Can the latter be run on the former? */ public boolean canAccept(WorkChunk c) { if (this.size()<c.size()) return false; // too small compared towork if (c.assignedLabel!=null && !c.assignedLabel.contains(node)) return false; // label mismatch if (!nodeAcl.hasPermission(item.authenticate(), Computer.BUILD)) return false; // tasks don't have a permission to run on this node return true; }
private void execute(WorkChunk wc, WorkUnitContext wuc) { assert capacity() >= wc.size(); int e = 0; for (SubTask s : wc) { while (!get(e).isAvailable()) e++; get(e++).set(wuc.createWorkUnit(s)); } } }
/** * Is this executor chunk and the given work chunk compatible? Can the latter be run on the former? */ public boolean canAccept(WorkChunk c) { if (this.size()<c.size()) return false; // too small compared towork if (c.assignedLabel!=null && !c.assignedLabel.contains(node)) return false; // label mismatch if (!(Node.SKIP_BUILD_CHECK_ON_FLYWEIGHTS && item.task instanceof Queue.FlyweightTask) && !nodeAcl.hasPermission(item.authenticate(), Computer.BUILD)) return false; // tasks don't have a permission to run on this node return true; }