public static HiveDataContext CreateContext(bool longRunning = false) { var context = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString); if (longRunning) { context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds; } return(context); }
private void CollectChildJobs(HiveDataContext db, Guid parentJobId, List <Job> collection) { var jobs = db.Jobs.Where(j => j.ParentJobId == parentJobId); foreach (var job in jobs) { collection.Add(job); if (job.IsParentJob) { CollectChildJobs(db, job.JobId, collection); } } }
private DT.HiveExperiment AddStatsToExperiment(HiveDataContext db, DT.HiveExperiment exp) { if (exp == null) { return(null); } var jobs = db.Jobs.Where(j => j.HiveExperimentId == exp.Id); exp.JobCount = jobs.Count(); exp.CalculatingCount = jobs.Count(j => j.State == JobState.Calculating); exp.FinishedCount = jobs.Count(j => j.State == JobState.Finished); return(exp); }
public OptimizedHiveDao(HiveDataContext db) { Db = db; }
private void CollectChildTasks(HiveDataContext db, Guid parentTaskId, List<Task> collection) { var tasks = db.Tasks.Where(j => j.ParentTaskId == parentTaskId); foreach (var task in tasks) { collection.Add(task); if (task.IsParentTask) CollectChildTasks(db, task.TaskId, collection); } }
public IEnumerable<DT.Resource> CollectChildResources(Guid resourceId, HiveDataContext db) { var childs = new List<DT.Resource>(); foreach (var child in db.Resources.Where(x => x.ParentResourceId == resourceId)) { childs.Add(DT.Convert.ToDto(child)); childs.AddRange(CollectChildResources(child.ResourceId, db)); } return childs; }
private DT.Job AddStatsToJob(HiveDataContext db, DT.Job exp) { if (exp == null) return null; var jobs = db.Tasks.Where(j => j.JobId == exp.Id); exp.JobCount = jobs.Count(); exp.CalculatingCount = jobs.Count(j => j.State == TaskState.Calculating); exp.FinishedCount = jobs.Count(j => j.State == TaskState.Finished || j.State == TaskState.Aborted || j.State == TaskState.Failed); return exp; }
public static HiveDataContext CreateContext(bool longRunning = false) { var context = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString); if (longRunning) context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds; return context; }
private void CollectChildJobs(HiveDataContext db, Guid parentJobId, List<Job> collection) { var jobs = db.Jobs.Where(j => j.ParentJobId == parentJobId); foreach (var job in jobs) { collection.Add(job); if (job.IsParentJob) CollectChildJobs(db, job.JobId, collection); } }
private DT.HiveExperiment AddStatsToExperiment(HiveDataContext db, DT.HiveExperiment exp) { if (exp == null) return null; var jobs = db.Jobs.Where(j => j.HiveExperimentId == exp.Id); exp.JobCount = jobs.Count(); exp.CalculatingCount = jobs.Count(j => j.State == JobState.Calculating); exp.FinishedCount = jobs.Count(j => j.State == JobState.Finished); return exp; }