Package org.joda.time

Examples of org.joda.time.DateTime.plus()


                    session.execute(updateNewIndex.bind(newBucket, partition, time.toDate(), scheduleId));
                }
            }
            if (count < PAGE_SIZE) {
                time = time.plus(timeSlice);
                if (time.equals(day.plus(Days.ONE.toStandardDuration()))) {
                    day = day.plusDays(1);
                }
                statement = find412IndexEntries.bind(oldBucket, day.toDate(), time.toDate());
            } else {
                statement = find412IndexEntriesAfterScheduleId.bind(oldBucket, day.toDate(), time.toDate(),
View Full Code Here


                partition = (scheduleId % NUM_PARTITIONS);
                ++count;
                session.execute(updateNewIndex.bind(newBucket, partition, time.toDate(), scheduleId));
            }
            if (count < PAGE_SIZE) {
                time = time.plus(timeSlice);
                statement = find411IndexEntries.bind(oldBucket, time.toDate());
            } else {
                statement = find411IndexEntriesAfterScheduleId.bind(oldBucket, time.toDate(), scheduleId);
            }
            count = 0;
View Full Code Here

        while (time.isBefore(endTime)) {
            for (Integer scheduleId : scheduleIds) {
                session.execute("insert into metrics_index (bucket, time, schedule_id) values ('" + bucket +
                    "', " + time.getMillis() + ", " + scheduleId + ")");
            }
            time = time.plus(timeSlice);
        }
    }

    private void populateRaw412Index(DateTime startTime, DateTime endTime, List<Integer> scheduleIds) {
        populate412Index("raw_metrics", startTime, endTime, Hours.ONE.toStandardDuration(), scheduleIds);
View Full Code Here

            // important and will likely not match since loadIndex() merges results from
            // queries across multiple index partitions.
            Set<Integer> expected = ImmutableSet.copyOf(expectedScheduleIds);
            Set<Integer> actual = ImmutableSet.copyOf(actualScheduleIds);
            assertEquals(actual, expected, "The " + bucket + " data index is wrong for " + time);
            time = time.plus(timeSlice);
        }
    }

    private List<Integer> loadIndex(String bucket, DateTime time) throws InterruptedException {
        List<ResultSetFuture> queryFutures = new ArrayList<ResultSetFuture>(NUM_PARTITIONS);
View Full Code Here

                    public void onFailure(Throwable t) {
                        log.warn("Insert [" + insert.getQueryString() + "] failed", t);
                    }
                });
            }
            time = time.plus(duration);
        }
    }

    private void createResource() throws Exception {
        String insertResourceType = "insert into rhq_resource_type (id, name, category, creation_data_type, " +
View Full Code Here

public class TimeDateUtils {

    public static String getDataNextMesi(int numeroMesi) {
        DateTime now = new DateTime();
        ReadablePeriod noUpdatePeriod = new Period().withMonths(numeroMesi);
        return now.plus(noUpdatePeriod).toString();
    }

    public static String getDataNextMesiFormattata(int numeroMesi, String regexp) {
        DateTime now = new DateTime();
        ReadablePeriod noUpdatePeriod = new Period().withMonths(numeroMesi);
View Full Code Here

    }

    public static String getDataNextMesiFormattata(int numeroMesi, String regexp) {
        DateTime now = new DateTime();
        ReadablePeriod noUpdatePeriod = new Period().withMonths(numeroMesi);
        return new SimpleDateFormat(regexp).format(now.plus(noUpdatePeriod).toDate());
    }

    public static String getDataPreviousMesi(int numeroMesi) {
        DateTime now = new DateTime();
        ReadablePeriod noUpdatePeriod = new Period().withMonths(numeroMesi);
View Full Code Here

   
    DateTime now = DateTime.now();
    SimpleDateFormat fmt = GlobalSettings.createHunDateFormatter();
    service.create("TodoTask description " + fmt.format(now.toDate()));
    monitor.setLastRun(now.toDate());
    monitor.setNextRun(now.plus(monitor.getInterval()).toDate());
    logger.info("TodoTask executed at " + fmt.format(monitor.getLastRun()) + " and will execute at "
        + fmt.format(monitor.getNextRun()));
  }
}
View Full Code Here

  }
 
  private void schedule() {
    DateTime startTime = this.lastRun == null ? DateTime.now() : new DateTime(this.lastRun);
    this.pluginScheduler.scheduleJob(JOB_NAME, TodoTask.class, this.jobDataMap, startTime.toDate(), this.interval);
    this.setNextRun(startTime.plus(this.interval).toDate());
    logger.info(String.format("TodoMonitorImpl scheduled to run every %d ms", this.interval));
  }
 
  @Override
  public void setLastRun(Date lastRun) {
View Full Code Here

      duration = Duration.standardHours(1);
    }
   
    // check interval at next half hour
    DateTime firstTimeslot = getNextHalfHour();
    Interval test = new Interval(firstTimeslot, firstTimeslot.plus(duration));
    testInterval(infeasible, preferred, test, solutions);
   
    // loop over all infeasible intervals
    for (Interval i : infeasible) {
      // test timeslot left from the infeasible interval
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.