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); }
/// <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()); }
public void OnNext(IDriverStarted value) { var request = _evaluatorRequestor.NewBuilder() .SetNumber(_numEvaluators) .SetMegabytes(512) .SetRackName("WonderlandRack") .SetEvaluatorBatchId("BroadcastEvaluator") .Build(); _evaluatorRequestor.Submit(request); }
public void OnNext(IDriverStarted value) { var request = _evaluatorRequestor.NewBuilder() .SetNumber(NumberOfEvaluator) .SetMegabytes(512) .SetCores(2) .SetRackName("WonderlandRack") .SetEvaluatorBatchId("MessagingEvaluator") .Build(); _evaluatorRequestor.Submit(request); }
/// <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()); } }
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"); }
/// <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()); }
/// <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()); }
/// <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)); }
public void OnNext(IDriverStarted value) { var request = _evaluatorRequestor.NewBuilder().SetNumber(_totalEvaluators).SetCores(1).SetMegabytes(2048).Build(); _evaluatorRequestor.Submit(request); }
/// <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()); }
public void OnNext(IDriverStarted start) { Log.Log(Level.Info, "StartTime: {0}", start); _evaluatorRequestor.Submit(_evaluatorRequestor.NewBuilder() .SetNumber(1).SetMegabytes(128).SetNumber(1).Build()); }
/// <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. }
public void OnNext(IDriverStarted time) { CheckMsgOrder(time); _requestor.Submit(_requestor.NewBuilder() .SetNumber(1).SetMegabytes(128).SetCores(1).Build()); }
public async Task DispatchStartEventAsync(IDriverStarted startEvent) { await DispatchAsync(_driverStartedDispatcher, startEvent); }