관리-도구
편집 파일: connection.cpython-38.pyc
U )�e� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddl Z ddlZddlZz,ddl mZmZmZ ddlZddlmZ W n@ ek r� ddlmZmZmZ ddlmZ ddlmZ Y nX ejd dk�rzdd lmZ W n ek �r d ZY nX dZn0zdd lmZ W n ek �r: d ZY nX dZddlZddlmZ dd l m!Z! ddl"m#Z# ddl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* ddl+m,Z,m-Z-m.Z.m/Z/ ddl0m1Z1 ddl0m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl0m8Z8 ddl9m:Z:m;Z;m<Z< e1j=e1j>fZ?e1j=e1j@e1jAe1jBe1jCfZDg aEdZFddd�ZGi ZHdZIdZJdZKdZLdZMdZNdZOdZPdZQdZRdZSdZTdZUdZVeWfd dfeXeYeWejejZge[e<� �d!dfeXe[fd"dfeYfd#eOfeWfd$dfeWfd%dfeWfd&eUfeYfd'eLfeYfd(eKfd)� Z\e �]d*�Z^G d+d,� d,e_�Z`G d-d.� d.e_�ZaG d/d0� d0e_�ZbG d1d2� d2eb�ZcG d3d4� d4e_�ZdG d5d6� d6ed�Zed7d8� Zfd9d:� Zgd;d<� Zhd=d>� Zie�r�G d?d@� d@ejj�ZkG dAdB� dBe�ZlG dCdD� dDe_�ZmG dEdF� dFe_�ZnG dGdH� dHen�ZoG dIdJ� dJen�ZpG dKdL� dLe_�ZqdS )Mz,Implementing communication with MySQL Fabric� N)� b16decode)�bisect)�md5)�Fault�ServerProxy� Transport)� BadStatusLine� )�HTTPSConnectionFT)�MySQLConnection)�MySQLConverter)�MySQLConnectionPool)�Error�InterfaceError�NotSupportedError�MySQLFabricError� InternalError� DatabaseError)�MySQLCursor�MySQLCursorBuffered�MySQLCursorRaw�MySQLCursorBufferedRaw)� errorcode� )�FabricMySQLServer�FabricShard)�FabricCache)�WeightedRoundRobin��version)�PY2� isunicode� UNICODE_TYPES�xmlrpci~ i~ )r# �mysql� �GLOBAL�LOCALZFAULTYzName of group of serverszSharding keyzList of tables in queryz#Read-Only, Write-Only or Read-Writez+Identity of the shard for direct connection� z+GLOBAL for accessing Global Group, or LOCALzAttempts for getting connectionz$Seconds to wait between each attempt) �group�key�tables�modeZshard�mapping�scope�attempts� attempt_delayzmyconnpy-fabricc @ sB e Zd ZdZdd� Zdd� Zdd� Zdd d �Zdd� Zd d� Z dS )�MySQLRPCProtocolz0Class using MySQL protocol to query Fabric. c C s( t � | _t|||||�| _| j�� d S �N)r � converter�FabricMySQLConnection�handler�connect��self�fabric�host�port�connect_attempts� connect_delay� r>