private void addRegular(Entry entry) { entries.put(entry.objId, entry); regularQ.add(entry); regularCount.inc(); }
public Entry next() { String which = null; Entry entry = null; if (!priorityQ.isEmpty()) { entry = priorityQ.remove(0); priorityCount.dec(); which = "priority"; } else if (!regularQ.isEmpty()) { entry = regularQ.remove(0); regularCount.dec(); which = "regular"; } else { throw new NoSuchElementException(); } entries(entry.objType).entries.remove(entry.objId); // log.debug("Returning {}. Remaining: priority={}, regular={}", // entry, priorityCount.getCount(), regularCount.getCount()); return entry; }
public void addPriority(Entry entry) { entries.put(entry.objId, entry); priorityQ.add(entry); priorityCount.inc(); } }
public void fail(EventLogFailure failure) { WrappedEventLog wrapped = (WrappedEventLog) failure.log; failureQ.add(wrapped); wrapped.entry.fail(); failureCount.inc(); // Note: this will stay in the hash map to prevent future access. }
/** * Return a wrapped version of {@link ome.services.eventlogs.EventLogQueue.Data#next()} which could possibly be * null. */ public EventLog next() { nextCount.inc(); return offer(data.next()); }