Exemple #1
0
        //goes through the jobDB and finds submitted jobs
        //uses the TaskGenerator to populate the taskTable


        //public static string processSubmittedJobsDebug()
        //{
        //    string debugString = "Entered the Function\n";

        //    SatyamJobSubmissionsTableAccess jobDB = new SatyamJobSubmissionsTableAccess();
        //    List<SatyamJobSubmissionsTableAccessEntry> jobEntries = jobDB.getAllEntriesByStatus(JobStatus.submitted);

        //    debugString += "got the job entries, there are " + jobEntries.Count + "\n";


        //    if (jobEntries.Count == 0)
        //    {
        //        debugString += "No new Entries in the DB\n";
        //        return debugString;
        //    }

        //    int noEntries = 0;

        //    foreach (SatyamJobSubmissionsTableAccessEntry entry in jobEntries)
        //    {
        //        debugString += "About To Populate Entry " + noEntries + "\n";

        //        //SatyamTaskGenerator.PopulateTasksIntoTaskTable(entry);
        //        debugString += SatyamTaskGenerator.PopulateTasksIntoTaskTableDebug(entry);

        //        return debugString;

        //        if (TaskConstants.MTurkTaskTemplates.Contains(entry.JobTemplateType))
        //        {
        //            jobDB.UpdateEntryStatus(entry.JobGUID, JobStatus.ready);
        //        }
        //        else
        //        {
        //            jobDB.UpdateEntryStatus(entry.JobGUID, JobStatus.launched);
        //        }
        //        noEntries++;
        //    }
        //    return debugString;
        //}


        public static void preprocessSubmittedData()
        {
            SatyamJobSubmissionsTableAccess             jobDB      = new SatyamJobSubmissionsTableAccess();
            List <SatyamJobSubmissionsTableAccessEntry> jobEntries = jobDB.getAllEntriesByStatus(JobStatus.submitted);


            foreach (SatyamJobSubmissionsTableAccessEntry entry in jobEntries)
            {
                if (SatyamTaskGenerator.PreprocessSubmittedData(entry))
                {
                    jobDB.UpdateEntryStatus(entry.JobGUID, JobStatus.preprocessed);
                }
            }
            jobDB.close();
        }
Exemple #2
0
        public static void processPreprocessedJobs()
        {
            SatyamJobSubmissionsTableAccess             jobDB      = new SatyamJobSubmissionsTableAccess();
            List <SatyamJobSubmissionsTableAccessEntry> jobEntries = jobDB.getAllEntriesByStatus(JobStatus.preprocessed);



            foreach (SatyamJobSubmissionsTableAccessEntry entry in jobEntries)
            {
                SatyamTaskGenerator.PopulateTasksIntoTaskTable(entry);
                if (TaskConstants.MTurkTaskTemplates.Contains(entry.JobTemplateType))
                {
                    jobDB.UpdateEntryStatus(entry.JobGUID, JobStatus.ready);
                }
                else
                {
                    jobDB.UpdateEntryStatus(entry.JobGUID, JobStatus.launched);
                }
            }
            jobDB.close();
        }