@Override public String toString() { StringBuilder sBuf = new StringBuilder(); sBuf.append(getReservationId()).append(" user:").append(getUser()) .append(" startTime: ").append(getStartTime()).append(" endTime: ") .append(getEndTime()).append(" Periodiciy: ").append(periodicity) .append(" alloc:\n[").append(resourcesOverTime.toString()).append("] "); return sBuf.toString(); }
@Override public String toString() { StringBuilder sBuf = new StringBuilder(); sBuf.append(getReservationId()).append(" user:").append(getUser()) .append(" startTime: ").append(getStartTime()).append(" endTime: ") .append(getEndTime()).append(" alloc:[") .append(resourcesOverTime.toString()).append("] "); return sBuf.toString(); }
@Override public String toString() { StringBuilder sBuf = new StringBuilder(); sBuf.append(getReservationId()).append(" user:").append(getUser()) .append(" startTime: ").append(getStartTime()).append(" endTime: ") .append(getEndTime()).append(" alloc:[") .append(resourcesOverTime.toString()).append("] "); return sBuf.toString(); }
@Override public Set<ReservationAllocation> getReservationsAtTime(long tick) { ReservationInterval searchInterval = new ReservationInterval(tick, Long.MAX_VALUE); readLock.lock(); try { SortedMap<ReservationInterval, Set<InMemoryReservationAllocation>> reservations = currentReservations.headMap(searchInterval, true); if (!reservations.isEmpty()) { Set<ReservationAllocation> flattenedReservations = new HashSet<ReservationAllocation>(); for (Set<InMemoryReservationAllocation> reservationEntries : reservations .values()) { for (InMemoryReservationAllocation reservation : reservationEntries) { if (reservation.getEndTime() > tick) { flattenedReservations.add(reservation); } } } return Collections.unmodifiableSet(flattenedReservations); } else { return Collections.emptySet(); } } finally { readLock.unlock(); } }
@Override public Set<ReservationAllocation> getReservationsAtTime(long tick) { ReservationInterval searchInterval = new ReservationInterval(tick, Long.MAX_VALUE); readLock.lock(); try { SortedMap<ReservationInterval, Set<InMemoryReservationAllocation>> reservations = currentReservations.headMap(searchInterval, true); if (!reservations.isEmpty()) { Set<ReservationAllocation> flattenedReservations = new HashSet<ReservationAllocation>(); for (Set<InMemoryReservationAllocation> reservationEntries : reservations .values()) { for (InMemoryReservationAllocation reservation : reservationEntries) { if (reservation.getEndTime() > tick) { flattenedReservations.add(reservation); } } } return Collections.unmodifiableSet(flattenedReservations); } else { return Collections.emptySet(); } } finally { readLock.unlock(); } }
.values()) { for (InMemoryReservationAllocation reservation : reservationEntries) { if (reservation.getEndTime() <= archivalTime) { expiredReservations.add(reservation);
.values()) { for (InMemoryReservationAllocation reservation : reservationEntries) { if (reservation.getEndTime() <= archivalTime) { expiredReservations.add(reservation);
.values()) { for (InMemoryReservationAllocation reservation : reservationEntries) { if (reservation.getEndTime() <= archivalTime) { expiredReservations.add(reservation);
(reservation.getEndTime() -shift) % period; long periodicSearchStart = (startTime - shift) % period; long periodicSearchEnd = (endTime - shift) % period; if (reservation.getEndTime() > startTime) { flattenedReservations.add(reservation);
ReservationInterval searchInterval = new ReservationInterval(inMemReservation.getStartTime(), inMemReservation.getEndTime()); Set<InMemoryReservationAllocation> reservations = currentReservations.get(searchInterval);
ReservationInterval searchInterval = new ReservationInterval(inMemReservation.getStartTime(), inMemReservation.getEndTime()); Set<InMemoryReservationAllocation> reservations = currentReservations.get(searchInterval);
inMemReservation.getStartTime(), inMemReservation.getEndTime()); Set<InMemoryReservationAllocation> reservations = currentReservations.get(searchInterval);