public static string ResolveFilePath(GridJob job, GridJobTask task, GridJobFile file) { if (file.ShareMode == EGridJobFileShare.SharedBetweenTasks) { return($"{JobsDirectory}\\{job.Name}\\{file.FileName}"); } return($"{JobsDirectory}\\{job.Name}\\task-{task.TaskId}\\{file.FileName}"); }
public GridJobFile ResolveLink(GridJob job, bool isOutput = false) { if (isOutput) { return(job.JobFiles.FirstOrDefault(x => x.FileName == FileName && x.Direction == EGridJobFileDirection.WorkerOutput)); } return(job.JobFiles.FirstOrDefault(x => x.FileName == FileName && x.CheckSum == CheckSum)); }
public static bool CreateJobDirectoriesIfNotExists(GridJob job) { if (!CheckIfJobDirectoriesExists(job)) { Directory.CreateDirectory($"{JobsDirectory}\\{job.Name}"); return(true); } return(false); }
public static void CleanupTasksDirectoriesOnly(GridJob jobDir) { foreach (var file in Directory.GetDirectories($"{JobsDirectory}\\{jobDir.Name}")) { try { Directory.Delete(file, true); } catch { ; } } }
public static void CleanupDirectory(GridJob jobDir) { CleanupDirectory($"{JobsDirectory}\\{jobDir.Name}"); }
public static bool CheckIfJobDirectoriesExists(GridJob job) { return(Directory.Exists($"{JobsDirectory}\\{job.Name}")); }
public static void CreateDirectoriesForJob(GridJob job) { CreateJobDirectoriesIfNotExists(job); }
public static string ResolveFilePathShared(GridJob job, string fileName) { return($"{JobsDirectory}\\{job.Name}\\{fileName}"); }
public abstract void FinishJob(GridJob job, ILog logger);
public void CleanupJobDirectory(GridJob job) { GridIo.CleanupDirectory(job); }