MessageOrderIterator(Transaction tx, MessageOrderCursor m, MessageOrderIndex messageOrderIndex) throws IOException { Long pendingAddLimiter = messageOrderIndex.minPendingAdd(); this.defaultIterator = defaultPriorityIndex.iterator(tx, m.defaultCursorPosition, pendingAddLimiter); if (highPriorityIndex != null) { this.highIterator = highPriorityIndex.iterator(tx, m.highPriorityCursorPosition, pendingAddLimiter); } else { this.highIterator = null; } if (lowPriorityIndex != null) { this.lowIterator = lowPriorityIndex.iterator(tx, m.lowPriorityCursorPosition, pendingAddLimiter); } else { this.lowIterator = null; } }
void getDeleteList(Transaction tx, ArrayList<Entry<Long, MessageKeys>> deletes, BTreeIndex<Long, MessageKeys> index, Long sequenceId) throws IOException { Iterator<Entry<Long, MessageKeys>> iterator = index.iterator(tx, sequenceId, null); deletes.add(iterator.next()); }
void loadLists(Transaction tx, Map<String, PListImpl> lists) throws IOException { for (Iterator<Entry<String, PListImpl>> i = this.lists.iterator(tx); i.hasNext();) { Entry<String, PListImpl> entry = i.next(); entry.getValue().load(tx); lists.put(entry.getKey(), entry.getValue()); } }
void loadScheduler(Transaction tx, Map<String, LegacyJobSchedulerImpl> schedulers) throws IOException { for (Iterator<Entry<String, LegacyJobSchedulerImpl>> i = this.storedSchedulers.iterator(tx); i.hasNext();) { Entry<String, LegacyJobSchedulerImpl> entry = i.next(); entry.getValue().load(tx); schedulers.put(entry.getKey(), entry.getValue()); } }
/** * Walks the Scheduled Job Tree and collects the add location and last update location * for all scheduled jobs. * * This method must be called with the index locked. * * @param tx * the transaction under which this operation was invoked. * * @return a list of all referenced Location values for this JobSchedulerImpl * * @throws IOException if an error occurs walking the scheduler tree. */ protected List<JobLocation> getAllScheduledJobs(Transaction tx) throws IOException { List<JobLocation> references = new ArrayList<>(); for (Iterator<Map.Entry<Long, List<JobLocation>>> i = this.index.iterator(tx); i.hasNext();) { Map.Entry<Long, List<JobLocation>> entry = i.next(); List<JobLocation> scheduled = entry.getValue(); for (JobLocation job : scheduled) { references.add(job); } } return references; }
/** * Loads all the stored JobScheduler instances into the provided map. * * @param tx * the Transaction under which the load operation should be executed. * @param schedulers * a Map<String, JobSchedulerImpl> into which the loaded schedulers are stored. * * @throws IOException if an error occurs while performing the load operation. */ public void loadScheduler(Transaction tx, Map<String, JobSchedulerImpl> schedulers) throws IOException { for (Iterator<Entry<String, JobSchedulerImpl>> i = this.storedSchedulers.iterator(tx); i.hasNext();) { Entry<String, JobSchedulerImpl> entry = i.next(); entry.getValue().load(tx); schedulers.put(entry.getKey(), entry.getValue()); } }
private void removeJournalRCForMissingFiles(Transaction tx, Set<Integer> missing) throws IOException { List<Integer> matches = new ArrayList<Integer>(); Iterator<Entry<Integer, Integer>> references = metaData.getJournalRC().iterator(tx); while (references.hasNext()) { int dataFileId = references.next().getKey(); if (missing.contains(dataFileId)) { matches.add(dataFileId); } } for (Integer match : matches) { metaData.getJournalRC().remove(tx, match); } }
for (Iterator<Entry<Long, MessageRecord>> iterator = sd.orderIndex.iterator(tx); iterator.hasNext();) { Entry<Long, MessageRecord> entry = iterator.next(); if (entry.getKey().compareTo(sequenceId) <= 0) {
Iterator<Entry<Integer, List<Integer>>> removals = metaData.getRemoveLocationTracker().iterator(tx); List<Integer> orphans = new ArrayList<Integer>(); while (removals.hasNext()) {
for (Iterator<Map.Entry<String, JobSchedulerImpl>> i = metaData.getJobSchedulers().iterator(tx); i.hasNext();) { Map.Entry<String, JobSchedulerImpl> entry = i.next(); JobSchedulerImpl scheduler = entry.getValue(); for (Iterator<Map.Entry<String, JobSchedulerImpl>> i = metaData.getJobSchedulers().iterator(tx); i.hasNext();) { Map.Entry<String, JobSchedulerImpl> entry = i.next(); JobSchedulerImpl scheduler = entry.getValue();
for (Iterator<Map.Entry<Long, List<JobLocation>>> i = this.index.iterator(tx, start); i.hasNext();) { Map.Entry<Long, List<JobLocation>> entry = i.next(); if (entry.getKey().longValue() <= finish) {
for (Iterator<Map.Entry<String, JobSchedulerImpl>> i = metaData.getJobSchedulers().iterator(tx); i.hasNext();) { Map.Entry<String, JobSchedulerImpl> entry = i.next(); JobSchedulerImpl scheduler = entry.getValue();
for (Iterator<Map.Entry<Long, List<JobLocation>>> i = this.index.iterator(tx); i.hasNext();) { Map.Entry<Long, List<JobLocation>> entry = i.next(); List<JobLocation> candidates = entry.getValue();
for (Iterator<Entry<Location, Long>> iterator = rc.locationIndex.iterator(tx); iterator.hasNext(); ) { Entry<Location, Long> entry = iterator.next(); for (Iterator<Entry<String, LastAck>> iterator = rc.subscriptionAcks.iterator(tx); iterator.hasNext(); ) { Entry<String, LastAck> entry = iterator.next(); for (Iterator<Entry<Long, MessageKeys>> orderIterator = for (Iterator<Entry<String, LastAck>> iterator = rc.subscriptionAcks.iterator(tx); iterator.hasNext(); ) { Entry<String, LastAck> entry = iterator.next(); rc.subscriptionCache.add(entry.getKey()); for (Iterator<Entry<String, LastAck>> iterator = rc.subscriptionAcks.iterator(tx); iterator.hasNext();) { Entry<String, LastAck> entry = iterator.next(); rc.orderIndex.nextMessageId =
rc.subscriptionCursors = new HashMap<String, Long>(); for (Iterator<Entry<String, Long>> iterator = rc.subscriptionAcks.iterator(tx); iterator.hasNext();) { Entry<String, Long> entry = iterator.next(); addAckByteSequence(rc, entry.getValue(), entry.getKey());
void getDeleteList(Transaction tx, ArrayList<Entry<Long, MessageKeys>> deletes, BTreeIndex<Long, MessageKeys> index, Long sequenceId) throws IOException { Iterator<Entry<Long, MessageKeys>> iterator = index.iterator(tx, sequenceId, null); deletes.add(iterator.next()); }
void getDeleteList(Transaction tx, ArrayList<Entry<Long, MessageKeys>> deletes, BTreeIndex<Long, MessageKeys> index, Long sequenceId) throws IOException { Iterator<Entry<Long, MessageKeys>> iterator = index.iterator(tx, sequenceId, null); deletes.add(iterator.next()); }
void loadLists(Transaction tx, Map<String, PListImpl> lists) throws IOException { for (Iterator<Entry<String, PListImpl>> i = this.lists.iterator(tx); i.hasNext();) { Entry<String, PListImpl> entry = i.next(); entry.getValue().load(tx); lists.put(entry.getKey(), entry.getValue()); } }
void loadScheduler(Transaction tx, Map<String, LegacyJobSchedulerImpl> schedulers) throws IOException { for (Iterator<Entry<String, LegacyJobSchedulerImpl>> i = this.storedSchedulers.iterator(tx); i.hasNext();) { Entry<String, LegacyJobSchedulerImpl> entry = i.next(); entry.getValue().load(tx); schedulers.put(entry.getKey(), entry.getValue()); } }
void loadScheduler(Transaction tx, Map<String, LegacyJobSchedulerImpl> schedulers) throws IOException { for (Iterator<Entry<String, LegacyJobSchedulerImpl>> i = this.storedSchedulers.iterator(tx); i.hasNext();) { Entry<String, LegacyJobSchedulerImpl> entry = i.next(); entry.getValue().load(tx); schedulers.put(entry.getKey(), entry.getValue()); } }