jmark99 commented on a change in pull request #2214:
URL: https://github.com/apache/accumulo/pull/2214#discussion_r677823521
##########
File path:
server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java
##########
@@ -292,28 +292,29 @@ private void deleteConfirmed(GarbageCollectionEnvironment
gce,
public void collect(GarbageCollectionEnvironment gce) throws
TableNotFoundException, IOException {
- String lastCandidate = "";
+ Iterator<String> candidatesIter = getCandidates(gce);
- boolean outOfMemory = true;
- while (outOfMemory) {
- List<String> candidates = new ArrayList<>();
-
- outOfMemory = getCandidates(gce, lastCandidate, candidates);
+ while (candidatesIter.hasNext()) {
+ List<String> batchOfCandidates =
gce.readCandidatesThatFitInMemory(candidatesIter);
+ collectBatch(gce, batchOfCandidates);
+ }
+ }
- if (candidates.isEmpty())
- break;
- else
- lastCandidate = candidates.get(candidates.size() - 1);
+ /**
+ * Given a sub-list of possible deletion candidates, process and remove
valid deletion candidates.
+ */
+ public void collectBatch(GarbageCollectionEnvironment gce, List<String>
currentBatch)
Review comment:
Done. Thanks for catching this. It had been public in the prior form of
the PR when it was being called from another class. Missed it when refactoring.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]