+": not running because numJobs ("
+ numJobs + ") <= active (" + active + ")");
continue;
}
ResponderInfo info = responderDao.getResponderRegistration(guid);
if (active >= info.getMaxInstances())
{
logger.info("Evaluating responder: "+ guid
+ ": not running because there are " + active
+ " active jobs, but the responder has a maximum concurrency "
+ "limit of " + info.getMaxInstances());
continue;
}
responderLoads.put(info, numJobs);
}
logger.info("Choosing from the following set of responder -> load levels: "
+ responderLoads.toString());
if (responderLoads.isEmpty())
{
logger.info("No additional work could be started");
return null;
}
List<ResponderInfo> guids =
new ArrayList<ResponderInfo>(responderLoads.keySet());
Collections.shuffle(guids);
ResponderInfo selected = null;
for (ResponderInfo responder : responderLoads.keySet())
{
selected = responder;
if (Math.random() < 0.25d) //Arbitrary figure... let's see if this works
{