| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/site-packages/mysql/connector/fabric/__pycache__/ |
Upload File : |
�
��f � �B � d Z ddlZd� Z G d� de� Z G d� de� Zy)zImplementing load balancing� Nc � � t | |z dz j t j d� t j �� � S )z%Calculate ratio
Returns int
�d �1)�rounding)�int�quantize�decimal�Decimal�ROUND_HALF_DOWN)�part�wholes �BC:\Python312\Lib\site-packages\mysql/connector/fabric/balancing.py�_calc_ratior sB � �
��U�
�3��(�(������w�'>�'>� )� @� A� A� c �B � e Zd ZdZd� Zd� Zd� Zed� � Zed� � Z y)�BaseSchedulingzABase class for all scheduling classes dealing with load balancingc � � g | _ g | _ y)�
InitializeN)�_members�_ratios��selfs r �__init__zBaseScheduling.__init__+ s � ���
���r c � � t �)aH Set members and ratios
This methods sets the members using the arguments passed. Each
argument must be a sequence where the second item is the weight.
The first element is an identifier. For example:
('server1', 0.6), ('server2', 0.8)
Setting members means that the load will be reset. If the members
are the same as previously set, nothing will be reset or set.
If no arguments were given the members will be set to an empty
list.
Raises ValueError when weight can't be converted to a Decimal.
��NotImplementedError)r �argss r �set_memberszBaseScheduling.set_members0 s
� �"