| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.6/site-packages/khashmir/ |
Upload File : |
Ñò
²ÅßCc @ sí d d k l Z d d k Td d k Td d k Z d d k Z d d k l Z l Z l
Z
l Z l Z d d k
l Z d „ Z d e f d „ ƒ YZ d e f d
„ ƒ YZ d d k Z d e i f d „ ƒ YZ e d
j o e i ƒ n d S( iÿÿÿÿ( t bttime( t *N( t Kt HASH_LENGTHt NULL_IDt MAX_FAILURESt MIN_PING_INTERVAL( t Nodec C s t | i | i ƒ S( N( t cmpt lastSeen( t at b( ( s3 /usr/lib/python2.6/site-packages/khashmir/ktable.pyt ls s t KTablec B sz e Z d Z d „ Z d „ Z d „ Z e d „ Z d „ Z d „ Z d e
d „ Z d
„ Z d „ Z
d „ Z d
„ Z RS( t nodet bucketsc C s6 | | _ t g d d t ƒ g | _ | i | ƒ d S( Nl l ( R t KBucketR R t
insertNode( t selfR ( ( s3 /usr/lib/python2.6/site-packages/khashmir/ktable.pyt __init__ s c C s t | i | ƒ S( s, the index of the bucket that should hold int( t bisect_leftR ( R t num( ( s3 /usr/lib/python2.6/site-packages/khashmir/ktable.pyt _bucketIndexForInt! s c C s | i | i | ƒ S( N( R R ( R R ( ( s3 /usr/lib/python2.6/site-packages/khashmir/ktable.pyt bucketForInt% s c C s2 t | t ƒ o t i | ƒ } nQ t | t ƒ o
| i } n4 t | t ƒ p t | t ƒ o
| } n
t d ‚ g } | i | ƒ } y | i
| i | ƒ } Wn t j
o n X| g S| | i
| i
} | p3 g } | D] } | i p | | qå qå ~ } n t | ƒ t j o÷ | d } | d }
xà t | ƒ t j oÈ | d j p |
t | i
ƒ j o¥ | d j o | | i
| i
} n |
t | i
ƒ j o | | i
|
i
} n | d } |
d }
| p3 g } | D] } | i p | | qæqæ~ } q7q7Wn | i | d „ ƒ | t S( sN
return K nodes in our own local table closest to the ID.
s* findNodes requires an int, string, or Nodei i c S s t | | i A| | i Aƒ S( ( R R ( R
R R ( ( s3 /usr/lib/python2.6/site-packages/khashmir/ktable.pyt <lambda>T s ( t
isinstancet strt hasht intifyR R t intt longt TypeErrorR R t getNodeWithIntt
ValueErrort lt invalidt lenR t sort( R t idR# R t nodest iR t _[1]R
t mint maxt _[2]( ( s3 /usr/lib/python2.6/site-packages/khashmir/ktable.pyt findNodes( s@
3
6
<c C s° | i | i d } t g | i | | i ƒ } | i i | i i | i ƒ d | ƒ | i | | _ xC | i D]7 } | i | i j o | i | ƒ | i | ƒ qq qq Wd S( Ni i (
R+ R* R R t insertt indexR"