Package Ganga :: Package Core :: Package GangaRepository :: Module GangaRepository :: Class GangaRepository
[hide private]
[frames] | no frames]

Class GangaRepository

source code

object --+
         |
        GangaRepository
Known Subclasses:

GangaRepository is the base class for repository backend implementations. It provides an interface for developers of new backends. The base class implements a transient Ganga Repository for testing purposes.

Instance Methods [hide private]
 
__init__(self, registry, locking=True)
GangaRepository constructor.
source code
 
_internal_del__(self, id)
Internal function for repository classes to (logically) delete items to the repository.
source code
 
_internal_setitem__(self, id, obj)
Internal function for repository classes to add items to the repository.
source code
 
_make_empty_object_(self, id, category, classname)
Internal helper: adds an empty GangaObject of the given class to the repository.
source code
 
add(self, objs, force_ids=None)
add(objects) --> list of object IDs in this repository Add the given objects to the repository and return their IDs After successfully determining the id call _internal_setitem__(id,obj) for each id/object pair.
source code
 
clean(self)
clear() --> None Remove the Repository completely (rm -rf) and set it up again.
source code
 
delete(self, ids)
delete(ids) --> None Delete the objects specified by the ids from the repository.
source code
 
flush(self, ids)
flush(ids) --> None Writes the objects specified by the ids to the persistency layer.
source code
 
get_lock_session(id)
Tries to determine the session that holds the lock on id for information purposes, and return an informative string.
source code
 
get_other_sessions()
Tries to determine the other sessions that are active and returns an informative string for each of them.
source code
 
load(self, ids)
load(ids) --> None Load the objects specified by the ids from the persistency layer.
source code
 
lock(self, ids)
lock(ids) --> bool Locks the specified IDs against modification from other Ganga sessions Raise RepositoryError Returns successfully locked ids
source code
 
reap_locks(self)
reap_locks() --> True/False Remotely clear all foreign locks from the session.
source code
 
shutdown(self)
shutdown() --> None Disconnect from the repository.
source code
 
startup(self)
startup() --> None Connect to the repository.
source code
 
unlock(self, ids)
unlock(ids) --> None Unlock the specified IDs to allow another Ganga session to modify them EXPERIMENTAL - does not have to be implemented.
source code
 
update_index(self, id=None)
update_index(id = None) --> iterable of ids Read the index containing the given ID (or all indices if id is None).
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, registry, locking=True)
(Constructor)

source code 

GangaRepository constructor. Initialization should be done in startup()

Overrides: object.__init__

_internal_setitem__(self, id, obj)

source code 

Internal function for repository classes to add items to the repository. Should not raise any Exceptions

_make_empty_object_(self, id, category, classname)

source code 

Internal helper: adds an empty GangaObject of the given class to the repository. Raise RepositoryError Raise PluginManagerError if the class name is not found

add(self, objs, force_ids=None)

source code 

add(objects) --> list of object IDs in this repository Add the given objects to the repository and return their IDs After successfully determining the id call _internal_setitem__(id,obj) for each id/object pair. WARNING: If forcing the IDs, no locking is done here! Raise RepositoryError

clean(self)

source code 

clear() --> None Remove the Repository completely (rm -rf) and set it up again. Very violent. Use with caution.

delete(self, ids)

source code 

delete(ids) --> None Delete the objects specified by the ids from the repository. Assumes that the objects associated to the ids are locked (!) Call _internal_del__(id) for each id to remove the GangaObject from the Registry Raise KeyError Raise RepositoryError

flush(self, ids)

source code 

flush(ids) --> None Writes the objects specified by the ids to the persistency layer. Raise KeyError Raise RepositoryError

get_lock_session(id)

source code 

Tries to determine the session that holds the lock on id for information purposes, and return an informative string. Returns None on failure

load(self, ids)

source code 

load(ids) --> None Load the objects specified by the ids from the persistency layer. Raise KeyError Raise RepositoryError

reap_locks(self)

source code 

reap_locks() --> True/False Remotely clear all foreign locks from the session. WARNING: This is not nice. Returns True on success, False on error.

shutdown(self)

source code 

shutdown() --> None Disconnect from the repository. Raise RepositoryError

startup(self)

source code 

startup() --> None Connect to the repository. Raise RepositoryError

update_index(self, id=None)

source code 

update_index(id = None) --> iterable of ids Read the index containing the given ID (or all indices if id is None). Create objects as needed , and set the _index_cache for all objects that are not fully loaded. Returns a list of ids of jobs that changed/removed/added Raise RepositoryError