Class SubmissionCloner<S extends GitLabSubmissionFields>

java.lang.Object
studentrepoloader.git.SubmissionCloner<S>
Type Parameters:
S - a subtype of GitLabSubmissionFields representing an individual GitLab link submission on the ViLLe platform

public class SubmissionCloner<S extends GitLabSubmissionFields> extends Object
Concurrent Git repository cloner for GitLab-based student submissions.

This class manages the process of cloning student repositories in parallel, based on sanitized GitLab links extracted from ViLLe CSV exports. It uses a thread-safe, lexicographically sorted queue to ensure reproducible clone ordering.

Main responsibilities:

  • Performing real git clone operations into per-submission directories
  • Detecting and skipping malformed or non-cloneable links
  • Logging all sanitization steps and clone failures to both global and per-submission logs
  • Skipping already cloned repositories via .git/ detection
  • Supporting dynamic addition of new submissions into the clone queue at runtime
  • Constructor Details

    • SubmissionCloner

      public SubmissionCloner(Map<S,Path> initialTargets, int threadCount)
    • SubmissionCloner

      public SubmissionCloner(Map<S,Path> initialTargets)
  • Method Details

    • addRepoToCloningQueue

      public void addRepoToCloningQueue(S submission, Path targetPath)
      Adds a single submission to the clone queue in a thread-safe manner.
      Parameters:
      submission - GitLab submission to enqueue
      targetPath - target directory for the cloned repo
    • cloneAll

      public void cloneAll()
      Entry point for the concurrent cloning process.

      Performs the following steps:

      • Initializes the global cleaning steps log
      • Logs per-submission sanitization steps (if any)
      • Clones each repository concurrently using a fixed thread pool
      • Logs any failed clones to a global error log
      • Prints skipped submissions caused by malformed or disallowed URLs
      • Prints total execution time and submission count after completion