This is an automated email from the ASF dual-hosted git repository. DomGarguilo pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit 242637a534fab913d0a6ae7f5e93c3ca5a5c2e9b Merge: df6d3e901c 9d6d54da19 Author: Dom G <[email protected]> AuthorDate: Thu Nov 12 10:47:39 2026 -0500 Merge branch '2.1' .../accumulo/gc/GarbageCollectionAlgorithm.java | 3 +- .../apache/accumulo/gc/GarbageCollectionTest.java | 58 ++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --cc server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java index 4631ae76ae,62284ba342..bb19b36313 --- a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java +++ b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java @@@ -52,10 -55,24 +52,11 @@@ public class GarbageCollectionAlgorith private static final Logger log = LoggerFactory.getLogger(GarbageCollectionAlgorithm.class); /** - * This method takes a file or directory path and returns a relative path in 1 of 2 forms: - * - * <pre> - * 1- For files: table-id/tablet-directory/filename.rf - * 2- For directories: table-id/tablet-directory - * </pre> - * - * For example, for full file path like hdfs://foo:6000/accumulo/tables/4/t0/F000.rf it will - * return 4/t0/F000.rf. For a directory that already is relative, like 4/t0, it will just return - * the original path. This method will also remove prefixed relative paths like ../4/t0/F000.rf - * and return 4/t0/F000.rf. It also strips out empty tokens from paths like - * hdfs://foo.com:6000/accumulo/tables/4//t0//F001.rf returning 4/t0/F001.rf. - * - * @return the normalized table-relative path: {@code tableId/tabletDir/fileName} for a file or - * {@code tableId/tabletDir} for a directory + * Normalizes a candidate, directory, or blip path to a table-relative GC key. File references use + * {@link #makeRelativeFileReference(String)} because they must be absolute URIs. */ - private String makeRelative(String path, int expectedLen) { + @VisibleForTesting + String makeRelative(String path, int expectedLen) { // remove prefixed old relative path int position = path.startsWith("../") ? 3 : 0; int componentCount = 0;
