Collects an ordered list of Writes to execute to BookKeeper.

@return The list of Writes to execute.
335183
private List<Write> getWritesToExecute() {
        // Calculate how much estimated space there is in the current ledger.
        final long maxTotalSize = this.config.getBkLedgerMaxSize() - getWriteLedger().ledger.getLength();

        // Get the writes to execute from the queue.
        List<Write> toExecute = this.writes.getWritesToExecute(maxTotalSize);

        // Check to see if any writes executed on closed ledgers, in which case they either need to be failed (if deemed
        // appropriate, or retried).
        if (handleClosedLedgers(toExecute)) {
            // If any changes were made to the Writes in the list, re-do the search to get a more accurate list of Writes
            // to execute (since some may have changed Ledgers, more writes may not be eligible for execution).
            toExecute = this.writes.getWritesToExecute(maxTotalSize);
        }

        return toExecute;
    }
629359
public List<Stanza> getCollectedStanzasAfterCancelled() {
        if (!cancelled) {
            throw new IllegalStateException("Stanza collector was not yet cancelled");
        }

        if (collectedCache == null) {
            collectedCache = new ArrayList<>(getCollectedCount());
            collectedCache.addAll(resultQueue);
        }

        return collectedCache;
    }
163622
private List<RuleEntry> getSortedEntries() {
        List<RuleEntry> ruleEntries = new ArrayList<RuleEntry>(
                methodRules.size() + testRules.size());
        for (MethodRule rule : methodRules) {
            ruleEntries.add(new RuleEntry(rule, RuleEntry.TYPE_METHOD_RULE, orderValues.get(rule)));
        }
        for (TestRule rule : testRules) {
            ruleEntries.add(new RuleEntry(rule, RuleEntry.TYPE_TEST_RULE, orderValues.get(rule)));
        }
        Collections.sort(ruleEntries, ENTRY_COMPARATOR);
        return ruleEntries;
    }
1349124
public @Nonnull List<String> getJobs() {
        List<String> r = new ArrayList<>();
        r.addAll(usages.keySet());
        Collections.sort(r);
        return r;
    }
1365440
def writers(self):
        
        return list((fd, data) for fd, (data, gen) in self._wfds.items())
1143850
public UnsafeSorterIterator getSortedIterator() throws IOException {
    assert(recordComparatorSupplier != null);
    if (spillWriters.isEmpty()) {
      assert(inMemSorter != null);
      readingIterator = new SpillableIterator(inMemSorter.getSortedIterator());
      return readingIterator;
    } else {
      final UnsafeSorterSpillMerger spillMerger = new UnsafeSorterSpillMerger(
        recordComparatorSupplier.get(), prefixComparator, spillWriters.size());
      for (UnsafeSorterSpillWriter spillWriter : spillWriters) {
        spillMerger.addSpillIfNotEmpty(spillWriter.getReader(serializerManager));
      }
      if (inMemSorter != null) {
        readingIterator = new SpillableIterator(inMemSorter.getSortedIterator());
        spillMerger.addSpillIfNotEmpty(readingIterator);
      }
      return spillMerger.getSortedIterator();
    }
  }
1041999
public List<Executor> getAllExecutors() {
        List<Executor> result = new ArrayList<>(executors.size() + oneOffExecutors.size());
        result.addAll(executors);
        result.addAll(oneOffExecutors);
        return result;
    }
1000323
def executions(self) -> List[Execution]:
        
        return list(fill.execution for fill in self.wrapper.fills.values())
467565
public ArrayList<I> getInvocations()
  {
    LruCache<Object,I> invocationCache = _invocationCache;

    ArrayList<I> invocationList = new ArrayList<>();
      
    synchronized (invocationCache) {
      Iterator<I> iter;
      iter = invocationCache.values();

      while (iter.hasNext()) {
        invocationList.add(iter.next());
      }
    }

    return invocationList;
  }
1213457
public Collection<INDArray> getUpdates() {
        // just drain stuff from the queue
        val list = new ArrayList<INDArray>();
        updatesQueue.drainTo(list);
        return list;
    }
325253
public List<E> toList()
    {
        ArrayList<E> list = new ArrayList<E>(queue.size());
        while (!queue.isEmpty())
        {
            list.add(0, queue.poll());
        }

        return list;
    }
909228
def get_addressbooks(self, order=None, append_remaining=True):
        """"""
        order = order or []
        abooks = []
        for a in order:
            if a:
                if a.abook:
                    abooks.append(a.abook)
        if append_remaining:
            for a in self._accounts:
                if a.abook and a.abook not in abooks:
                    abooks.append(a.abook)
        return abooks
541792
private void processWritesSync() {
        if (this.closed.get()) {
            // BookKeeperLog is closed. No point in trying anything else.
            return;
        }

        if (getWriteLedger().ledger.isClosed()) {
            // Current ledger is closed. Execute the rollover processor to safely create a new ledger. This will reinvoke
            // the write processor upon finish, so the writes can be reattempted.
            this.rolloverProcessor.runAsync();
        } else if (!processPendingWrites() && !this.closed.get()) {
            // We were not able to complete execution of all writes. Try again.
            this.writeProcessor.runAsync();
        }
    }
950519
def _notify_reader_writes(writeto):
    
    satisfied = []
    for var in writeto:
        if var.readable:
            for reader in var.readers:
                reader.notify_read_ready()
                if reader.satisfied:
                    satisfied.append(reader)
    return Closure.sort(satisfied)
342697
public List<StepCandidate> collectCandidates(List<CandidateSteps> candidateSteps) {
        List<StepCandidate> collected = new ArrayList<>();
        for (CandidateSteps steps : candidateSteps) {
            collected.addAll(steps.listCandidates());
        }
        return collected;
    }
1010600
public List<AclEntry> getEntries() {
    ImmutableList.Builder<AclEntry> builder = new ImmutableList.Builder<>();
    builder.add(new AclEntry.Builder()
        .setType(AclEntryType.OWNING_USER)
        .setSubject(mOwningUser)
        .setActions(getOwningUserActions())
        .build());
    builder.add(new AclEntry.Builder()
        .setType(AclEntryType.OWNING_GROUP)
        .setSubject(mOwningGroup)
        .setActions(getOwningGroupActions())
        .build());
    builder.add(new AclEntry.Builder()
        .setType(AclEntryType.OTHER)
        .setActions(getOtherActions())
        .build());
    if (hasExtended()) {
      builder.addAll(mExtendedEntries.getEntries());
    }
    return builder.build();
  }
149859
public Counters getCounters() {
    Counters result = new Counters();
    synchronized (this) {
      result.incrAllCounters(getJobCounters());
    }

    incrementTaskCounters(result, maps);
    return incrementTaskCounters(result, reduces);
  }