-
?c       s    d  Z    d k Z  d k Z  d k Z  d k Z  d k Z  d k Z  d k Z  d k l	 Z	 l
 Z
  d k l Z  d k l Z l Z l Z l Z ! d k l Z " d k l Z $ d k l Z % d k l Z & d	 k l Z l Z l Z l Z l Z ( d
 e i    d  Z! + y , d k" l# Z# Wn - e$ j
 o . d Z# n X0 d   Z% 3 e& d  Z' @ d f  d     YZ( M e(   Z) O d d Z* Q d e+ f d     YZ, Sy Te- Wn/ Ue. j
 o  Vd e/ f d     YZ- n XYd f  d     YZ0 d S(   s   The ClientStorage class and the exceptions that it may raise.

Public contents of this module:

ClientStorage -- the main class, implementing the Storage API
N(   s   ClientCaches
   ServerStub(   s   TransactionBuffer(   s   ClientStorageErrors   UnrecognizedResults   ClientDisconnecteds	   AuthError(   s
   get_module(   s   ConnectionManager(   s   POSException(   s	   TimeStamp(   s   LOGs   PROBLEMs   INFOs   BLATHERs   ERRORs   ZCS:%dc    s   ( ) t  | |  |  d  S(   N(   s   LOGs   subsyss   types   msg(   s   types   msgs   subsys(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   log2( s   (   s   ResolvedSerials   rsc    s   0 1 t  t |    Sd  S(   N(   s   strs	   TimeStamps   tid(   s   tid(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   tid2time0 s   c    sp   3 9 : t  i    } ; t t t  i |  d  | d f  } < |  t j	 o = | i |   } n > | Sd S(   s   Internal helper to return a unique TimeStamp instance.

    If the optional argument is not None, it must be a TimeStamp; the
    return value is then guaranteed to be at least 1 microsecond later
    the argument.
    i   i<   N(   s   times   ts   applys	   TimeStamps   gmtimes   prev_tss   Nones	   laterThan(   s   prev_tss   t(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   get_timestamp3 s   *s   DisconnectedServerStubc      s    @ t  Z d  Z G I d   Z RS(   s  Internal helper class used as a faux RPC stub when disconnected.

    This raises ClientDisconnected on all attribute accesses.

    This is a singleton class -- there should be only one instance,
    the global disconnected_stub, os it can be tested by identity.
    c    s   I J t     d  S(   N(   s   ClientDisconnected(   s   selfs   attr(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   __getattr__I s   (   s   __name__s
   __module__s   __doc__s   __getattr__(    (    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   DisconnectedServerStub@ s   i   i   s   ClientStoragec      sQ  Q t  Z d  Z Y ] e Z ^ e i Z _ e Z ` e	 i
 Z b d d e d e d e d d e e e d d d d e d  Z ?e d  Z Ud	   Z cd
   Z md   Z vd   Z |d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z Od   Z \d   Z ad   Z nd   Z rd   Z  ~d   Z! d   Z" d   Z# d   Z$ d   Z% d   Z& d    Z' d! d"  Z( d#   Z) d$   Z* d%   Z+ d&   Z, d'   Z- e e d! d d(  Z. *d)   Z/ 6d*   Z0 =d+   Z1 De d, d-  Z2 jd.   Z3 td/   Z4 wd0   Z5 e d1  Z6 d2   Z7 d3   Z8 d4   Z9 d d5 e d6  Z: d d5 e d7  Z; d8   Z< e d9  Z= d:   Z> d;   Z? d<   Z@ d=   ZA ,d>   ZB ?d?   ZC Ld@   ZD Oe@ ZE PeB ZF QeD ZG RS(A   s   A Storage class that is a network client to a remote storage.

    This is a faithful implementation of the Storage API.

    This class is thread-safe; transactions are serialized in
    tpc_begin().
    s   1i   s    i    i   i,  c    s  b   t  t d |  i i t i   | o d p d | o d p d | f   | o  t  t d  n  |
 t j	 oT  | t j	 o
 | |
 j o  t  t  d  n  t  t  d   |
 } n  | t j o  d	 } n  | |  _  t |  _  t |  _  t |  _  t i   |  _  | |  _  d
 |  _  | |  _  | |  _  | |  _  | |  _  | |  _!  d
 |  _"  t |  _#  t |  _$  t |  _%  h  d
 d <d
 d <d d <d
 d <d
 d <d
 d <|  _&  |  i'   |  _(  t |  _) g  |  _* h  |  _+ | p
 t- |  |  _ t i.   |  _/ t |  _0 t i1   |  _2 g  |  _3 t i1   |  _4 t |  _5 t |  _6 %t i1   |  _7 't8   } |  _: (| |  _; )d |  _< ,|  i= | | -d | d | |  _A /|  iB | |  0d | 1d |	 |  _E 3| o 4|  iF |  nQ 9|  iE iH   o :|  iE iI   n <|  i iJ   o =|  iA iK   n d S(   s_  ClientStorage constructor.

        This is typically invoked from a custom_zodb.py file.

        All arguments except addr should be keyword arguments.
        Arguments:

        addr -- The server address(es).  This is either a list of
            addresses or a single address.  Each address can be a
            (hostname, port) tuple to signify a TCP/IP connection or
            a pathname string to signify a Unix domain socket
            connection.  A hostname may be a DNS name or a dotted IP
            address.  Required.

        storage -- The storage name, defaulting to '1'.  The name must
            match one of the storage names supported by the server(s)
            specified by the addr argument.  The storage name is
            displayed in the Zope control panel.

        cache_size -- The disk cache size, defaulting to 20 megabytes.
            This is passed to the ClientCache constructor.

        name -- The storage name, defaulting to ''.  If this is false,
            str(addr) is used as the storage name.

        client -- A name used to construct persistent cache filenames.
            Defaults to None, in which case the cache is not persistent.
            See ClientCache for more info.

        debug -- Ignored.  This is present only for backwards
            compatibility with ZEO 1.

        var -- When client is not None, this specifies the directory
            where the persistent cache files are created.  It defaults
            to None, in whichcase the current directory is used.

        min_disconnect_poll -- The minimum delay in seconds between
            attempts to connect to the server, in seconds.  Defaults
            to 5 seconds.

        max_disconnect_poll -- The maximum delay in seconds between
            attempts to connect to the server, in seconds.  Defaults
            to 300 seconds.

        wait_for_server_on_startup -- A backwards compatible alias for
            the wait argument.

        wait -- A flag indicating whether to wait until a connection
            with a server is made, defaulting to true.

        wait_timeout -- Maximum time to wait for a connection before
            giving up.  Only meaningful if wait is True.

        read_only -- A flag indicating whether this should be a
            read-only storage, defaulting to false (i.e. writing is
            allowed by default).

        read_only_fallback -- A flag indicating whether a read-only
            remote storage should be acceptable as a fallback when no
            writable storages are available.  Defaults to false.  At
            most one of read_only and read_only_fallback should be
            true.

        username -- string with username to be used when authenticating.
            These only need to be provided if you are connecting to an
            authenticated server storage.

        password -- string with plaintext password to be used
            when authenticated.

        Note that the authentication protocol is defined by the server
        and is detected by the ClientStorage upon connecting (see
        testConnection() and doAuth() for details).
        s)   %s (pid=%d) created %s/%s for storage: %rs   ROs   RWs   fallbacks   normals1   ClientStorage(): debug argument is no longer usedsZ   ClientStorage(): conflicting values for wait and wait_for_server_on_startup; wait prevailssR   ClientStorage(): wait_for_server_on_startup is deprecated; please use wait insteadi   i    s   lengths   sizes
   ZEO Clients   names   supportsUndos   supportsVersionss   supportsTransactionalUndos           s   clients   vars   tmins   tmaxN(L   s   log2s   INFOs   selfs	   __class__s   __name__s   oss   getpids	   read_onlys   read_only_fallbacks   storages   debugs   wait_for_server_on_startups   Nones   waits   PROBLEMs   addrs   _addrs   disconnected_stubs   _servers   _connections   _pending_servers	   threadings   Events   _readys   _is_read_onlys   _conn_is_read_onlys   _storages   _read_only_fallbacks   usernames	   _usernames   passwords	   _passwords   realms   _realms   _midtxn_disconnects   _server_addrs   _tfiles   _picklers   _infos   TransactionBufferClasss   _tbufs   _dbs   _serialss   _serialds   names   strs	   Conditions	   _tpc_conds   _transactions   Locks	   _oid_locks   _oidss
   _load_locks	   _load_oids   _load_statuss   _locks   get_timestamps   ts   _tss   _serials   _oids   ClientCacheClasss
   cache_sizes   clients   vars   _caches   ConnectionManagerClasss   min_disconnect_polls   max_disconnect_polls   _rpc_mgrs   _waits   wait_timeouts   attempt_connects   connects   isSets   open(   s   selfs   addrs   storages
   cache_sizes   names   clients   debugs   vars   min_disconnect_polls   max_disconnect_polls   wait_for_server_on_startups   waits   wait_timeouts	   read_onlys   read_only_fallbacks   usernames   passwords   realms   t(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   __init__b sr   PK
		
B		
c    s   ?@| t j	 o At i   | } n C|  i i d d  I|  i i   o Jx Jd ow K|  i	 i
 d  L|  i	 i   o MPn N| o t i   | j o Ot t d  PPn Qt t d  qY Wn S|  i   d  S(   Ns   synci   i   s    Timed out waiting for connections(   Waiting for cache verification to finish(   s   timeouts   Nones   times   deadlines   selfs   _rpc_mgrs   connects   _connections   is_asyncs   _readys   waits   isSets   log2s   PROBLEMs   INFOs
   _wait_sync(   s   selfs   timeouts   deadline(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   _wait?s    
c    s~   UXxq Xd of Y|  i i   o ZPn [t t d  \|  i t j o _|  i   Sn a|  i i d  q	 Wd  S(   Ni   s(   Waiting for cache verification to finishi   (	   s   selfs   _readys   isSets   log2s   INFOs   _connections   Nones   _waits   pending(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys
   _wait_syncUs    
c    s   cde|  i i   f|  i t j	 o  g|  i i   ht |  _ n i|  i t j	 o  j|  i i   kt |  _ n d S(   s@   Storage API: finalize the storage, releasing external resources.N(   s   selfs   _tbufs   closes   _caches   Nones   _rpc_mgr(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   closecs   c    s   mst| |  _ d S(   s   Storage API: register a database for invalidation messages.

        This is called by ZODB.DB (and by some tests).

        The storage isn't really ready to use until after this call.
        N(   s   dbs   selfs   _db(   s   selfs   dbs   limit(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys
   registerDBms   c    s   vwz|  i i   Sd S(   s>   Return whether the storage is currently connected to a server.N(   s   selfs   _readys   isSet(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   is_connectedvs   c    s7   ||  i } | t j	 o | i   n d S(   sq   Handle any pending invalidation messages.

        This is called by the sync method in ZODB.Connection.
        N(   s   selfs   _connections   cns   Nones   pending(   s   selfs   cn(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   sync|s   c    s   |  i o |  i o t d  n t |  } | o+ t t d |  i	 i
 | f  d  Sn | \ } } } | o3 t t d |  i	 i
 | f  t d  n | |  } | i |  i |  i |  i  Sd  S(   Ns   empty username or passwords    %s: no such an auth protocol: %ss7   %s: %s isn't a valid protocol, must have a Client classs   invalid protocol(   s   selfs	   _usernames	   _passwords	   AuthErrors
   get_modules   protocols   modules   log2s   PROBLEMs	   __class__s   __name__s   storage_classs   clients   db_classs   stubs   cs   starts   _realm(   s   selfs   protocols   stubs   cs   db_classs   modules   clients   storage_class(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   doAuths    	c    so  t  t d |  d |  _ |  i |  } | i   } t  t d |  | oc |  i	 | |  } | o$ t  t d  | i |  n t  t d  t d  n y* | i t |  i  |  i  d SWns t i j
 oa |  i o
   n t  t d  | i t |  i  d d d |  _ d Sn Xd	 S(
   s  Internal: test the given connection.

        This returns:   1 if the connection is an optimal match,
                        0 if it is a suboptimal but acceptable match.
        It can also raise DisconnectedError or ReadOnlyError.

        This is called by ZEO.zrpc.ConnectionManager to decide which
        connection to use in case there are multiple, and some are
        read-only and others are read-write.

        This works by calling register() on the server.  In read-only
        mode, register() is called with the read_only flag set.  In
        writable mode and in read-only fallback mode, register() is
        called with the read_only flag cleared.  In read-only fallback
        mode only, if the register() call raises ReadOnlyError, it is
        retried with the read-only flag set, and if this succeeds,
        this is deemed a suboptimal match.  In all other cases, a
        succeeding register() call is deemed an optimal match, and any
        exception raised by register() is passed through.
        s   Testing connection %ri    s!   Server authentication protocol %rs    Client authentication successfuls   Authentication failedi   s0   Got ReadOnlyError; trying again with read_only=1s	   read_onlyN(   s   log2s   INFOs   conns   selfs   _conn_is_read_onlys   StorageServerStubClasss   stubs   getAuthProtocols   auths   doAuths   skeys   setSessionKeys   ERRORs	   AuthErrors   registers   strs   _storages   _is_read_onlys   POSExceptions   ReadOnlyErrors   _read_only_fallback(   s   selfs   conns   auths   stubs   skey(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   testConnections.   


c    s\  |  i t j o d Sn |  i t j	 o d } n
 d } |  i | i    |  i t j	 o |  i i   n | |  _ | o t	 t
 d |  i  n t	 t
 d |  i  |  i |  } g  |  _ |  i i | i    |  i |  | i   o! t	 t
 d  |  i   n |  i   d S(   s   Internal: start using the given connection.

        This is called by ConnectionManager after it has decided which
        connection should be used.
        Ni   i    s   Reconnected to storage: %ss   Connected to storage: %ss(   Waiting for cache verification to finish(   s   selfs   _caches   Nones   _connections	   reconnects   set_server_addrs   conns   get_addrs   closes   log2s   INFOs   _server_addrs   StorageServerStubClasss   stubs   _oidss   _infos   updates   get_infos   verify_caches   is_asyncs
   _wait_syncs   _handle_extensions(   s   selfs   conns   stubs	   reconnect(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   notifyConnecteds*   	
c    sa   xT |  i   i   D]= } t |  |  o# t |  | |  i i |   n q Wd  S(   N(   s   selfs   getExtensionMethodss   keyss   names   hasattrs   setattrs   _servers   extensionMethod(   s   selfs   name(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   _handle_extensionss    	c    s   t  | t i  o | |  _ n t o t  | t i  p t  | d } y 	t
 i |  \ } } } Wn> 
t
 i j
 o, } t t d | | f  | } n Xt | | d f  |  _ d  S(   Ni    s   Error resolving host: %s (%s)i   (   s
   isinstances   addrs   typess
   StringTypes   selfs   _server_addrs	   __debug__s	   TupleTypes   AssertionErrors   hosts   sockets   gethostbyaddrs	   canonicals   aliasess   addrss   errors   errs   log2s   BLATHERs   str(   s   selfs   addrs   errs	   canonicals   hosts   addrss   aliases(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   set_server_addrs   $c    s>   |  i t j o t  n d |  i |  i f Sd  S(   Ns   %s:%s(   s   selfs   _server_addrs   Nones   ClientDisconnecteds   _storage(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   sortKeys   c    s  "|  i i   } #| t j	 o8$| i   } %| | j oG &t t	 d  (|  i i
   )| |  _ *|  i i   +d Sn .t t	 d | t |  f  0t t	 d | | o
 t |  f  3| i |  } 4| t j	 oe 5t t	 d t | d   6|  i i
   7|  i |   8| |  _ 9|  i i   :d Sn n <t t	 d  >t i d	 d
  |  _ ?t i |  i d  |  _ @d |  i _ B|  i i | i  C| |  _ D| i   Ed Sd S(   s   Internal routine called to verify the cache.

        The return value (indicating which path we took) is used by
        the test suite.
        s5   No verification necessary (last_inval_tid up-to-date)s   no verifications   last inval tid: %r %s
s   last transaction: %r %ss   Recovering %d invalidationsi   s   quick verifications   Verifying caches   suffixs   .invs   full verificationN(   s   selfs   _caches
   getLastTids   last_inval_tids   Nones   servers   lastTransactions   ltids   log2s   INFOs   opens   _servers   _readys   sets   tid2times   getInvalidationss   pairs   lens   invalidateTransactions   tempfiles   TemporaryFiles   _tfiles   cPickles   Picklers   _picklers   fasts   verifys	   zeoVerifys   _pending_servers   endZeoVerify(   s   selfs   servers   last_inval_tids   ltids   pair(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   verify_caches8    'c    s[   OTUt  t d t |  i   Wt |  _ X|  i i   Yt	 |  _
 Zd |  _ d S(   s   Internal: notify that the server connection was terminated.

        This is called by ConnectionManager when the connection is
        closed or when certain problems with the connection occur.
        s   Disconnected from storage: %si   N(   s   log2s   PROBLEMs   reprs   selfs   _server_addrs   Nones   _connections   _readys   clears   disconnected_stubs   _servers   _midtxn_disconnect(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   notifyDisconnectedOs   c    s   \]_|  i d Sd S(   s   Return the size of the storage.s   lengthN(   s   selfs   _info(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   __len__\s   c    s2   aijd |  i |  i   o d p d f Sd S(   sW  Storage API: return the storage name as a string.

        The return value consists of two parts: the name as determined
        by the name and addr argments to the ClientStorage
        constructor, and the string 'connected' or 'disconnected' in
        parentheses indicating whether the storage is (currently)
        connected.
        s   %s (%s)s	   connecteds   disconnectedN(   s   selfs   __name__s   is_connected(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   getNameas   c    s   nop|  i d Sd S(   s;   Storage API: an approximate size of the database, in bytes.s   sizeN(   s   selfs   _info(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   getSizens   c    s    r{||  i i d h   Sd S(   s  getExtensionMethods

        This returns a dictionary whose keys are names of extra methods
        provided by this storage. Storage proxies (such as ZEO) should
        call this method to determine the extra methods that they need
        to proxy in addition to the standard storage methods.
        Dictionary values should be None; this will be a handy place
        for extra marshalling information, should we need it
        s   extensionMethodsN(   s   selfs   _infos   get(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   getExtensionMethodsrs   	c    s   ~|  i d Sd S(   s,   Storage API: return whether we support undo.s   supportsUndoN(   s   selfs   _info(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   supportsUndo~s   c    s   |  i d Sd S(   s0   Storage API: return whether we support versions.s   supportsVersionsN(   s   selfs   _info(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   supportsVersionss   c    s   |  i d Sd S(   s:   Storage API: return whether we support transactional undo.s   supportsTransactionalUndoN(   s   selfs   _info(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   supportsTransactionalUndos   c    s,   |  i o d Sn |  i Sd S(   s5   Storage API: return whether we are in read-only mode.i   N(   s   selfs   _is_read_onlys   _conn_is_read_only(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys
   isReadOnlys   c    s\   |  i o t i    n |  i | j	 o t i |  i |   n d S(   s;   Internal helper to check a transaction argument for sanity.N(   s   selfs   _is_read_onlys   POSExceptions   ReadOnlyErrors   _transactions   transs   StorageTransactionError(   s   selfs   trans(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   _check_transs   c    si   |  i |  |  i i | |  i  } x' | D] } |  i	 i
 | d  q; W| Sd S(   s9   Storage API: clear any changes made by the given version.s    N(   s   selfs   _check_transs   transactions   _servers   abortVersions   versions   _serials   oidss   oids   _tbufs
   invalidate(   s   selfs   versions   transactions   oidss   oid(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   abortVersions   

 	c    s   |  i |  |  i i | | |  i  } | o1 x' | D] } |  i
 i | |  qH Wn. x' | D] } |  i
 i | |  qy W| Sd S(   s:   Storage API: commit the source version in the destination.N(   s   selfs   _check_transs   transactions   _servers   commitVersions   sources   destinations   _serials   oidss   oids   _tbufs
   invalidate(   s   selfs   sources   destinations   transactions   oids   oids(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   commitVersions   

 	
 	i   c    s#   |  i i | | |  Sd S(   s   Storage API: return a sequence of HistoryEntry objects.

        This does not support the optional filter argument defined by
        the Storage API.
        N(   s   selfs   _servers   historys   oids   versions   length(   s   selfs   oids   versions   length(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   historys   c    s   |  i i |  Sd S(   s2   Storage API: return current serial number for oid.N(   s   selfs   _servers	   getSerials   oid(   s   selfs   oid(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys	   getSerials   c    s    |  i i | |  Sd S(   s5   Storage API: load a historical revision of an object.N(   s   selfs   _servers
   loadSerials   oids   serial(   s   selfs   oids   serial(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys
   loadSerials   c 	   s  |  i i   z1 |  i i | |  } | o | Sn Wd |  i i   X|  i	 t
 j o t    n |  i i   z |  i i   z | |  _ d |  _ Wd |  i i   X|  i	 i |  \ } } } } } |  i i   zV |  i o9 |  i i d  |  i i | | | | | |  n t
 |  _ Wd |  i i   XWd |  i i   X| o | o
 | | j o | | f Sn( | o | | f Sn t |  d S(   s   Storage API: return the data for a given object.

        This returns the pickle data and serial number for the object
        specified by the given object id and version, if they exist;
        otherwise a KeyError is raised.
        Ni   i    (   s   selfs   _locks   acquires   _caches   loads   oids   versions   pairs   releases   _servers   Nones   ClientDisconnecteds
   _load_locks	   _load_oids   _load_statuss   zeoLoads   ps   ss   vs   pvs   svs	   checkSizes   stores   KeyError(	   s   selfs   oids   versions   pvs   svs   ps   ss   vs   pair(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   loadsD   
$&
c    s{   |  i i    z4 |  i i |  } | t j	 o | Sn Wd |  i i   X|  i	 i |  Sd S(   s   Storage API: return the version, if any, that modfied an object.

        If no version modified the object, return an empty string.
        N(
   s   selfs   _locks   acquires   _caches   modifiedInVersions   oids   vs   Nones   releases   _server(   s   selfs   oids   v(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   modifiedInVersions   c    s   	
|  i o t i    n |  i i   zK |  i o) |  i i   |  _ |  i i	   n |  i i
   SWd |  i i   Xd S(   s,   Storage API: return a new object identifier.N(   s   selfs   _is_read_onlys   POSExceptions   ReadOnlyErrors	   _oid_locks   acquires   _oidss   _servers   new_oidss   reverses   pops   release(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   new_oids   c    sT   "%| t j o &t i   } n '| | d } (|  i i | |  Sd S(   s  Storage API: pack the storage.

        Deviations from the Storage API: the referencesf argument is
        ignored; two additional optional arguments wait and days are
        provided:

        wait -- a flag indicating whether to wait for the pack to
            complete; defaults to true.

        days -- a number of days to subtract from the pack time;
            defaults to zero.
        iQ N(   s   ts   Nones   times   dayss   selfs   _servers   packs   wait(   s   selfs   ts   referencesfs   waits   days(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   packs
   c    s   *+,|  i o -t |  i  } .|  i |  } /|  i | 40xG | D0]< \ } } 1t | t  o 2|  n 3| |  i	 | <qL W4| Sn d S(   s7   Internal helper to move data from _serials to _seriald.N(
   s   selfs   _serialss   lens   ls   rs   oids   ss
   isinstances	   Exceptions   _seriald(   s   selfs   ss   rs   oids   l(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   _check_serials*s   
 c    sb   678|  i |  9|  i i | | | | |  i	  :|  i
 i | | |  ;|  i   Sd S(   s&   Storage API: store data for an object.N(   s   selfs   _check_transs   transactions   _servers   storeas   oids   serials   datas   versions   _serials   _tbufs   stores   _check_serials(   s   selfs   oids   serials   datas   versions   transaction(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   store6s
   "c    sK   =>?| |  i j	 o @d Sn A|  i i |  i  B|  i   Sd S(   s#   Storage API: vote on a transaction.N(   s   transactions   selfs   _transactions   _servers   votes   _serials   _check_serials(   s   selfs   transaction(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   tpc_vote=s
   s    c    s  DEF|  i o Gt i    n H|  i i   Id |  _ JxY J|  i t j	 oE N|  i | j o O|  i i
   Pd Sn Q|  i i d  qH WR| |  _ S|  i i
   U| t j o& Vt |  i  |  _ W|  i } n Yt |  |  _ Z| } \y2 ]|  i i | | i | i ^| i | |  Wn4 _a|  i t j	 o b|  i   n c  n Xe| |  _ f|  i i   g|  i i   h|  i 2d S(   s!   Storage API: begin a transaction.i    Ni   (   s   selfs   _is_read_onlys   POSExceptions   ReadOnlyErrors	   _tpc_conds   acquires   _midtxn_disconnects   _transactions   Nones   txns   releases   waits   tids   get_timestamps   _tss   ids	   TimeStamps   _servers	   tpc_begins   users   descriptions
   _extensions   statuss   disconnected_stubs   end_transactions   _serials   _tbufs   clears   _serialds   _serials(   s   selfs   txns   tids   statuss   id(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys	   tpc_beginDs:    	
c    sU   jkn|  i |  _ o|  i i   pt |  _ q|  i i   r|  i i   d S(   s%   Internal helper to end a transaction.N(	   s   selfs   _serials   _ltids	   _tpc_conds   acquires   Nones   _transactions   notifys   release(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   end_transactionjs   c    s   tu|  i Sd  S(   N(   s   selfs   _ltid(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   lastTransactionts   c    s   wxy| |  i j	 o zd Sn {zJ y |  i i |  i  Wn& t j
 o t t d  n XWd |  i	 i
   |  i i
   |  i 2|  i   Xd S(   s!   Storage API: abort a transaction.Ns)   ClientDisconnected in tpc_abort() ignored(   s   transactions   selfs   _transactions   _servers	   tpc_aborts   _serials   ClientDisconnecteds   log2s   BLATHERs   _tbufs   clears   _serialds   _serialss   end_transaction(   s   selfs   transaction(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys	   tpc_abortws   
c    sN  | |  i j	 o d Sn |  i i   z |  i o t d   n |  i i |  i	  } |  i i   z/ |  i   | t j	 o |   n Wd |  i i   X|  i i |  |  i   } t o. | t j p t |  d j p t d |  Wd |  i i   |  i   Xd S(   s"   Storage API: finish a transaction.Ns2   Calling tpc_finish() on a disconnected transactioni    s   unhandled serialnos: %s(   s   transactions   selfs   _transactions
   _load_locks   acquires   _midtxn_disconnects   ClientDisconnecteds   _servers
   tpc_finishs   _serials   tids   _locks   _update_caches   fs   Nones   releases   _caches
   setLastTids   _check_serialss   rs	   __debug__s   lens   AssertionErrors   end_transaction(   s   selfs   transactions   fs   tids   r(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys
   tpc_finishs*   <c    s  |  i t j o d Sn |  i i |  i i    y |  i i   Wn( t j
 o } t	 d |  n Xx d o y |  i i
   } Wn( t j
 o } t	 d |  n X| t j o Pn | \ } } } | t j o t } n |  i | } | t j p
 | t j o |  i i | |  n |  i i | | | |  q W|  i i   d S(   s   Internal helper to handle objects modified by a transaction.

        This iterates over the objects in the transaction buffer and
        update or invalidate the cache.
        Ns=   Unexpected error reading temporary file in client storage: %si   (   s   selfs   _caches   Nones	   checkSizes   _tbufs   get_sizes   begin_iterates
   ValueErrors   msgs   ClientStorageErrors   nexts   ts   oids   vs   ps   ss   _serialds   ResolvedSerials
   invalidates   updates   clear(   s   selfs   oids   ps   ss   ts   vs   msg(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   _update_caches0    
!c    si   |  i |  |  i i | |  i  } x' | D] } |  i	 i
 | d  q; W| Sd S(   s  Storage API: undo a transaction.

        This is executed in a transactional context.  It has no effect
        until the transaction is committed.  It can be undone itself.

        Zope uses this to implement undo unless it is not supported by
        a storage.
        s    N(   s   selfs   _check_transs   transs   _servers   transactionalUndos   trans_ids   _serials   oidss   oids   _tbufs
   invalidate(   s   selfs   trans_ids   transs   oids   oids(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   transactionalUndos   
 	c    s   |  i o t i    n |  i i |  } |  i i	   z1 x' | D] } |  i i | d  q[ WWd |  i i   X| Sd S(   sA   Storage API: undo a transaction, writing directly to the storage.s    N(   s   selfs   _is_read_onlys   POSExceptions   ReadOnlyErrors   _servers   undos   transaction_ids   oidss   _locks   acquires   oids   _caches
   invalidates   release(   s   selfs   transaction_ids   oids   oids(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   undos   
 	ic    s#   |  i i | | |  Sd S(   s%   Storage API: return undo information.N(   s   selfs   _servers   undoInfos   firsts   lasts   specification(   s   selfs   firsts   lasts   specification(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   undoInfos   c    s;   | t j	 o g  Sn |  i i | |  Sd S(   s1  Storage API: return a sequence of TransactionDescription objects.

        The filter argument should be None or left unspecified, since
        it is impossible to pass the filter function to the server to
        be executed there.  If filter is not None, an empty sequence
        is returned.
        N(   s   filters   Nones   selfs   _servers   undoLogs   firsts   last(   s   selfs   firsts   lasts   filter(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   undoLogs   c    s   |  i i |  Sd S(   s<   Storage API: return whether the version has no transactions.N(   s   selfs   _servers   versionEmptys   version(   s   selfs   version(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   versionEmptys   c    s   |  i i |  Sd S(   s:   Storage API: return a sequence of versions in the storage.N(   s   selfs   _servers   versionss   max(   s   selfs   max(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   versionss   c    s   |  i i |  d S(   s>   Server callback to pass a list of changed (oid, serial) pairs.N(   s   selfs   _serialss   extends   args(   s   selfs   args(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys	   serialnoss   c    s   	|  i i |  d S(   s.   Server callback to update the info dictionary.N(   s   selfs   _infos   updates   dict(   s   selfs   dict(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   infos   c    s;   |  i t j o d Sn |  i i |  d S(   ss   Server callback to invalidate an (oid, version) pair.

        This is called as part of cache validation.
        N(   s   selfs   _picklers   Nones   dumps   args(   s   selfs   args(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   invalidateVerifys   c    s  |  i i   z h  }  xl | D ]a \ } } !| |  i j o "d |  _ n #|  i	 i
 | d | $d | i | h   | <q, W&|  i t j	 o@ 'x6 | i   D']% \ } } (|  i i
 | d | q Wn Wd  )*|  i i   Xd  S(   Ni    s   versioni   (   s   selfs   _locks   acquires   versionss   invss   oids   versions	   _load_oids   _load_statuss   _caches
   invalidates
   setdefaults   _dbs   Nones   itemss   vs   ds   release(   s   selfs   invss   versions   ds   versionss   vs   oid(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   _process_invalidationss   	
  %c    s   ,-.|  i t j o /d Sn 1|  i i t t f  2t |  _ 3|  i i d  4|  i } 5t |  _ 6|  i t |   7| i	   9t
 t d  :|  i |  _ ;|  i i   <t |  _ =t
 t d  d S(   s2   Server callback to signal end of cache validation.Ni    s   endVerify finishings   endVerify finished(   s   selfs   _picklers   Nones   dumps   _tfiles   seeks   fs   _process_invalidationss   InvalidationLogIterators   closes   log2s   INFOs   _pending_servers   _servers   _readys   sets   _pending_conn(   s   selfs   f(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys	   endVerify,s   c    s   ?@A|  i i |  B|  i t j	 oH Ct t Dd  Ex$ | DE] } F|  i i
 |  qI WGd Sn H|  i |  d S(   s#   Invalidate objects modified by tid.s4   Transactional invalidation during cache verificationN(   s   selfs   _caches
   setLastTids   tids   _picklers   Nones   log2s   BLATHERs   argss   ts   dumps   _process_invalidations(   s   selfs   tids   argss   t(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   invalidateTransaction?s   	

 	c    s   LM|  i t |  Sd  S(   N(   s   selfs   invalidateTransactions   Nones   args(   s   selfs   args(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   invalidateTransLs   (H   s   __name__s
   __module__s   __doc__s   TransactionBuffers   TransactionBufferClasss   ClientCaches   ClientCacheClasss   ConnectionManagers   ConnectionManagerClasss
   ServerStubs   StorageServers   StorageServerStubClasss   MBs   Nones   __init__s   _waits
   _wait_syncs   closes
   registerDBs   is_connecteds   syncs   doAuths   testConnections   notifyConnecteds   _handle_extensionss   set_server_addrs   sortKeys   verify_caches   notifyDisconnecteds   __len__s   getNames   getSizes   getExtensionMethodss   supportsUndos   supportsVersionss   supportsTransactionalUndos
   isReadOnlys   _check_transs   abortVersions   commitVersions   historys	   getSerials
   loadSerials   loads   modifiedInVersions   new_oids   packs   _check_serialss   stores   tpc_votes	   tpc_begins   end_transactions   lastTransactions	   tpc_aborts
   tpc_finishs   _update_caches   transactionalUndos   undos   undoInfos   undoLogs   versionEmptys   versionss	   serialnoss   infos   invalidateVerifys   _process_invalidationss	   endVerifys   invalidateTransactions   invalidateTranss
   invalidates   ends
   Invalidate(    (    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   ClientStorageQ s~   		@
	0'8
/&
(		s   StopIterationc      s   Vt  Z WRS(   N(   s   __name__s
   __module__(    (    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   StopIterationVs   	s   InvalidationLogIteratorc      sD   Yt  Z d  Z Z\d   Z `d   Z cd   Z ld   Z RS(   s4   Helper class for reading invalidations in endVerify.c    s(   \]t  i |  |  _ ^d |  _ d  S(   Ni    (   s   cPickles	   Unpicklers   fileobjs   selfs
   _unpicklers	   getitem_i(   s   selfs   fileobj(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   __init__\s   c    s   `a|  Sd  S(   N(   s   self(   s   self(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   __iter__`s   c    sI   cd|  i i   \ } } e| t j o ft  n g| | f Sd  S(   N(   s   selfs
   _unpicklers   loads   oids   versions   Nones   StopIteration(   s   selfs   oids   version(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   nextcs   c    s|   lmt  o | |  i j p t  ny o|  i   } Wn" pt j
 o qt |  n Xr|  i d 7_ s| Sd  S(   Ni   (	   s	   __debug__s   is   selfs	   getitem_is   AssertionErrors   nexts   objs   StopIterations
   IndexError(   s   selfs   is   obj(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   __getitem__ls   !(   s   __name__s
   __module__s   __doc__s   __init__s   __iter__s   nexts   __getitem__(    (    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   InvalidationLogIteratorYs
   	(1   s   __doc__s   cPickles   oss   sockets   tempfiles	   threadings   times   typess   ZEOs   ClientCaches
   ServerStubs   ZEO.TransactionBuffers   TransactionBuffers   ZEO.Exceptionss   ClientStorageErrors   UnrecognizedResults   ClientDisconnecteds	   AuthErrors   ZEO.auths
   get_modules   ZEO.zrpc.clients   ConnectionManagers   ZODBs   POSExceptions   ZODB.TimeStamps	   TimeStamps   zLOGs   LOGs   PROBLEMs   INFOs   BLATHERs   ERRORs   getpids   log2s   ZODB.ConflictResolutions   ResolvedSerials   ImportErrors   tid2times   Nones   get_timestamps   DisconnectedServerStubs   disconnected_stubs   MBs   objects   ClientStorages   StopIterations	   NameErrors	   Exceptions   InvalidationLogIterator(!   s   cPickles   ClientStorageErrors   LOGs   TransactionBuffers	   TimeStamps   ResolvedSerials   ConnectionManagers   StopIterations   get_timestamps   disconnected_stubs   log2s   ClientStorages   ERRORs   UnrecognizedResults   PROBLEMs   ClientCaches   typess   INFOs	   AuthErrors   sockets   ClientDisconnecteds	   threadings   tempfiles   MBs   POSExceptions   tid2times
   get_modules   times   InvalidationLogIterators   DisconnectedServerStubs
   ServerStubs   oss   BLATHER(    (    s9   /usr/pkg/lib/python2.2/site-packages/ZEO/ClientStorage.pys   ? sF   "(    