示例#1
0
        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}");
        }
示例#2
0
        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));
        }
示例#3
0
        public static bool CreateJobDirectoriesIfNotExists(GridJob job)
        {
            if (!CheckIfJobDirectoriesExists(job))
            {
                Directory.CreateDirectory($"{JobsDirectory}\\{job.Name}");
                return(true);
            }

            return(false);
        }
示例#4
0
 public static void CleanupTasksDirectoriesOnly(GridJob jobDir)
 {
     foreach (var file in Directory.GetDirectories($"{JobsDirectory}\\{jobDir.Name}"))
     {
         try {
             Directory.Delete(file, true);
         } catch {
             ;
         }
     }
 }
示例#5
0
 public static void CleanupDirectory(GridJob jobDir)
 {
     CleanupDirectory($"{JobsDirectory}\\{jobDir.Name}");
 }
示例#6
0
 public static bool CheckIfJobDirectoriesExists(GridJob job)
 {
     return(Directory.Exists($"{JobsDirectory}\\{job.Name}"));
 }
示例#7
0
 public static void CreateDirectoriesForJob(GridJob job)
 {
     CreateJobDirectoriesIfNotExists(job);
 }
示例#8
0
 public static string ResolveFilePathShared(GridJob job, string fileName)
 {
     return($"{JobsDirectory}\\{job.Name}\\{fileName}");
 }
示例#9
0
 public abstract void FinishJob(GridJob job, ILog logger);
示例#10
0
 public void CleanupJobDirectory(GridJob job)
 {
     GridIo.CleanupDirectory(job);
 }