Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public OptimizedHiveDao(HiveDataContext db)
 {
     Db = db;
 }
Esempio n. 5
0
 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 OptimizedHiveDao(HiveDataContext db) {
   Db = db;
 }
Esempio n. 7
0
 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;
 }
Esempio n. 8
0
    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;
    }
Esempio n. 9
0
 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;
 }
Esempio n. 10
0
 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);
   }
 }
Esempio n. 11
0
    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;
    }