Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Public Attributes
arcom.store.basestore.BaseStore Class Reference
Inheritance diagram for arcom.store.basestore.BaseStore:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def lock
def unlock

Public Attributes

 datadir
 non_existent_object
 llock

Detailed Description

Definition at line 7 of file basestore.py.


Constructor & Destructor Documentation

def arcom.store.basestore.BaseStore.__init__ (   self,
  storecfg,
  non_existent_object = {} 
)
Constructor of BaseStore.

BaseStore(storecfg)

'storecfg' is an XMLNode with a 'DataDir'
'non_existent_object' will be returned if an object not found

Reimplemented in arcom.store.zodbstore.ZODBStore, arcom.store.transdbstore.TransDBStore, arcom.store.cachedpicklestore.CachedPickleStore, arcom.store.picklestore.PickleStore, arcom.store.cachedstringstore.CachedStringStore, and arcom.store.stringstore.StringStore.

Definition at line 9 of file basestore.py.

00009 
00010     def __init__(self, storecfg, non_existent_object = {}):
00011         """ Constructor of BaseStore.
00012 
00013         BaseStore(storecfg)
00014 
00015         'storecfg' is an XMLNode with a 'DataDir'
00016         'non_existent_object' will be returned if an object not found
00017         """
00018         # get the datadir from the storecfg XMLNode
00019         self.datadir = str(storecfg.Get('DataDir'))
00020         # set the value which we should return if there an object does not exist
00021         self.non_existent_object = non_existent_object
00022         # if the given data directory does not exist, try to create it
00023         if not os.path.exists(self.datadir):
00024             os.mkdir(self.datadir)
00025         # initialize a lock which can be used to avoid race conditions
00026         self.llock = threading.Lock()


Member Function Documentation

def arcom.store.basestore.BaseStore.lock (   self,
  blocking = True 
)
Acquire the lock.

lock(blocking = True)

'blocking': if blocking is True, then this only returns when the lock is acquired.
If it is False, then it returns immediately with False if the lock is not available,
or with True if it could be acquired.

Reimplemented in storage.ahash.replicatedahash.ReplicationStore.

Definition at line 27 of file basestore.py.

00027 
00028     def lock(self, blocking = True):
00029         """ Acquire the lock.
00030 
00031         lock(blocking = True)
00032 
00033         'blocking': if blocking is True, then this only returns when the lock is acquired.
00034         If it is False, then it returns immediately with False if the lock is not available,
00035         or with True if it could be acquired.
00036         """
00037         return self.llock.acquire(blocking)

Here is the caller graph for this function:

Release the lock.

unlock()

Reimplemented in storage.ahash.replicatedahash.ReplicationStore.

Definition at line 38 of file basestore.py.

00038 
00039     def unlock(self):
00040         """ Release the lock.
00041 
00042         unlock()
00043         """
00044         self.llock.release()
        

Here is the caller graph for this function:


Member Data Documentation

Definition at line 18 of file basestore.py.

Definition at line 25 of file basestore.py.

Definition at line 20 of file basestore.py.


The documentation for this class was generated from the following file: