Examples of Schedule


Examples of AGEvalSwipl.AGEvaluatorSwipl.Schedule

    String prologGrammarPath = outputDir + File.separator + baseName + ".pl";
    AGEvaluatorSwipl.writeFile(prologGrammarPath, prologGrammar);
    if (verbose) System.out.println("=== PL GRAMMAR: === \n " + prologGrammar);
    ages.runGrammar(resourceDir, prologGrammarPath);
   
    Schedule sched = ages.generateVisits(isFixedChildOrder, isExhaustive, false, maxLen, grammar.alegEval, grammar.ast);   
   
    HashMap<String, String> exprPrinter = genExprPrinter(sched._aleg, grammar.ast.condsTop, sched);
    HashMap<String, String> exprToCall = genExprToCall(sched._aleg, grammar.ast.condsTop, sched, exprPrinter);

    ////////////////////////////////////////////////////////////////
       
    Hashtable<Variable, Term> binding = null;
    int round = 0;   
    (new File(outputDir + File.separator + "variants")).mkdir();
   
    String fHeaders = functionHeaders(grammar.ast);
   
    long queryTime = -System.currentTimeMillis();
    System.err.println("Start time: " + queryTime + "ms");
   
    long timeSinceLastQuery = -System.currentTimeMillis();
    int found = 0;
    int cumQTime = 0;
    while (sched.hasNext()) {
      found++;
      binding = sched.moveNext();   
     
      //if (!sched.isAllParallel()) continue;
     
      long qTime = timeSinceLastQuery + System.currentTimeMillis();
      cumQTime += qTime;
      String seq = "";
      for (Term visit : sched.binding.get("P").toTermArray()) {
        seq += " " + visit.arg(2).arg(1).toString().replace("tdLtrU", "inorder");
      }
      System.err.println("sched: " + seq);
      System.err.println("find time: " + qTime + "ms");
      System.err.println("Running average: " + (cumQTime / found) + "ms/query (over " + found + " queries)");

      long compeTime = -System.currentTimeMillis();
     
      (new File(outputDir + File.separator + "variants/variant" + round)).mkdir();
      backend.generateParseFiles(grammar.ast, sched, outputDir + File.separator + "variants/variant" + round + File.separator, verbose, fHeaders);
     
      LoopRecoverer ir = new LoopRecoverer(sched);
     
      String visitOut =
        backend.preVisits(grammar.alegEval, sched)
        + visits(sched._aleg, ir, binding, sched.computeVisitOrders(), sched.classMap, exprToCall, exprPrinter, sched)
        + backend.postVisits(grammar.alegEval, sched);
      String visitDispatches = visitDispatchers(sched.numVisits(), grammar.alegEval, sched.buSubInorderBuIn, sched.buSubInorderBus);
     
      backend.output(baseName, visitOut, visitDispatches, outputDir + File.separator + "variants/variant" + round + File.separator, true, verbose, grammar.ast, sched, fHeaders, binding, grammar.alegEval);
      AGEvaluatorSwipl.writeFile(outputDir + File.separator + "variants/variant" + round + File.separator + "schedule", seq);
      round++;
      //if (!isExhaustive) {
View Full Code Here

Examples of co.cask.cdap.api.schedule.Schedule

    String name = jsonObj.get("name").getAsString();
    String description = jsonObj.get("description").getAsString();
    String cronExpression = jsonObj.get("cronExpression").getAsString();
    String action = jsonObj.get("action").getAsString();

    return new Schedule(name, description, cronExpression, Schedule.Action.valueOf(action));
  }
View Full Code Here

Examples of com.barchart.feed.base.values.api.Schedule

  private static final long serialVersionUID = 1544081890014047813L;

  @Override
  public Schedule freeze() {
   
    final Schedule newSchedule = new BaseSchedule();
    for(final TimeInterval ti : this) {
      newSchedule.add(ti.freeze());
    }
   
    return newSchedule;
   
  }
View Full Code Here

Examples of com.barchart.util.value.api.Schedule

  }
 
  @Override
  public Schedule copy() {
   
    final Schedule newSchedule = new BaseSchedule();
    for(final TimeInterval ti : this) {
      newSchedule.add(ti.copy());
    }
   
    return newSchedule;
  }
View Full Code Here

Examples of com.barchart.util.values.api.Schedule

  private static final long serialVersionUID = 1544081890014047813L;

  @Override
  public Schedule freeze() {
   
    final Schedule newSchedule = new BaseSchedule();
    for(final TimeInterval ti : this) {
      newSchedule.add(ti.freeze());
    }
   
    return newSchedule;
   
  }
View Full Code Here

Examples of com.casamind.adware.server.domain.Schedule

  }

  private void doSchedule(Long scheduleId) {
    log.info("scheduleId = " + scheduleId);
    if (scheduleId != null) {
      Schedule schedule = DatastoreProxy.getScheduleById(scheduleId);
      if (schedule != null) {
        List<Long> adIds = schedule.getAdIds();
        if (adIds.size() > 0) {
          log.info("Found " + adIds.size() + " ads");
          log.info("Purging Google Calendar from '" + logFormatter.format(schedule.getMinDate()) + "' to '" + logFormatter.format(schedule.getMaxDate()) + "'");
          try {

            Calendar calendar = Calendar.getInstance();
            calendar.setTime(schedule.getMinDate());
            calendar.add(Calendar.DAY_OF_YEAR, -2);
            Date minDate = calendar.getTime();
            CalendarEventFeed rangeFeed = proxy.getEventsRangeFeed(minDate, schedule.getMaxDate());
            List<CalendarEventEntry> entriesToDelete = new ArrayList<CalendarEventEntry>();
            entriesToDelete.addAll(rangeFeed.getEntries());
            int size = entriesToDelete.size();
            while (size > 0) {
              log.info("Adding " + size + " event entries to mass deletion batch...");
              proxy.batchEntries(entriesToDelete, BatchOperationType.DELETE);
              rangeFeed = proxy.getEventsRangeFeed(minDate, schedule.getMaxDate());
              entriesToDelete.clear();
              entriesToDelete.addAll(rangeFeed.getEntries());
              size = entriesToDelete.size();
            }
            log.info("Finshed mass deletion batch.");
View Full Code Here

Examples of com.createsend.models.campaigns.Schedule

     * @throws CreateSendException Thrown when the API responds with a HTTP Status >= 400
     * @see <a href="http://www.campaignmonitor.com/api/campaigns/#sending_a_campaign" target="_blank">
     * Sending a campaign</a>
     */
    public void send(String confirmationEmail, Date sendDate) throws CreateSendException {
        Schedule sched = new Schedule();
        sched.ConfirmationEmail = confirmationEmail;
        sched.SendDate = sendDate == null ? "Immediately" : JsonProvider.ApiDateFormat.format(sendDate);
       
        jerseyClient.post(String.class, sched, "campaigns", campaignID, "send.json");
    }
View Full Code Here

Examples of com.firefly.schedule.core.Schedule

     */   
    @Override
    public void run() {
      try {
          log.debug("Start HeartMonitor!");
          Schedule schedule = config.getSchedule()// 当前调度器
            /* 发送心跳 */
            sendHeartbeat();
           
            /* 检查当前所有任务状态 */
            checkTaskClosed(schedule);
           
            // 调度器正在暂停
            if(Schedule.PAUSING == schedule.getStatus()){
              // 检测任务完成状态
              checkTaskFinish(schedule);
              return;
            }
           
View Full Code Here

Examples of com.firefly.schedule.core.Schedule

    /**
     * 发送心跳
     * @throws SQLException 当数据库操作有异常则抛出此异常
     */
    private void sendHeartbeat() throws SQLException{
    Schedule schedule = config.getSchedule();
    Object[] params = { config.getHostAddress(), schedule.getStatus() , config.getScheduleName()};
    QueryHelper.update("UPDATE jd_ofc_schedule SET updatetime = CONVERT(varchar, getdate(), 120 ) , wsurl = ? , status = ? "
        + "WHERE schedulename = ?", params);
    DBManager.commit();
    }
View Full Code Here

Examples of com.firefly.schedule.core.Schedule

     * @throws ParseException 当格式化日期时间有异常则抛出此异常
     */
    private void checkHeartbeat() throws SQLException, ParseException{
     
      boolean ready = true;            // 任务启动标志
      Schedule schedule = config.getSchedule()// 当前调度器对象
      StringBuilder aliveSchedule = new StringBuilder();
     
      /* 获取所有的调度器 */
      List<ScheduleInfo> scheduleList = QueryHelper.query(ScheduleInfo.class,
                "SELECT id,schedulename,seqno,registertime,updatetime,status " +
                      "FROM jd_ofc_schedule(NOLOCK) " +
                      "ORDER BY id", new Object[]{});
     
      if (scheduleList == null || scheduleList.size() == 0){
        log.error("The schedule heart error!");
        return;
      }
     
      /* 检测存活的调度器 */
      String curTime = TimerUtil.getDbTime();    // 数据库当前时间
        DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      List<ScheduleInfo> aliveList = new ArrayList<ScheduleInfo>();
    for (ScheduleInfo scheduleInfo : scheduleList) {
      // 如果时间差小于超时时间,则判断为该调度器正常
      long timeDiff = sdf.parse(curTime).getTime() - sdf.parse(scheduleInfo.getUpdatetime()).getTime();
      if (timeDiff < config.getHeartTimeout()) {
        aliveList.add(scheduleInfo);
        aliveSchedule.append(scheduleInfo.getId());
        aliveSchedule.append(";");
        if (Schedule.PAUSED != scheduleInfo.getStatus() && ready) {
          ready = false;
        }
      }

    }
        log.debug("aliveList size : {"+aliveList.size()
              +"} , start : {"+ready
              +"} , scheduleNum : {"+config.getScheduleNum()
              +"} , aliveSchedule = "+config.getAliveSchedule()
              +" , curAliveSchedule = "+aliveSchedule.toString());
     
    /* 如果存活调度器有变化,则暂停调度器任务处理 */
    if (!aliveSchedule.toString().equals(config.getAliveSchedule())
        && Schedule.RUNNING == schedule.getStatus()) {
      abortTask(schedule);
    }

    /* 如果调度器就绪,则重新分配任务 */
    if (ready) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.