private static void CallExecutor(long managedDriverId, Action <MesosExecutorDriver, IExecutor> action) { var driver = DriverRegistry.GetExecutorDriver(managedDriverId); var executor = driver.Executor; action(driver, executor); }
private static void CallScheduler(long managedDriverId, Action <MesosSchedulerDriver, IScheduler> action) { var driver = DriverRegistry.GetSchedulerDriver(managedDriverId); var scheduler = driver.Scheduler; action(driver, scheduler); }
private void Dispose(bool disposing) { if (disposing) { GC.SuppressFinalize(this); } _bridge.Dispose(); DriverRegistry.Unregister(this); }
public MesosExecutorDriver(IExecutor executor) { if (executor == null) { throw new ArgumentNullException(nameof(executor)); } Executor = executor; Id = DriverRegistry.Register(this); _bridge = new ExecutorDriverBridge(); _bridge.Initialize(Id); }
public bool Update(DriverRegistry driver) { _context.Driver.ReplaceOne( doc => doc.Id == driver.Id, driver, new UpdateOptions { IsUpsert = false } ); return(true); }
public IActionResult CreateDriver([FromBody] DriverRequest driver) { var driverToAdd = new DriverRegistry { Name = driver.Name, Vehicle = driver.Vehicle, Address = driver.Address, FetchGeolocation = true, LastUpdated = DateTime.UtcNow }; _driverRepository.Add(driverToAdd); //For some reason, CreatedAtAction acts weird when I remove the 'value' parameter. It returns a wrong route to the 'location' header. return(CreatedAtAction(nameof(GetDriver), new { id = driverToAdd.Id }, driverToAdd)); }
public IActionResult UpdateDriver(string id, [FromBody] DriverRequest driver) { var driverToUpdate = new DriverRegistry { Id = id, Name = driver.Name, Vehicle = driver.Vehicle, Address = driver.Address, FetchGeolocation = true, LastUpdated = DateTime.UtcNow }; _driverRepository.Update(driverToUpdate); //Here CreatedAtAction acts normal with or without the 'value' parameter. But I will keep it here for the sake of consistency. return(CreatedAtAction(nameof(GetDriver), new { id = driverToUpdate.Id }, driverToUpdate)); }
public MesosSchedulerDriver(IScheduler scheduler, FrameworkInfo frameworkInfo, string masterAddress, bool implicitAcknowledgements, Credential credential) { if (scheduler == null) { throw new ArgumentNullException(nameof(scheduler)); } if (frameworkInfo == null) { throw new ArgumentNullException(nameof(frameworkInfo)); } if (masterAddress == null) { throw new ArgumentNullException(nameof(masterAddress)); } Scheduler = scheduler; Id = DriverRegistry.Register(this); _bridge = new SchedulerDriverBridge(); _bridge.Initialize(Id, frameworkInfo, masterAddress, implicitAcknowledgements, credential); }
public bool Add(DriverRegistry driver) { _context.Driver.InsertOne(driver); return(true); }