Package uk.org.microbase.scheduler.db.data

Examples of uk.org.microbase.scheduler.db.data.ResponderInfo


  }

  private ActiveProcess findComputeJob()
      throws DBException
  {
    ResponderInfo responder = chooseResponder();
    if (responder == null)
    {
      return null;
    }
    ActiveProcess process = makeProcess(
View Full Code Here


            +": 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
      {
View Full Code Here

      String fileBucket, String filePath, String fileName,
      long checkDemandEveryMs, int maxInstances)
      throws DBException
  {
    logger.info("Registering responder: "+responderGuid);
    ResponderInfo responder = new ResponderInfo();

    responder.setCheckDemandEveryMs(checkDemandEveryMs);
    responder.setEnabled(enabled);
    responder.setMaxInstances(maxInstances);
    responder.setTaskTypeGuid(responderGuid);

    FileInfo responderFileInfo = new FileInfo(fileBucket, filePath, fileName);
    responder.setFileInfo(responderFileInfo);
   
    responderDao.registerResponder(responder);
  }
View Full Code Here

TOP

Related Classes of uk.org.microbase.scheduler.db.data.ResponderInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.