public async Task <ActionResult> SetVelocity(double velocity) { IControllerGrain controller = ControllerGrainFactory.GetGrain(0); await controller.SetVelocity(velocity); return(RedirectToAction("index")); }
public async Task <ActionResult> Stop() { IControllerGrain controller = ControllerGrainFactory.GetGrain(0); await controller.StopSimulation(); MvcApplication.GlobalObserver.c_sent = 0; return(RedirectToAction("index", "home")); }
public async Task Init(IGrainFactory factory) { workflowControllerGrain = factory.GetGrain <IControllerGrain>(WorkflowID); foreach (Operator o in AllOperators) { o.SetPrincipalGrain(factory); } await workflowControllerGrain.Init(workflowControllerGrain, WorkflowID, AllOperators); }
public async Task <ActionResult> Start() { int batch_count = int.Parse(Request.Params["batchcount"]); int batch_size = int.Parse(Request.Params["batchsize"]); int delay = int.Parse(Request.Params["delay"]); int runtime = int.Parse(Request.Params["runtime"]); string url = Request.Params["testurl"]; // Controller IControllerGrain controller = ControllerGrainFactory.GetGrain(0); await controller.StartSimulation(batch_count, batch_size, delay, runtime, url); return(RedirectToAction("index")); }
public async Task Init(IControllerGrain self, Guid workflowID, HashSet <Operator> graph) { this.self = self; WorkflowID = workflowID; foreach (Operator o in graph) { await o.PrincipalGrain.Init(self, workflowID, o); } foreach (Operator o in graph) { await o.LinkPrincipleGrain(); } foreach (Operator o in graph) { await o.LinkWorkerGrains(); } }
public async Task Init(IControllerGrain controllerGrain, Guid workflowID, Operator currentOperator) { this.controllerGrain = controllerGrain; this.workflowID = workflowID; this.operatorID = currentOperator.OperatorGuid; this.self = currentOperator.PrincipalGrain; this.predicate = currentOperator.Predicate; await BuildWorkerTopology(); PassExtraParametersByPredicate(ref this.predicate); foreach (List <IWorkerGrain> grainList in operatorGrains) { foreach (IWorkerGrain grain in grainList) { await grain.Init(grain, predicate, self); } } }
public async Task <SiloAddress> Init(IControllerGrain self, string plan, bool checkpointActivated = false) { this.self = self; ApplyLogicalPlan(CompileLogicalPlan(plan, checkpointActivated)); await InitOperators(checkpointActivated); var sinks = nodes.Keys.Where(x => nodeMetadata[x].GetType() != typeof(HashBasedMaterializerOperator) && nodeMetadata[x].GetType() != typeof(LocalMaterializerOperator) && !forwardLinks.ContainsKey(x)).ToList(); await LinkToObserver(sinks); Console.WriteLine("# of sinks: " + numberOfOutputGrains); foreach (var pair in startDependencies) { Console.WriteLine("ID: " + pair.Key); foreach (var id in pair.Value) { Console.WriteLine("\tdepends on: " + id); } } return(localSiloDetails.SiloAddress); }
public virtual async Task Init(IControllerGrain controllerGrain, Operator op, List <Pair <Operator, WorkerLayer> > prev) { this.controllerGrain = controllerGrain; this.self = this.GrainReference.Cast <IPrincipalGrain>(); this.operatorCore = op; var topology = this.operatorCore.GenerateTopology(); grainLayers = topology.First; links = topology.Second; foreach (var layer in grainLayers) { await layer.Build(self, GrainFactory, prev); foreach (IWorkerGrain worker in layer.Layer.Values.SelectMany(x => x)) { workerStates[worker] = WorkerState.UnInitialized; } } foreach (var link in links) { await link.Link(); } }