Ejemplo n.º 1
0
def get_all_file_state_managers(conf):
    """
  Returns all the file state_managers.
  """
    state_managers = []
    state_locations = conf.get_state_locations_of_type("file")
    for location in state_locations:
        name = location['name']
        rootpath = os.path.expanduser(location['rootpath'])
        LOG.info("Connecting to file state with rootpath: " + rootpath)
        state_manager = FileStateManager(name, rootpath)
        try:
            state_manager.start()
        except Exception:
            LOG.error("Exception while connecting to state_manager.")
            traceback.print_exc()
        state_managers.append(state_manager)

    return state_managers
def get_all_file_state_managers(conf):
  """
  Returns all the file state_managers.
  """
  state_managers = []
  state_locations = conf.get_state_locations_of_type("file")
  for location in state_locations:
    name = location['name']
    rootpath = os.path.expanduser(location['rootpath'])
    LOG.info("Connecting to file state with rootpath: " + rootpath)
    state_manager = FileStateManager(name, rootpath)
    try:
      state_manager.start()
    except Exception as e:
      LOG.error("Exception while connecting to state_manager.")
      traceback.print_exc()
    state_managers.append(state_manager)

  return state_managers
Ejemplo n.º 3
0
def get_all_file_state_managers(conf):
    """
  Returns all the file state_managers.
  """
    state_managers = []
    state_locations = conf.get_state_locations_of_type("file")
    for location in state_locations:
        name = location['name']
        rootpath = os.path.expanduser(location['rootpath'])
        LOG.info("Connecting to file state with rootpath: " + rootpath)
        state_manager = FileStateManager(name, rootpath)
        state_managers.append(state_manager)

    return state_managers
Ejemplo n.º 4
0
 def _load_state_mgr(self, cluster):
   state_mgr_config = configloader.load_state_manager_locations(cluster, os.getenv("HOME")
                                                                +'/.heron/conf/'+cluster
                                                                + '/statemgr.yaml')
   if state_mgr_config[0]["type"] == 'file':
     return FileStateManager(self.topology_name, os.getenv("HOME")
                                                 +'/.herondata/repository/state/local')
   elif state_mgr_config[0]["type"] == 'zookeeper':
     host_port = state_mgr_config[0]["hostport"].split(':')
     return ZkStateManager(state_mgr_config[0]["type"],
       [(host_port[0], int(host_port[1]))],
       state_mgr_config[0]["rootpath"],
       state_mgr_config[0]["tunnelhost"])
   else:
     raise status.TestFailure("Unrecognized state manager type: %s"
                              % state_mgr_config["type"])