コード例 #1
0
        public void ImruDriverHandlesCancelledEventAfterStart()
        {
            var driver = TangFactory
                         .GetTang()
                         .NewInjector(GetDriverConfig <TestMapInput, TestMapOutput, TestResult, TestPartitionType>())
                         .GetInstance(typeof(IMRUDriver <TestMapInput, TestMapOutput, TestResult, TestPartitionType>))
                         as IMRUDriver <TestMapInput, TestMapOutput, TestResult, TestPartitionType>;

            IDriverStarted startedEvent = null;

            driver.OnNext(startedEvent);

            var           cancelMessage  = "cancel_" + Guid.NewGuid();
            var           cancelTime     = DateTime.Now;
            IJobCancelled cancelledEvent = new JobCancelled(cancelTime, cancelMessage);

            Assert.False(GetDriverState(driver).CurrentState == SystemState.Fail, "driver's state is Fail after Onstarted event");

            AssertExceptionThrown <ApplicationException>(
                () => driver.OnNext(cancelledEvent),
                expectedExceptionMessageContent: new[] { "Job cancelled", cancelTime.ToString("u"), cancelMessage },
                assertMessagePrefix: "Cancel event handler failed to throw expected exception");

            var stateAfterCancel = GetDriverState(driver);

            Assert.True(stateAfterCancel.CurrentState == SystemState.Fail, "invalid driver state after cancel event: expected= Fail, actual=" + stateAfterCancel.CurrentState);
        }
コード例 #2
0
ファイル: TestHelloDriver.cs プロジェクト: wwjiang007/reef
        /// <summary>
        /// Called to start the user mode driver
        /// </summary>
        /// <param name="driverStarted"></param>
        public void OnNext(IDriverStarted driverStarted)
        {
            Logger.Log(Level.Info, "Received IDriverStarted, numberOfContainers: {0}", _numberOfContainers);

            _evaluatorRequestor.Submit(_evaluatorRequestor.NewBuilder()
                                       .SetMegabytes(64)
                                       .SetNumber(_numberOfContainers)
                                       .SetRelaxLocality(_relaxLocality)
                                       .SetCores(1)
                                       .Build());
        }
コード例 #3
0
        public void OnNext(IDriverStarted value)
        {
            var request =
                _evaluatorRequestor.NewBuilder()
                .SetNumber(_numEvaluators)
                .SetMegabytes(512)
                .SetRackName("WonderlandRack")
                .SetEvaluatorBatchId("BroadcastEvaluator")
                .Build();

            _evaluatorRequestor.Submit(request);
        }
コード例 #4
0
        public void OnNext(IDriverStarted value)
        {
            var request =
                _evaluatorRequestor.NewBuilder()
                .SetNumber(NumberOfEvaluator)
                .SetMegabytes(512)
                .SetCores(2)
                .SetRackName("WonderlandRack")
                .SetEvaluatorBatchId("MessagingEvaluator")
                .Build();

            _evaluatorRequestor.Submit(request);
        }
コード例 #5
0
        /// <summary>
        /// Called to start the user mode driver
        /// </summary>
        /// <param name="driverStarted"></param>
        public void OnNext(IDriverStarted driverStarted)
        {
            Logger.Log(Level.Info, string.Format("HelloDriver started at {0}", driverStarted.StartTime));

            if (_nodeNames != null && _nodeNames.Count > 0)
            {
                _evaluatorRequestor.Submit(_evaluatorRequestor.NewBuilder()
                                           .AddNodeNames(_nodeNames)
                                           .SetMegabytes(64)
                                           .SetNumber(_nodeNames.Count)
                                           .SetRelaxLocality(_relaxLocality)
                                           .Build());
            }
            else
            {
                _evaluatorRequestor.Submit(_evaluatorRequestor.NewBuilder()
                                           .SetMegabytes(64)
                                           .Build());
            }
        }
コード例 #6
0
        public void ImruDriver_HandlesCancelledEventAfterStart()
        {
            var driver = TangFactory
                         .GetTang()
                         .NewInjector(GetDriverConfig <ImruDriverTestType, ImruDriverTestType, ImruDriverTestType, ImruDriverTestType>())
                         .GetInstance(typeof(IMRUDriver <ImruDriverTestType, ImruDriverTestType, ImruDriverTestType, ImruDriverTestType>))
                         as IMRUDriver <ImruDriverTestType, ImruDriverTestType, ImruDriverTestType, ImruDriverTestType>;

            IDriverStarted startedEvent = null;

            driver.OnNext(startedEvent);

            var           cancelMessage  = "cancel_" + Guid.NewGuid();
            var           cancelTime     = DateTime.Now;
            IJobCancelled cancelledEvent = new JobCancelled(cancelTime, cancelMessage);

            AssertExceptionThrown <ApplicationException>(
                () => driver.OnNext(cancelledEvent),
                expectedExceptionMessageContent: new[] { "Job cancelled", cancelTime.ToString("u"), cancelMessage },
                assertMessagePrefix: "Cancel event handler failed to throw expected exception");
        }
コード例 #7
0
ファイル: Driver.cs プロジェクト: QITIE/reef-master-yarn
        /// <summary>
        /// Called to start the user mode driver
        /// </summary>
        /// <param name="driverStarted"></param>
        public void OnNext(IDriverStarted driverStarted)
        {
            _Logger.Log(Level.Info, string.Format("HelloDriver started at {0}", driverStarted.StartTime));
            _numOfContainers    = Utils.ReadIntArgumentFromConf(Common.GlobalConfigNumOfClients);
            _memoryPerNode      = Utils.ReadIntArgumentFromConf(Common.GlobalConfigClientMemory);
            _numOfvCoresPerNode = Utils.ReadIntArgumentFromConf(Common.GlobalConfigClientVCores);

            _testNodes = Utils.ReadStringArgumentFromConf(Common.GlobalConfigTestNodes);

            if (_testNodes.Equals("*"))
            {
                _testNodes = string.Empty;
            }

            _evaluatorRequestor.Submit(
                _evaluatorRequestor
                .NewBuilder()
                .SetNumber(_numOfContainers)
                .SetCores(_numOfvCoresPerNode)
                .SetMegabytes(_memoryPerNode)
                .SetNodeName(_testNodes)
                .Build());
        }
コード例 #8
0
 /// <summary>
 /// Called to start the driver.
 /// </summary>
 public void OnNext(IDriverStarted driverStarted)
 {
     _isRestart = false;
     Logger.Log(Level.Info, "HelloRestartDriver started at {0}", driverStarted.StartTime);
     _evaluatorRequestor.Submit(_evaluatorRequestor.NewBuilder().SetNumber(NumberOfTasksToSubmit).SetMegabytes(64).Build());
 }
コード例 #9
0
 /// <summary>
 /// Called to start the user mode driver
 /// </summary>
 /// <param name="driverStarted"></param>
 public void OnNext(IDriverStarted driverStarted)
 {
     _Logger.Log(Level.Info, string.Format("HelloDriver started at {0}", driverStarted.StartTime));
     _evaluatorRequestor.Submit(new EvaluatorRequest(1, 64));
 }
コード例 #10
0
        public void OnNext(IDriverStarted value)
        {
            var request = _evaluatorRequestor.NewBuilder().SetNumber(_totalEvaluators).SetCores(1).SetMegabytes(2048).Build();

            _evaluatorRequestor.Submit(request);
        }
コード例 #11
0
ファイル: HelloDriver.cs プロジェクト: TaeHunKim/reef
 /// <summary>
 /// Called to start the user mode driver
 /// </summary>
 /// <param name="driverStarted"></param>
 public void OnNext(IDriverStarted driverStarted)
 {
     _Logger.Log(Level.Info, string.Format("HelloDriver started at {0}", driverStarted.StartTime));
     _evaluatorRequestor.Submit(_evaluatorRequestor.NewBuilder().SetMegabytes(64).Build());
 }
コード例 #12
0
 public void OnNext(IDriverStarted start)
 {
     Log.Log(Level.Info, "StartTime: {0}", start);
     _evaluatorRequestor.Submit(_evaluatorRequestor.NewBuilder()
                                .SetNumber(1).SetMegabytes(128).SetNumber(1).Build());
 }
コード例 #13
0
ファイル: IMRUDriver.cs プロジェクト: dkm2110/veyor
 /// <summary>
 /// Requests for evaluator for update task
 /// </summary>
 /// <param name="value">Event fired when driver started</param>
 public void OnNext(IDriverStarted value)
 {
     RequestUpdateEvaluator();
     //// TODO[REEF-598]: Set a timeout for this request to be satisfied. If it is not within that time, exit the Driver.
 }
コード例 #14
0
ファイル: FailDriver.cs プロジェクト: wonook/reef
 public void OnNext(IDriverStarted time)
 {
     CheckMsgOrder(time);
     _requestor.Submit(_requestor.NewBuilder()
                       .SetNumber(1).SetMegabytes(128).SetCores(1).Build());
 }
コード例 #15
0
ファイル: DriverBridge.cs プロジェクト: wonook/reef
 public async Task DispatchStartEventAsync(IDriverStarted startEvent)
 {
     await DispatchAsync(_driverStartedDispatcher, startEvent);
 }