Exemple #1
0
        protected void ExecuteQuick_Click(object sender, EventArgs e)
        {
            string queuename = EntityFactory.CombineName(
                EntityType.QueueInstance,
                Federation.ControllerMachine.GetFullyQualifiedName(),
                Jhu.Graywulf.Registry.Constants.QuickQueueName);

            var q = CreateQuery();

            if (q != null)
            {
                q.Destination = new IO.Tasks.DestinationTable(
                    MyDBDataset,
                    MyDBDataset.DatabaseName,
                    MyDBDataset.DefaultSchemaName,
                    "quickResults",
                    TableInitializationOptions.Drop | TableInitializationOptions.Create);

                var ji = ScheduleQuery(queuename, q);

                LastQueryJobGuid = ji.Guid;

                ResultsDiv.Visible   = true;
                CloseResults.Visible = true;
            }
        }
Exemple #2
0
        public override JobInstance ScheduleAsJob(QueryBase query, string queueName, string comments)
        {
            var job = CreateJobInstance(
                EntityFactory.CombineName(EntityType.JobDefinition, Registry.AppSettings.FederationName, typeof(SqlQueryJob).Name),
                queueName,
                comments);

            job.Parameters["Query"].Value = query;

            return(job);
        }
        private JobInstance GetInitializedJobInstance(string queueName, string comments)
        {
            JobInstance job = CreateJobInstance(
                EntityFactory.CombineName(EntityType.JobDefinition, Registry.AppSettings.FederationName, typeof(ExportTablesJob).Name),
                queueName,
                comments);

            job.Name     = String.Format("{0}_{1}", Context.UserName, job.JobID);
            job.Comments = comments;

            return(job);
        }
Exemple #4
0
        protected void ExecuteLong_Click(object sender, EventArgs e)
        {
            string queuename = EntityFactory.CombineName(
                EntityType.QueueInstance,
                Federation.ControllerMachine.GetFullyQualifiedName(),
                Jhu.Graywulf.Registry.Constants.LongQueueName);

            var q = CreateQuery();

            if (q != null)
            {
                ScheduleQuery(queuename, q);
                Response.Redirect("~/jobs/");
            }
        }
        private void ScheduleExportTableJob()
        {
            var table  = (Jhu.Graywulf.Schema.Table)SchemaManager.GetDatabaseObjectByKey(TableName.SelectedValue);
            var format = FileFormatFactory.GetFileFormatDescription(FileFormat.SelectedValue);

            // Make sure it's in MYDB
            if (StringComparer.InvariantCultureIgnoreCase.Compare(table.DatasetName, MyDBDatabaseDefinition.Name) != 0)
            {
                throw new InvalidOperationException();  // *** TODO
            }

            var queue = EntityFactory.CombineName(EntityType.QueueInstance, Federation.ControllerMachine.GetFullyQualifiedName(), Jhu.Graywulf.Registry.Constants.LongQueueName);
            var f     = new Jhu.Graywulf.Jobs.ExportTables.ExportTablesFactory(RegistryContext);

            // TODO: maybe add comments?
            var job = f.ScheduleAsJob(Federation, new[] { table }, null, format, queue, "");

            job.Save();
        }