def run(self): super(AgentManager, self).run() self.polling_manager = pipeline.setup_polling(self.conf) if self.partition_coordinator: self.partition_coordinator.start() self.join_partitioning_groups() self.start_polling_tasks()
def refresh_pipeline(self): mtime = pipeline.get_pipeline_mtime() if mtime > self.pipeline_mtime: LOG.info(_LI('Pipeline configuration file has been updated.')) self.pipeline_mtime = mtime _hash = pipeline.get_pipeline_hash() if _hash != self.pipeline_hash: LOG.info(_LI("Detected change in pipeline configuration.")) try: # Pipeline in the notification agent. if hasattr(self, 'pipeline_manager'): self.pipeline_manager = pipeline.setup_pipeline() # Polling in the polling agent. elif hasattr(self, 'polling_manager'): self.polling_manager = pipeline.setup_polling() LOG.debug("Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", {'old': self.pipeline_hash, 'new': _hash}) except Exception as err: LOG.debug("Active pipeline config's hash is %s", self.pipeline_hash) LOG.exception(_LE('Unable to load changed pipeline: %s') % err) return self.pipeline_hash = _hash self.reload_pipeline()
def start(self): self.polling_manager = pipeline.setup_polling() self.partition_coordinator.start() self.join_partitioning_groups() self.pollster_timers = self.configure_polling_tasks() self.init_pipeline_refresh()
def refresh_pipeline(self): """Refreshes appropriate pipeline, then delegates to agent.""" if cfg.CONF.refresh_pipeline_cfg: pipeline_hash = self.pipeline_changed() if pipeline_hash: try: # Pipeline in the notification agent. if hasattr(self, 'pipeline_manager'): self.pipeline_manager = pipeline.setup_pipeline() # Polling in the polling agent. elif hasattr(self, 'polling_manager'): self.polling_manager = pipeline.setup_polling() LOG.debug( "Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", { 'old': self.pipeline_hash, 'new': pipeline_hash }) self.set_pipeline_hash(pipeline_hash) self.pipeline_validated = True except Exception as err: LOG.debug("Active pipeline config's hash is %s", self.pipeline_hash) LOG.exception( _LE('Unable to load changed pipeline: %s') % err) if cfg.CONF.refresh_event_pipeline_cfg: ev_pipeline_hash = self.pipeline_changed(pipeline.EVENT_TYPE) if ev_pipeline_hash: try: # Pipeline in the notification agent. if hasattr(self, 'event_pipeline_manager'): self.event_pipeline_manager = ( pipeline.setup_event_pipeline()) LOG.debug( "Event Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", { 'old': self.event_pipeline_hash, 'new': ev_pipeline_hash }) self.set_pipeline_hash(ev_pipeline_hash, pipeline.EVENT_TYPE) self.event_pipeline_validated = True except Exception as err: LOG.debug("Active event pipeline config's hash is %s", self.event_pipeline_hash) LOG.exception( _LE('Unable to load changed event pipeline:' ' %s') % err) if self.pipeline_validated or self.event_pipeline_validated: self.reload_pipeline() self.clear_pipeline_validation_status()
def refresh_pipeline(self): """Refreshes appropriate pipeline, then delegates to agent.""" if cfg.CONF.refresh_pipeline_cfg: manager = None if hasattr(self, 'pipeline_manager'): manager = self.pipeline_manager elif hasattr(self, 'polling_manager'): manager = self.polling_manager pipeline_hash = manager.cfg_changed() if manager else None if pipeline_hash: try: LOG.debug( "Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", { 'old': manager.cfg_hash, 'new': pipeline_hash }) # Pipeline in the notification agent. if hasattr(self, 'pipeline_manager'): self.pipeline_manager = pipeline.setup_pipeline() # Polling in the polling agent. elif hasattr(self, 'polling_manager'): self.polling_manager = pipeline.setup_polling() self.pipeline_validated = True except Exception as err: LOG.exception( _LE('Unable to load changed pipeline: %s') % err) if cfg.CONF.refresh_event_pipeline_cfg: # Pipeline in the notification agent. manager = (self.event_pipeline_manager if hasattr( self, 'event_pipeline_manager') else None) ev_pipeline_hash = manager.cfg_changed() if ev_pipeline_hash: try: LOG.debug( "Event Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", { 'old': manager.cfg_hash, 'new': ev_pipeline_hash }) self.event_pipeline_manager = ( pipeline.setup_event_pipeline()) self.event_pipeline_validated = True except Exception as err: LOG.exception( _LE('Unable to load changed event pipeline:' ' %s') % err) if self.pipeline_validated or self.event_pipeline_validated: self.reload_pipeline() self.clear_pipeline_validation_status()
def refresh_pipeline(self): """Refreshes appropriate pipeline, then delegates to agent.""" if self.conf.refresh_pipeline_cfg: manager = None if hasattr(self, 'pipeline_manager'): manager = self.pipeline_manager elif hasattr(self, 'polling_manager'): manager = self.polling_manager pipeline_hash = manager.cfg_changed() if manager else None if pipeline_hash: try: LOG.debug("Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", {'old': manager.cfg_hash, 'new': pipeline_hash}) # Pipeline in the notification agent. if hasattr(self, 'pipeline_manager'): self.pipeline_manager = pipeline.setup_pipeline( self.conf) # Polling in the polling agent. elif hasattr(self, 'polling_manager'): self.polling_manager = pipeline.setup_polling( self.conf) self.pipeline_validated = True except Exception as err: LOG.exception(_LE('Unable to load changed pipeline: %s') % err) if self.conf.refresh_event_pipeline_cfg: # Pipeline in the notification agent. manager = (self.event_pipeline_manager if hasattr(self, 'event_pipeline_manager') else None) ev_pipeline_hash = manager.cfg_changed() if ev_pipeline_hash: try: LOG.debug("Event Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", {'old': manager.cfg_hash, 'new': ev_pipeline_hash}) self.event_pipeline_manager = ( pipeline. setup_event_pipeline(self.conf)) self.event_pipeline_validated = True except Exception as err: LOG.exception(_LE('Unable to load changed event pipeline:' ' %s') % err) if self.pipeline_validated or self.event_pipeline_validated: self.reload_pipeline() self.clear_pipeline_validation_status()
def refresh_pipeline(self): """Refreshes appropriate pipeline, then delegates to agent.""" if cfg.CONF.refresh_pipeline_cfg: pipeline_hash = self.pipeline_changed() if pipeline_hash: try: # Pipeline in the notification agent. if hasattr(self, 'pipeline_manager'): self.pipeline_manager = pipeline.setup_pipeline() # Polling in the polling agent. elif hasattr(self, 'polling_manager'): self.polling_manager = pipeline.setup_polling() LOG.debug("Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", {'old': self.pipeline_hash, 'new': pipeline_hash}) self.set_pipeline_hash(pipeline_hash) self.pipeline_validated = True except Exception as err: LOG.debug("Active pipeline config's hash is %s", self.pipeline_hash) LOG.exception(_LE('Unable to load changed pipeline: %s') % err) if cfg.CONF.refresh_event_pipeline_cfg: ev_pipeline_hash = self.pipeline_changed(pipeline.EVENT_TYPE) if ev_pipeline_hash: try: # Pipeline in the notification agent. if hasattr(self, 'event_pipeline_manager'): self.event_pipeline_manager = (pipeline. setup_event_pipeline()) LOG.debug("Event Pipeline has been refreshed. " "old hash: %(old)s, new hash: %(new)s", {'old': self.event_pipeline_hash, 'new': ev_pipeline_hash}) self.set_pipeline_hash(ev_pipeline_hash, pipeline.EVENT_TYPE) self.event_pipeline_validated = True except Exception as err: LOG.debug("Active event pipeline config's hash is %s", self.event_pipeline_hash) LOG.exception(_LE('Unable to load changed event pipeline:' ' %s') % err) if self.pipeline_validated or self.event_pipeline_validated: self.reload_pipeline() self.clear_pipeline_validation_status()
def run(self): super(AgentManager, self).run() self.polling_manager = pipeline.setup_polling() self.join_partitioning_groups() self.start_polling_tasks() self.init_pipeline_refresh()
def run(self): super(AgentManager, self).run() self.polling_manager = pipeline.setup_polling(self.conf) self.join_partitioning_groups() self.start_polling_tasks() self.init_pipeline_refresh()