OwlCyberSecurity - MANAGER
Edit File: balancing.cpython-312.pyc
� U��g � �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 �w/opt/hc_python/lib64/python3.12/site-packages/../../../lib/python3.12/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 � �"