@Override public String toString() { String ret = null; if (isSuccess()) { ret = "Status: " + this.getStatus() + " message: " + this.getMessage(); } else { ret = "Status: " + this.getStatus() + " error message: " + this.getErrorMessage(); } return ret; } }
public void basicFailureTest(String confKey, Object confValue, ConstraintSolverStrategy cs) { Map<String, Object> config = makeTestTopoConf(); config.put(confKey, confValue); cs.prepare(config); TopologyDetails topo = makeTopology(config, NORMAL_BOLT_PARALLEL); Cluster cluster = makeCluster(topo); LOG.info("Scheduling..."); SchedulingResult result = cs.schedule(cluster, topo); LOG.info("Done scheduling {}...", result); Assert.assertTrue("Assert scheduling topology success " + result, !result.isSuccess()); }
return; } else { if (result.isSuccess()) { cluster.updateFrom(toSchedule); cluster.setStatus(td.getId(), "Running - " + result.getMessage());
LOG.info("Done scheduling {}...", result); Assert.assertTrue("Assert scheduling topology success " + result, result.isSuccess()); Assert.assertEquals("topo all executors scheduled? " + cluster.getUnassignedExecutors(topo), 0, cluster.getUnassignedExecutors(topo).size()); LOG.info("Done scheduling {}...", result); Assert.assertTrue("Assert scheduling topology success " + result, result.isSuccess()); Assert.assertEquals("topo all executors scheduled?", 0, cluster.getUnassignedExecutors(topo).size()); Assert.assertTrue("Valid Scheduling?", ConstraintSolverStrategy.validateSolution(cluster, topo));
assert(schedulingResult.isSuccess()); SchedulerAssignment assignment = cluster.getAssignmentById(topo1.getId()); for (WorkerSlot ws : assignment.getSlotToExecutors().keySet()) { assert(schedulingResult.isSuccess()); assignment = cluster.getAssignmentById(topo2.getId()); for (WorkerSlot ws : assignment.getSlotToExecutors().keySet()) {
assert(schedulingResult.isSuccess()); SchedulerAssignment assignment = cluster.getAssignmentById(topo1.getId()); for (WorkerSlot ws : assignment.getSlotToExecutors().keySet()) { assert(schedulingResult.isSuccess()); assignment = cluster.getAssignmentById(topo2.getId()); for (WorkerSlot ws : assignment.getSlotToExecutors().keySet()) {
public boolean isValid() { if (this.isSuccess() && this.getSchedulingResultMap() == null) { LOG.warn("SchedulingResult not Valid! Status is success but SchedulingResultMap is null"); return false; } if (this.isFailure() && this.getSchedulingResultMap() != null) { LOG.warn("SchedulingResult not Valid! Status is Failure but SchedulingResultMap is NOT null"); return false; } return true; }
@Override public String toString() { String ret = null; if(this.isSuccess()) { ret = "Status: " + this.getStatus() + " message: " + this.getMessage() + " scheduling: " + this.getSchedulingResultMap(); } else { ret = "Status: " + this.getStatus() + " error message: " + this.getErrorMessage(); } return ret; } }
if (result.isSuccess()) { try { if (mkAssignment(td, result.getSchedulingResultMap())) {