keith-turner commented on a change in pull request #2214:
URL: https://github.com/apache/accumulo/pull/2214#discussion_r677805788
##########
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:
```suggestion
private void collectBatch(GarbageCollectionEnvironment gce, List<String>
currentBatch)
```
##########
File path:
test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
##########
@@ -90,6 +90,9 @@ public void configure(MiniAccumuloConfigImpl cfg,
Configuration hadoopCoreSite)
cfg.setProperty(Property.GC_PORT, "0");
cfg.setProperty(Property.TSERV_MAXMEM, "5K");
cfg.setProperty(Property.TSERV_MAJC_DELAY, "1");
+ // reduce the batch size significantly in order to cause the integration
tests to have
+ // to process many batches of deletion candidates.
+ cfg.setProperty(Property.GC_CANDIDATE_BATCH_SIZE, "256K");
Review comment:
Do you know if this size caused multiple batches to be processed in the
IT? If not could make it smaller.
--
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]