Class SubmissionCloner<S extends GitLabSubmissionFields>
java.lang.Object
studentrepoloader.git.SubmissionCloner<S>
- Type Parameters:
S
- a subtype ofGitLabSubmissionFields
representing an individual GitLab link submission on the ViLLe platform
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 Summary
ConstructorsConstructorDescriptionSubmissionCloner
(Map<S, Path> initialTargets) SubmissionCloner
(Map<S, Path> initialTargets, int threadCount) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRepoToCloningQueue
(S submission, Path targetPath) Adds a single submission to the clone queue in a thread-safe manner.void
cloneAll()
Entry point for the concurrent cloning process.
-
Constructor Details
-
SubmissionCloner
-
SubmissionCloner
-
-
Method Details
-
addRepoToCloningQueue
-
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
-