示例#1
0
 def is_random_access_topology_active(self, env):
     env.set_params(self.__params)
     topologies = metron_service.get_running_topologies(self.__params)
     is_random_access_running = False
     if self.__random_access_indexing_topology in topologies:
         is_random_access_running = topologies[self.__random_access_indexing_topology] in ['ACTIVE', 'REBALANCING']
     return is_random_access_running
 def is_topology_active(self, env):
     env.set_params(self.__params)
     active = True
     topologies = metron_service.get_running_topologies()
     is_running = False
     if self.__indexing in topologies:
         is_running = topologies[self.__indexing] in ['ACTIVE', 'REBALANCING']
     active &= is_running
     return active
示例#3
0
 def is_topology_active(self, env):
     env.set_params(self.__params)
     active = True
     topologies = metron_service.get_running_topologies(self.__params)
     is_running = False
     if self.__indexing_topology in topologies:
         is_running = topologies[self.__indexing_topology] in ['ACTIVE', 'REBALANCING']
     active &= is_running
     return active
 def get_running_topology_names(self, env):
     """
     Returns the names of all 'running' topologies.  A running topology
     is one that is either active or rebalancing.
     :param env: Environment
     :return: Set containing the names of all running topologies.
     """
     env.set_params(self.__params)
     topology_status = metron_service.get_running_topologies(self.__params)
     topology_names = ([name for name in topology_status if topology_status[name] in ['ACTIVE', 'REBALANCING']])
     return set(topology_names)
示例#5
0
 def get_running_topology_names(self, env):
     """
     Returns the names of all 'running' topologies.  A running topology
     is one that is either active or rebalancing.
     :param env: Environment
     :return: Set containing the names of all running topologies.
     """
     env.set_params(self.__params)
     topology_status = metron_service.get_running_topologies(self.__params)
     topology_names = ([name for name in topology_status if topology_status[name] in ['ACTIVE', 'REBALANCING']])
     return set(topology_names)
 def topologies_running(self, env):
     env.set_params(self.__params)
     all_running = True
     topologies = metron_service.get_running_topologies()
     for parser in self.get_parser_list():
         parser_found = False
         is_running = False
         if parser in topologies:
             parser_found = True
             is_running = topologies[parser] in ['ACTIVE', 'REBALANCING']
         all_running &= parser_found and is_running
     return all_running