Beispiel #1
0
 public static void ExecuteThread(Query q, DataItemPool dip)
 {
     while (true)
     {
         q.Iterate(dip.GetItem, dip.ReleaseItem);
         Thread.Sleep(10);
     }
 }
Beispiel #2
0
        private static void ExecuteScheduler(string title, IScheduler sch, bool breakOut, Query[] qs)
        {
            int q;
            bool complete = false;

            AdminForm frmAdmin = new AdminForm();

            IResults[] res = sch.Init(breakOut, qs);
            ResultsHandler[] rh = new ResultsHandler[res.Length];
            for (q = 0; q < res.Length; q++)
                rh[q] = new ResultsHandler(string.Format("{0}{1}", title, q), res[q]);
            sch.Execute();
            //frmAdmin.Scheduler = sch;
            //frmAdmin.Show();

            while (!complete && !frmAdmin.ShutdownServer)
            {
                //frmAdmin.UpdateStats();
                Thread.Sleep(10000);
                complete = true;
                for (int i = 0; i < rh.Length && complete; i++)
                    complete &= rh[i].EOF;
                //Log.WriteMessage(DataItemPool.ToString(), Log.eMessageType.Debug);
            }

            double totalSec = 0;
            for (int i = 0; i < rh.Length; i++)
            {
                Log.WriteMessage(string.Format("{0} Total Rows: {1}, Time: {2}", rh[i].Name, rh[i].DataCount, rh[i].CompletionTime), Log.eMessageType.Debug);
                totalSec += (((double)rh[i].CompletionTime.Minutes) * 60) +
                    ((double)rh[i].CompletionTime.Seconds) +
                    (((double)rh[i].CompletionTime.Milliseconds) / 1000.0);
            }

            Log.WriteMessage(string.Format("Average Time: {0}", totalSec / rh.Length), Log.eMessageType.Debug);
        }
Beispiel #3
0
 private void Init(Query[] qs)
 {
     qopInputs.Clear();
     qopInputs.AddRange(qs);
 }
Beispiel #4
0
 /// <summary>
 /// Constructor for a binary operator
 /// </summary>
 /// <param name="opL">The left input query operator</param>
 /// <param name="opR">The right input query operator</param>
 public BinaryOp(Query opL, Query opR)
     : base()
 {
     opInLeft = opL;
     opInRight = opR;
 }
Beispiel #5
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public BinaryOp()
 {
     opInLeft = null;
     opInRight = null;
 }
Beispiel #6
0
 /// <summary>
 /// Constructor to set up a unary operator with its input
 /// </summary>
 /// <param name="op">The input to this operator</param>
 public UnaryOp(Query op)
     : base()
 {
     opIn = op;
 }
Beispiel #7
0
 /// <summary>
 /// dummy constructor
 /// </summary>
 public UnaryOp()
     : base()
 {
     opIn = null;
 }