This is an automated email from the ASF dual-hosted git repository. jmark99 pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push: new 93bafa8 Update trace code in GarbageCollectionAlgorithm (#2216) 93bafa8 is described below commit 93bafa8f96d211ead5a09535d6d5aaf32145065d Author: Mark Owens <jmar...@apache.org> AuthorDate: Mon Aug 2 08:26:07 2021 -0400 Update trace code in GarbageCollectionAlgorithm (#2216) Update location of TraceScope code in GarbageCollectionAlgorithm. With the GCA code now using an iterator rather tnan continue point, the seperate call to getCandidates with GCA is no longer needed as its only purpose purpose was to allow the GCE method to be traced. That method was removed. The trace was instead placed around the call to readCandidatesThatFitInMemory as that is the method responsible for collecting and batching up deletion candidates. --- .../apache/accumulo/gc/GarbageCollectionAlgorithm.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java index 643f46c..12152fc 100644 --- a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java +++ b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java @@ -264,14 +264,6 @@ public class GarbageCollectionAlgorithm { for (TableId delTableId : tableIdsWithDeletes) { gce.deleteTableDirIfEmpty(delTableId); } - - } - - private Iterator<String> getCandidates(GarbageCollectionEnvironment gce) - throws TableNotFoundException, IOException { - try (TraceScope candidatesSpan = Trace.startSpan("getCandidates")) { - return gce.getCandidates(); - } } private void confirmDeletesTrace(GarbageCollectionEnvironment gce, @@ -292,10 +284,13 @@ public class GarbageCollectionAlgorithm { public void collect(GarbageCollectionEnvironment gce) throws TableNotFoundException, IOException { - Iterator<String> candidatesIter = getCandidates(gce); + Iterator<String> candidatesIter = gce.getCandidates(); while (candidatesIter.hasNext()) { - List<String> batchOfCandidates = gce.readCandidatesThatFitInMemory(candidatesIter); + List<String> batchOfCandidates; + try (TraceScope candidatesSpan = Trace.startSpan("getCandidates")) { + batchOfCandidates = gce.readCandidatesThatFitInMemory(candidatesIter); + } deleteBatch(gce, batchOfCandidates); } }