public Task Terminate(IHostedMachine hostedMachine) { return(amazonec2.TerminateInstancesAsync(new TerminateInstancesRequest() { InstanceIds = new List <string>() { hostedMachine.Id } })); }
public HydraliskSystemController(Bootstrap bootstrap, IHostedMachine hostedMachine) : base(bootstrap) { IMessageEntrance messageEntrance = new MessageEntrance(bootstrap.GetMessageQueueFromVariableSet("Entrance")); WorkingProcessor = new SourceIntergation(bootstrap.Provisioning.Caches["default-cache"], new ExtractorManager(bootstrap.InjectionProvider)); MetricCollections.Default.AddMetricCollector("idle", new IncreasedMetricCollector("HydraliskIdle")); MetricCollections.Default.AddMetricCollector("busy", new IncreasedMetricCollector("HydraliskBusy")); IMessageTermination messageTermination = new MessageTermination(bootstrap, this); messagePipline = new MessagePipline(messageEntrance, messageTermination); messageOut = bootstrap.GetMessageQueueFromVariableSet("Termination"); this.hostedMachine = hostedMachine; //TODO : Cache should comes from the variable. }
public UtralisksSystemController(Bootstrap bootstrap, IHostedMachine hostedMachine) : base(bootstrap) { messageEntrance = new MessageEntrance(bootstrap.GetMessageQueueFromVariableSet("Entrance")); MetricCollections.Default.AddMetricCollector("idle", new IncreasedMetricCollector("UtraliskIdle")); MetricCollections.Default.AddMetricCollector("busy", new IncreasedMetricCollector("UtraliskBusy")); WorkingProcessor = new TransformIntegration( bootstrap.GetCachedFromVariableSet("CoreCache"), bootstrap.GetStorageFromVariableSet("CoreStorage") ); IMessageTermination messageTermination = new MessageTermination(bootstrap, this); messagePipline = new MessagePipline(messageEntrance, messageTermination); messageOut = bootstrap.GetMessageQueueFromVariableSet("Termination"); this.hostedMachine = hostedMachine; }
public KerriganSystemController(Bootstrap bootstrap, IHostedMachine hostedMachine) : base(bootstrap) { var entrance = new MessageEntrance(bootstrap.GetMessageQueueFromVariableSet("Entrance")); MetricCollections.Default.AddMetricCollector("idle", new IncreasedMetricCollector("KerriganIdle")); MetricCollections.Default.AddMetricCollector("busy", new IncreasedMetricCollector("KerriganBusy")); this.loadProviderManager = new LoadProviderManager(); this.WorkingProcessor = new LoadIntegration( bootstrap.GetCachedFromVariableSet("HeartbeatCache"), bootstrap.GetStorageFromVariableSet("CoreStorage"), this.loadProviderManager ); IMessageTermination messageTermination = new MessageTermination(bootstrap, this); messagePipline = new MessagePipline(entrance, messageTermination); messageOut = bootstrap.GetMessageQueueFromVariableSet("Termination"); this.hostedMachine = hostedMachine; }
public Bootstrap(string boostrapFile) { ILoggerRepository repository = LogManager.CreateRepository(LogConst.SCRAPY_CORE_REPO); ILoggerRepository repositoryFundalmental = LogManager.CreateRepository(LogConst.SCRAPY_FUNDAMENTAL); log4net.Config.XmlConfigurator.Configure(repository, new FileInfo("log4net.config")); log4net.Config.XmlConfigurator.Configure(repositoryFundalmental, new FileInfo("log4net-fundamental.config")); logger = LogManager.GetLogger(repository.Name, typeof(Bootstrap)); string location = Assembly.GetCallingAssembly().Location; var applicationPath = Path.GetDirectoryName(location); logger.Debug("Application Location:" + applicationPath); ////TODO :Temp state here, refactor to other way. ElasticSearchTypeManager.RegistAssemblyModels(Assembly.LoadFrom(Path.Combine(applicationPath, "ScrapyCore.Fundamental.dll"))); initialStorage = StorageFactory.Factory.GetLocalStorage(applicationPath); var model = JsonConvert.DeserializeObject <Model>(initialStorage.GetString(boostrapFile)); Provisioning = new ProvisioningModel(model, initialStorage); InjectionProvider = new InjectionProvider(this); HostedMachine = HotedMachineManager.GetHostedMachine(this.GetVariableSet("environment")); }
public HostedLocalMachineTests() { hostedMachine = new HostedLocalMachine(); }
public Task Terminate(IHostedMachine hostedMachine) { Process.GetCurrentProcess().Kill(); return(Task.CompletedTask); }