Ejemplo n.º 1
0
 def __init__(self):
     self.logger = UserLogger.getlog()
     """当前服务器IP地址"""
     self.public_ip = BusinessUtil.get_public_ip()
     """设置全局变量"""
     global_argument.set_value(self.public_ip)
     """选择消费机制"""
     self.task_choice_pattern = self.public_ip
Ejemplo n.º 2
0
 def __init__(self):
     self.logger = UserLogger.getlog()
     """当前服务器IP地址"""
     self.public_ip = BusinessUtil.get_public_ip()
     """设置全局变量"""
     global_argument.set_value(self.public_ip)
     self.task_code = None
     self.relId = None
Ejemplo n.º 3
0
	def __init__(self, smtp_server, proxy_server=None):
		"""
		初始化smtp_server
		:param smtp_server:
		:param proxy_server:
		"""
		self._server = None
		self.logger = UserLogger.getlog()
		self._server = self._get_server(smtp_server, proxy_server)
Ejemplo n.º 4
0
    def __init__(self):
        """
		初始化
		"""
        self.logger = UserLogger.getlog()
        """当前服务器IP地址"""
        self.public_ip = BusinessUtil.get_public_ip()
        """设置全局变量"""
        global_argument.set_value(self.public_ip)
Ejemplo n.º 5
0
    def __init__(self, host=None, zookeeper_host=None):
        """
		初始
		:param host:
		:param zookeeper_host:
		"""
        if not host:
            host = kafka_config.KAFKA_BOOTSTRAP_SERVERS
        self.logger = UserLogger.getlog()
        self._host = host
        self._zookeeper_host = zookeeper_host
        self._client = KafkaClient(self._host)
Ejemplo n.º 6
0
    def __init__(self, kafka_topic, bootstrap_servers=None):
        """
		消费者初始化
		:param bootstrap_servers: ip地址段
		:param kafka_topic: 主题
		"""
        """获取kafka配置"""
        if not bootstrap_servers:
            bootstrap_servers = kafka_config.KAFKA_BOOTSTRAP_SERVERS.split(",")
        self.logger = UserLogger.getlog()
        self._bootstrap_servers = bootstrap_servers
        self._kafka_topic = kafka_topic
        self._consumer = KafkaConsumer(
            self._kafka_topic, bootstrap_servers=self._bootstrap_servers)
Ejemplo n.º 7
0
	def __init__(self, host, key, register_name, is_master=True, port=5000):
		"""
		分布式队列初始化
		:param host:
		:param key:
		:param register_name:
		:param is_master:
		:param port:
		"""
		self.logger = UserLogger.getlog()
		self._host = host
		self._port = port
		self._key = key.encode()
		self._is_master = is_master
		self._register_name = register_name
		self._server = self._get_queue_server()
Ejemplo n.º 8
0
    def __init__(self,
                 kafka_topic="kafka_data_queue",
                 key=None,
                 bootstrap_servers=None):
        """
		:param bootstrap_servers: ip地址段
		:param kafka_topic: 主题
		:param key: 根据不同key 区分消息
		"""
        """获取kafka配置"""
        if not bootstrap_servers:
            bootstrap_servers = kafka_config.KAFKA_BOOTSTRAP_SERVERS.split(",")
        self.logger = UserLogger.getlog()
        self._bootstrap_servers = bootstrap_servers
        self._kafka_topic = kafka_topic
        self._key = key
        self._producer = KafkaProducer(
            bootstrap_servers=self._bootstrap_servers)
Ejemplo n.º 9
0
 def __init__(self):
     self.logger = UserLogger.getlog()
Ejemplo n.º 10
0
 def __init__(self, subject):
     self.subject = subject
     self.logger = UserLogger.getlog()
Ejemplo n.º 11
0
    def __init__(self):
        """
		初始化日志
		"""
        self.logger = UserLogger.getlog()
Ejemplo n.º 12
0
	def __init__(self, pop3_server):
		"""
		初始化pop_server
		"""
		self.logger = UserLogger.getlog()
		self._server = self._get_server(pop3_server)