rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
ext = dumps(ext,1) | ext = cPickle.dumps(ext, 1) | def tpc_begin(self, transaction, tid=None, status=' '): if self._is_read_only: raise POSException.ReadOnlyError() self._lock_acquire() try: if self._transaction is transaction: return self._lock_release() self._commit_lock_acquire() self._lock_acquire() self._transaction = transaction self._clear_temp() | cf112582b09ef23459667d5eb1afbe62cf945377 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/cf112582b09ef23459667d5eb1afbe62cf945377/BaseStorage.py |
ext="" | ext = "" | def tpc_begin(self, transaction, tid=None, status=' '): if self._is_read_only: raise POSException.ReadOnlyError() self._lock_acquire() try: if self._transaction is transaction: return self._lock_release() self._commit_lock_acquire() self._lock_acquire() self._transaction = transaction self._clear_temp() | cf112582b09ef23459667d5eb1afbe62cf945377 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/cf112582b09ef23459667d5eb1afbe62cf945377/BaseStorage.py |
def testExceptionInTpcAbort(self): | e18d876c26f39b7264657c3248d7667276f00967 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e18d876c26f39b7264657c3248d7667276f00967/testTransaction.py | ||
except TestTxnException: pass | except TestTxnException: pass | def testExceptionInTpcAbort(self): | e18d876c26f39b7264657c3248d7667276f00967 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e18d876c26f39b7264657c3248d7667276f00967/testTransaction.py |
already_pickled=0): | already_pickled=0, user=None, description=None): | def _dostore(self, oid=None, revid=None, data=None, version=None, already_pickled=0): """Do a complete storage transaction. The defaults are: - oid=None, ask the storage for a new oid - revid=None, use a revid of ZERO - data=None, pickle up some arbitrary data (the integer 7) - version=None, use the empty string vers... | 56b49f117c4a2e27c9f513c828032ea9b6f5f6f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/56b49f117c4a2e27c9f513c828032ea9b6f5f6f9/StorageTestBase.py |
truncate(f, pos, file_size, output) | truncate(f, pos, file_size, outp) | def read_txn_header(f, pos, file_size, outp, ltid): # Read the transaction record f.seek(pos) h = f.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl = u64(stl) if pos + (tl + 8) > file_size: error("bad transaction length at %s", pos) if tl < (23 + ... | bb00230a211c762a48aa5cb735223c94452bd5c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/bb00230a211c762a48aa5cb735223c94452bd5c0/fsrecover.py |
print __doc__ % argv[0] | print __doc__ % sys.argv[0] | def main(): try: opts, (inp, outp) = getopt.getopt(sys.argv[1:], "fv:pP:") except getopt.error: die() print __doc__ % argv[0] force = partial = verbose = 0 pack = None for opt, v in opts: if opt == "-v": verbose = int(v) elif opt == "-p": partial = 1 elif opt == "-f": force = 1 elif opt == "-P": pack = time.time() - f... | bb00230a211c762a48aa5cb735223c94452bd5c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/bb00230a211c762a48aa5cb735223c94452bd5c0/fsrecover.py |
prepare_ok = False | raise AbortError(r) | def commit(self, txn): # commit calls _finishCommit() or abort() assert txn._status is Status.ACTIVE txn._status = Status.PREPARING prepare_ok = True self.logger.debug("%s: prepare", txn) try: for r in txn._resources: if prepare_ok and not r.prepare(txn): prepare_ok = False except: txn._status = Status.FAILED raise txn... | fbc8326d16094b1c5281d42c2bcf4f150c2b854f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fbc8326d16094b1c5281d42c2bcf4f150c2b854f/manager.py |
if prepare_ok: self._finishCommit(txn) else: self.abort(txn) | self._finishCommit(txn) | def commit(self, txn): # commit calls _finishCommit() or abort() assert txn._status is Status.ACTIVE txn._status = Status.PREPARING prepare_ok = True self.logger.debug("%s: prepare", txn) try: for r in txn._resources: if prepare_ok and not r.prepare(txn): prepare_ok = False except: txn._status = Status.FAILED raise txn... | fbc8326d16094b1c5281d42c2bcf4f150c2b854f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fbc8326d16094b1c5281d42c2bcf4f150c2b854f/manager.py |
return Rollback([r.savepoint(txn) for r in txn._resources]) | return Rollback(txn, [r.savepoint(txn) for r in txn._resources]) | def savepoint(self, txn): self.logger.debug("%s: savepoint", txn) return Rollback([r.savepoint(txn) for r in txn._resources]) | fbc8326d16094b1c5281d42c2bcf4f150c2b854f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fbc8326d16094b1c5281d42c2bcf4f150c2b854f/manager.py |
txn_factory = Transaction | def savepoint(self, txn): self.logger.debug("%s: savepoint", txn) return Rollback([r.savepoint(txn) for r in txn._resources]) | fbc8326d16094b1c5281d42c2bcf4f150c2b854f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fbc8326d16094b1c5281d42c2bcf4f150c2b854f/manager.py | |
txn = self.txn_factory(self) self.logger.debug("%s: begin", txn) return txn | if self._current is not None: self._current.abort() self._current = self.txn_factory(self) self.logger.debug("%s: begin", self._current) return self._current | def begin(self): txn = self.txn_factory(self) self.logger.debug("%s: begin", txn) return txn | fbc8326d16094b1c5281d42c2bcf4f150c2b854f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fbc8326d16094b1c5281d42c2bcf4f150c2b854f/manager.py |
def suspend(self, txn): if self._current != txn: raise TransactionError("Can't suspend transaction because " "it is not active") self._suspended.add(txn) self._current = None | def abort(self, txn): super(TransactionManager, self).abort(txn) self._current = None | fbc8326d16094b1c5281d42c2bcf4f150c2b854f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fbc8326d16094b1c5281d42c2bcf4f150c2b854f/manager.py | |
def __init__(self, resources): | def __init__(self, txn, resources): self._txn = txn | def __init__(self, resources): self._resources = resources | fbc8326d16094b1c5281d42c2bcf4f150c2b854f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fbc8326d16094b1c5281d42c2bcf4f150c2b854f/manager.py |
if self._pool[tid] is txn: | if self._pool.get(tid) is txn: | def suspend(self, txn): tid = thread.get_ident() if self._pool[tid] is txn: self._suspend.add(txn) del self._pool[tid] else: raise TransactionError("txn %s not owned by thread %s" % (txn, tid)) | fbc8326d16094b1c5281d42c2bcf4f150c2b854f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fbc8326d16094b1c5281d42c2bcf4f150c2b854f/manager.py |
close(self._f[current]) | self._f[current].close() | def checkSize(self, size): # Make sure we aren't going to exceed the target size. # If we are, then flip the cache. if self._pos+size > self._limit: current=not self._current self._current=current if self._p[current] is not None: # Persistent cache file: # Note that due to permission madness, waaa, # we need to remove ... | 59983c089a052a0f5e7f61263a3d34cfad806045 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/59983c089a052a0f5e7f61263a3d34cfad806045/ClientCache.py |
transaction_id = base64.decodestring(transaction_id + '==\n') tid, tpos = transaction_id[:8], U64(transaction_id[8:]) | tid = transaction_id[:8] oid = transaction_id[8:] if oid == '' or not self._index.has_key(oid): raise UndoError, 'Undoing a non-object affecting transaction' pos = self._index[oid] | def transactionalUndo(self, transaction_id, transaction): """Undo a transaction, given by transaction_id. | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
while 1: self._file.seek(pos) h = self._file.read(DATA_HDR_LEN) doid,serial,prev,tpos,vlen,plen = unpack('>8s8s8s8sH8s', h) tpos = U64(tpos) self._file.seek(tpos) thistid = self._file.read(8) if thistid == tid: break pos = U64(prev) if not pos: raise UndoError, 'Invalid undo transaction id' | def transactionalUndo(self, transaction_id, transaction): """Undo a transaction, given by transaction_id. | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py | |
if last < 0: last=first-last+1 | if last < 0: last=first-last+1 | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
packt=self._packt | packt = self._packt | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
if pos < 39: return [] | if pos < 39: return [] | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
if tid < packt: break if status != ' ': continue | if tid < packt: break if status != ' ': continue | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
d={'id': encode(tid+p64(pos))[:22], | e = {} if el: try: e = loads(read(el)) except: pass next = read(8) if next == tl: id = tid else: id = tid + next d={'id': id, | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
'user_name': u, 'description': d} if el: try: e=loads(read(el)) d.update(e) except: pass | 'user_name': u, 'description': d} d.update(e) | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
if i >= first: append(d) | if i >= first: append(d) | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py | ||
finally: self._lock_release() | finally: self._lock_release() | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unp... | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py |
oid=object._p_oid __traceback_info__=oid p, serial = self._storage.load(oid, self._version) file=StringIO(p) unpickler=Unpickler(file) unpickler.persistent_load=self._persistent_load copy = unpickler.load() klass, args = copy if klass is not ExtensionKlass: LOG('ZODB',ERROR, "Unexpected klass when setting class stat... | try: oid=object._p_oid __traceback_info__=oid p, serial = self._storage.load(oid, self._version) file=StringIO(p) unpickler=Unpickler(file) unpickler.persistent_load=self._persistent_load copy = unpickler.load() klass, args = copy if klass is not ExtensionKlass: LOG('ZODB',ERROR, "Unexpected klass when setting class... | def setklassstate(self, object, tt=type(()), ct=type(HelperClass)): oid=object._p_oid __traceback_info__=oid p, serial = self._storage.load(oid, self._version) file=StringIO(p) unpickler=Unpickler(file) unpickler.persistent_load=self._persistent_load | 4654bb13d8b062ee052c5ce506d710b34d307e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4654bb13d8b062ee052c5ce506d710b34d307e1f/Connection.py |
print modulename, classname | def find_global(modulename, classname): """Helper for this test suite to get special PersistentMapping""" print modulename, classname if classname == "PersistentMapping": class PersistentMapping: def __setstate__(self, state): self.__dict__.update(state) return PersistentMapping else: __import__(modulename) mod = sys.... | bec1498db12847ad1f883e74de7550f096c13678 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/bec1498db12847ad1f883e74de7550f096c13678/testPersistentMapping.py | |
def log(message, level=zLOG.INFO, label="StorageServer:%s" % os.getpid(), error=None): zLOG.LOG(label, level, message, error=error) | _label = "ZSS" def set_label(): global _label _label = "ZSS:%s" % os.getpid() def log(message, level=zLOG.INFO, label=None, error=None): zLOG.LOG(label or _label, level, message, error=error) | def log(message, level=zLOG.INFO, label="StorageServer:%s" % os.getpid(), error=None): zLOG.LOG(label, level, message, error=error) | b65ac5ca69f921a61a6c92be02c15bb88f981bfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b65ac5ca69f921a61a6c92be02c15bb88f981bfb/StorageServer.py |
def _log(self, msg, level=zLOG.INFO, error=None, pid=os.getpid()): | def _log(self, msg, level=zLOG.INFO, error=None): | def _log(self, msg, level=zLOG.INFO, error=None, pid=os.getpid()): name = getattr(self.__storage, '__name__', None) if name is None: name = str(self.__storage) zLOG.LOG("ZEOStorage:%s:%s" % (pid, name), level, msg, error=error) | b65ac5ca69f921a61a6c92be02c15bb88f981bfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b65ac5ca69f921a61a6c92be02c15bb88f981bfb/StorageServer.py |
zLOG.LOG("ZEOStorage:%s:%s" % (pid, name), level, msg, error=error) | zLOG.LOG("%s:%s" % (_label, name), level, msg, error=error) | def _log(self, msg, level=zLOG.INFO, error=None, pid=os.getpid()): name = getattr(self.__storage, '__name__', None) if name is None: name = str(self.__storage) zLOG.LOG("ZEOStorage:%s:%s" % (pid, name), level, msg, error=error) | b65ac5ca69f921a61a6c92be02c15bb88f981bfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b65ac5ca69f921a61a6c92be02c15bb88f981bfb/StorageServer.py |
def new_oids(self, n=100): """Return a sequence of n new oids, where n defaults to 100""" if n <= 0: # Always return at least one n = 1 return [self.__storage.new_oid() for i in range(n)] | b65ac5ca69f921a61a6c92be02c15bb88f981bfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b65ac5ca69f921a61a6c92be02c15bb88f981bfb/StorageServer.py | ||
os.unlink(path) | need_to_delete = 1 for dummy in range(5): try: os.unlink(path) except: time.sleep(0.5) else: need_to_delete = 0 break if need_to_delete: os.unlink(path) | def tearDown(self): """Try to cause the tests to halt""" zLOG.LOG("testZEO", zLOG.INFO, "tearDown() %s" % self.id()) for p in self.conf_paths: os.remove(p) if getattr(self, '_storage', None) is not None: self._storage.close() if hasattr(self._storage, 'cleanup'): self._storage.cleanup() for adminaddr in self._servers: ... | fa0327cdc5d1ba5aaa3250abf756462af57ae483 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fa0327cdc5d1ba5aaa3250abf756462af57ae483/ConnectionTests.py |
def open(self, version='', transaction=None, temporary=0, force=None, waitflag=1, mvcc=True, txn_mgr=None, synch=True): """Return a database Connection for use by application code. | 516183b5448db1aa401616599c1141cbda0d1be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/516183b5448db1aa401616599c1141cbda0d1be5/DB.py | ||
elif len(pool) == 1: | elif len(pool)==1: | def open(self, version='', transaction=None, temporary=0, force=None, waitflag=1, mvcc=True, txn_mgr=None, synch=True): """Return a database Connection for use by application code. | 516183b5448db1aa401616599c1141cbda0d1be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/516183b5448db1aa401616599c1141cbda0d1be5/DB.py |
def open(self, version='', transaction=None, temporary=0, force=None, waitflag=1, mvcc=True, txn_mgr=None, synch=True): """Return a database Connection for use by application code. | 516183b5448db1aa401616599c1141cbda0d1be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/516183b5448db1aa401616599c1141cbda0d1be5/DB.py | ||
pool_lock.acquire() | if not pool_lock.acquire(0): result = DB.open(self, version, transaction, temporary, force, waitflag) self._a() return result | def open(self, version='', transaction=None, temporary=0, force=None, waitflag=1, mvcc=True, txn_mgr=None, synch=True): """Return a database Connection for use by application code. | 516183b5448db1aa401616599c1141cbda0d1be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/516183b5448db1aa401616599c1141cbda0d1be5/DB.py |
c = pool[-1] del pool[-1] | c = pool.pop() | def open(self, version='', transaction=None, temporary=0, force=None, waitflag=1, mvcc=True, txn_mgr=None, synch=True): """Return a database Connection for use by application code. | 516183b5448db1aa401616599c1141cbda0d1be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/516183b5448db1aa401616599c1141cbda0d1be5/DB.py |
finally: self._r() | finally: self._r() | def open(self, version='', transaction=None, temporary=0, force=None, waitflag=1, mvcc=True, txn_mgr=None, synch=True): """Return a database Connection for use by application code. | 516183b5448db1aa401616599c1141cbda0d1be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/516183b5448db1aa401616599c1141cbda0d1be5/DB.py |
import zLog.MinimalLogger zLog.MinimalLogger._log.initialize() | import zLOG.MinimalLogger zLOG.MinimalLogger._log.initialize() | def rotate_logs(): import zLOG # There hasn't been a clear way to reinitialize the MinimalLogger. # I'll checkin the public initialize() method soon, but also try some # other strategies for older Zope installs :-(. init = getattr(zLOG, 'initialize', None) if init is not None: init() return # This will work if the mini... | ad343515bb9017141674134341d90d37f5b8be36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/ad343515bb9017141674134341d90d37f5b8be36/start.py |
"pwd module is not available." % uid)) | "pwd module is not available." % arg)) | def set_uid(arg): """Try to set uid and gid based on -u argument. This will only work if this script is run by root. """ try: import pwd except ImportError: LOG('ZEO/start.py', INFO, ("Can't set uid to %s." "pwd module is not available." % uid)) return try: gid = None try: arg = int(arg) except: # conversion could rai... | 1e0ce96972a1788780c69434f9a213b11cd509d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/1e0ce96972a1788780c69434f9a213b11cd509d0/start.py |
self.__has_mac = True | self.__has_mac = 0 | def __init__(self, sock, addr, map=None, debug=None): self.addr = addr if debug is not None: self._debug = debug elif not hasattr(self, '_debug'): self._debug = __debug__ # __input_lock protects __inp, __input_len, __state, __msg_size self.__input_lock = threading.Lock() self.__inp = None # None, a single String, or a ... | 5134ece85e40fad58c3ad776be545d623afcee4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5134ece85e40fad58c3ad776be545d623afcee4f/smac.py |
resouces. The only works under Unix, and if ZServer is started by root. | resouces. The only works under Unix, and if the storage server is started by root. | def main(argv): me=argv[0] sys.path[:]==filter(None, sys.path) sys.path.insert(0, directory(me, 2)) args=[] last='' for a in argv[1:]: if (a[:1] != '-' and string.find(a, '=') > 0 and last != '-S' # lame, sorry ): a=string.split(a,'=') os.environ[a[0]]=string.join(a[1:],'=') continue args.append(a) last=a INSTANCE_HO... | 1cc1e605588712d8d9670e699b255f31dd072ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/1cc1e605588712d8d9670e699b255f31dd072ca2/start.py |
and call it to minotor the storage. | and call it to monitor the storage. | def info(RESPONSE): RESPONSE['Content-type']= 'text/plain' | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
__version__='$Revision: 1.6 $'[11:-2] import base64, POSException, BTree, BaseStorage, time, string, utils | __version__='$Revision: 1.7 $'[11:-2] import base64, time, string from ZODB import POSException, BaseStorage, utils | def info(RESPONSE): RESPONSE['Content-type']= 'text/plain' | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
self._data=BTree.BTree() | self._data=OOBTree.OOBTree() | def __init__(self, name='Demo Storage', base=None, quota=None): | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
tindex.append([oid, serial, r, None, p]) | if dest: new_vdata = dest, vdata[1] else: new_vdata = None tindex.append([oid, serial, r, new_vdata, p]) | def commitVersion(self, src, dest, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._lock_acquire() try: v=self._vindex.get(src, None) if v is None: return tindex=self._tindex oids=[] for r in v.values(): oid, serial, pre, vdata, p = r oids.appe... | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
try: oid, serial, pre, vdata, p = self._index[oid] except: if self._base: return self._base.load(oid, '') | try: oid, serial, pre, vdata, p = self._index[oid] except KeyError: if self._base: return self._base.load(oid, '') | def load(self, oid, version): self._lock_acquire() try: try: oid, serial, pre, vdata, p = self._index[oid] except: if self._base: return self._base.load(oid, '') raise KeyError, oid | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
if nv: oid, serial, pre, vdata, p = nv else: raise KeyError, oid if p is None: raise KeyError, oid | if nv: oid, serial, pre, vdata, p = nv else: raise KeyError, oid if p is None: raise KeyError, oid | def load(self, oid, version): self._lock_acquire() try: try: oid, serial, pre, vdata, p = self._index[oid] except: if self._base: return self._base.load(oid, '') raise KeyError, oid | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
r=[oid, serial, old, version and (version,nv) or None, data] | r=[oid, serial, old, version and (version, nv) or None, data] | def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
if s > self._quota: | if self._quota is not None and s > self._quota: | def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
r=[] a=r.append for version in self._vindex.keys()[:max]: if self.versionEmpty(version): continue a(version) if max and len(r) >= max: return r | r = [] for v in self._vindex.keys(): if self.versionEmpty(v): continue r.append(v) if max is not None and len(r) >= max: break | def versions(self, max=None): r=[] a=r.append for version in self._vindex.keys()[:max]: if self.versionEmpty(version): continue a(version) if max and len(r) >= max: return r | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py |
if ((invalid(oid) and not hasattr(object, '_p_resolveConflict')) or invalid(None)): | if invalid(oid) and not hasattr(object, '_p_resolveConflict'): | def commit(self, object, transaction): if object is self: # We registered ourself. Execute a commit action, if any. if self.__onCommitActions is not None: method_name, args, kw = self.__onCommitActions.pop(0) apply(getattr(self, method_name), (transaction,) + args, kw) return oid = object._p_oid invalid = self._invali... | 3864625806d3ff7ef2c87394f31ee0a6fa94234f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3864625806d3ff7ef2c87394f31ee0a6fa94234f/Connection.py |
if ( (invalid(oid) and not hasattr(object, '_p_resolveConflict')) or invalid(None) ): | if invalid(oid) and not hasattr(object, '_p_resolveConflict'): | # def persistent_id(object, | 3864625806d3ff7ef2c87394f31ee0a6fa94234f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3864625806d3ff7ef2c87394f31ee0a6fa94234f/Connection.py |
invalid = self._invalid if invalid(oid) or invalid(None): | if self._invalid(oid): | def setstate(self, object): oid = object._p_oid | 3864625806d3ff7ef2c87394f31ee0a6fa94234f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3864625806d3ff7ef2c87394f31ee0a6fa94234f/Connection.py |
if self._invalid(None): raise ConflictError("transaction already invalidated") | def tpc_begin(self, transaction, sub=None): if self._invalid(None): # Some nitwit invalidated everything! raise ConflictError("transaction already invalidated") self._invalidating = [] self._creating = [] | 3864625806d3ff7ef2c87394f31ee0a6fa94234f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3864625806d3ff7ef2c87394f31ee0a6fa94234f/Connection.py | |
continue | def main(path): fs = FileStorage(path, read_only=1) noload = {} for oid in fs._index.keys(): try: data, serial = fs.load(oid, "") except: print "oid %s failed to load" % hex(u64(oid)) if VERBOSE: traceback.print_exc() noload[oid] = 1 # XXX If we get here after we've already loaded objects # that refer to this one, we ... | 7c49891c8520c4a1c5fee5d0aed8b4e738d05e00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7c49891c8520c4a1c5fee5d0aed8b4e738d05e00/fsrefs.py | |
level=zLOG.DEBUG) | level=zLOG.TRACE) | def message_input(self, message): """Decoding an incoming message and dispatch it""" # XXX Not sure what to do with errors that reach this level. # Need to catch ZRPCErrors in handle_reply() and # handle_request() so that they get back to the client. try: msgid, flags, name, args = self.marshal.decode(message) except D... | 8d7c57665d46df0cacc46068195732bd4e94a4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8d7c57665d46df0cacc46068195732bd4e94a4b5/connection.py |
log("send msg: %d, %d, %s, ..." % (msgid, flags, method)) | log("send msg: %d, %d, %s, ..." % (msgid, flags, method), zLOG.TRACE) | def send_call(self, method, args, flags): # send a message and return its msgid self.__msgid_lock.acquire() try: msgid = self.msgid self.msgid = self.msgid + 1 finally: self.__msgid_lock.release() if __debug__: log("send msg: %d, %d, %s, ..." % (msgid, flags, method)) buf = self.marshal.encode(msgid, flags, method, arg... | 8d7c57665d46df0cacc46068195732bd4e94a4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8d7c57665d46df0cacc46068195732bd4e94a4b5/connection.py |
if i < first: continue | if i < first: i = i+1 continue | def undoLog(self, first, last, filter=None): self._lock_acquire() try: packt=self._packt if packt is None: raise POSException.UndoError, ( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unpack strip=string.strip... | c7ab07b050138e1a15feb5520f808ddc34a9ab98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c7ab07b050138e1a15feb5520f808ddc34a9ab98/FileStorage.py |
def checkPackVersionsInPast(self): pass def checkPackAfterUndoDeletion(self): pass | def check_periodic_save_index(self): | 34ee83d3e662a6e7366e492aeaef24d49256b0a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/34ee83d3e662a6e7366e492aeaef24d49256b0a4/testFileStorage.py | |
if os.environ.has_key('STUPID_LOG_FILE'): del os.environ['STUPID_LOG_FILE'] if os.environ.has_key('EVENT_LOG_FILE'): del os.environ['EVENT_LOG_FILE'] if os.environ.has_key('STUPID_LOG_SEVERITY'): del os.environ['STUPID_LOG_SEVERITY'] if os.environ.has_key('EVENT_LOG_SEVERITY'): del os.environ['EVENT_LOG_SEVERITY'] | self.wipeEnvironment() | def tearDown(self): try: os.remove(self.path) except os.error: pass if os.environ.has_key('STUPID_LOG_FILE'): del os.environ['STUPID_LOG_FILE'] if os.environ.has_key('EVENT_LOG_FILE'): del os.environ['EVENT_LOG_FILE'] if os.environ.has_key('STUPID_LOG_SEVERITY'): del os.environ['STUPID_LOG_SEVERITY'] if os.environ.has_... | 4e3ab3b200411cee79060138fc986da249bc6c87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4e3ab3b200411cee79060138fc986da249bc6c87/testzLog.py |
else: | else: | def __init__(self, file_name, create=0, read_only=0, stop=None, quota=None): | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
tl=u64(rstl) | tl=U64(rstl) | def _sane(self, index, pos): """Sanity check saved index data by reading the last undone trans | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
opos=pos+23+ul+dl+el | opos=pos+(23+ul+dl+el) | def _sane(self, index, pos): """Sanity check saved index data by reading the last undone trans | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
tloc=u64(stloc) plen=u64(splen) | tloc=U64(stloc) plen=U64(splen) | def _sane(self, index, pos): """Sanity check saved index data by reading the last undone trans | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if vlen: dlen=dlen+16+vlen | if vlen: dlen=dlen+(16+vlen) | def _sane(self, index, pos): """Sanity check saved index data by reading the last undone trans | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
pos=info.get('pos', None) | pos=long(info.get('pos', None)) | def _restore_index(self): """Load the database index from a file to support quick startup """ file_name=self.__name__ index_name=file_name+'.index' try: f=open(index_name,'rb') except: return None p=Unpickler(f) | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
self._save_index() | try: self._save_index() except: pass | def close(self): self._file.close() self._lock_file.close() self._tfile.close() self._save_index() | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
here=tfile.tell()+self._pos+self._thl | here=self._pos+(tfile.tell()+self._thl) | def commitVersion(self, src, dest, transaction, abort=None): # We are going to commit by simply storing back pointers. | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
seek(u64(t)+16) | seek(U64(t)+16) | def commitVersion(self, src, dest, transaction, abort=None): # We are going to commit by simply storing back pointers. | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
srcpos=u64(spos) | srcpos=U64(spos) | def commitVersion(self, src, dest, transaction, abort=None): # We are going to commit by simply storing back pointers. | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if plen != z64: return read(u64(plen)), version, nv | if plen != z64: return read(U64(plen)), version, nv | def _loada(self, oid, _index, file): "Read any version and return the version" pos=_index[oid] file.seek(pos) read=file.read h=read(42) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if vlen: nv = read(8) != z64 file.seek(8,1) # Skip previous version record pointer version=read(vlen) else: version='' nv=0 | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if plen != z64: return read(u64(plen)), serial | if plen != z64: return read(U64(plen)), serial | def _load(self, oid, version, _index, file): pos=_index[oid] file.seek(pos) read=file.read h=read(42) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if doid != oid: raise CorruptedDataError, h if vlen: pnv=read(8) # Read location of non-version data if (not version or len(version) != vlen or (read(8) # ski... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
pos=u64(prev) | pos=U64(prev) | def loadSerial(self, oid, serial): self._lock_acquire() try: _index=self._index file=self._file seek=file.seek read=file.read pos=_index[oid] while 1: seek(pos) h=read(42) doid,dserial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if doid != oid: raise CorruptedDataError, h if dserial == serial: break # Yeee ha! # Ke... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if plen != z64: return read(u64(plen)) | if plen != z64: return read(U64(plen)) | def loadSerial(self, oid, serial): self._lock_acquire() try: _index=self._index file=self._file seek=file.seek read=file.read pos=_index[oid] while 1: seek(pos) h=read(42) doid,dserial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if doid != oid: raise CorruptedDataError, h if dserial == serial: break # Yeee ha! # Ke... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
here=tfile.tell()+pos+self._thl | here=pos+(tfile.tell()+self._thl) | def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if quota is not None and tfile.tell()+pos+self._thl > quota: | if quota is not None and pos+(tfile.tell()+self._thl) > quota: | def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
self._nextpos=0 def tpc_vote(self, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._lock_acquire() try: tfile=self._tfile dlen=tfile.tell() if not dlen: return file=self._file write=file.write tfile.seek(0) id=self._serial user, desc, ext = sel... | def _begin(self, tid, u, d, e): self._thl=23+len(u)+len(d)+len(e) | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py | |
tfile=self._tfile dlen=tfile.tell() if not dlen: return | def _finish(self, tid, u, d, e): tfile=self._tfile dlen=tfile.tell() if not dlen: return # No data in this trans file=self._file write=file.write tfile.seek(0) id=self._serial user, desc, ext = self._ude | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py | |
write=file.write tfile.seek(0) id=self._serial user, desc, ext = self._ude tlen=self._thl pos=self._pos file.seek(pos) tl=tlen+dlen stl=p64(tl) try: write(pack( ">8s" "8s" "c" "H" "H" "H" ,id, stl, 'c', len(user), len(desc), len(ext), )) if user: write(user) if desc: write(desc) if ext: write(ext) ... | file.seek(self._pos+16) file.write(self._tstatus) file.flush() if fsync is not None: fsync(file.fileno()) self._pos=self._nextpos | def _finish(self, tid, u, d, e): tfile=self._tfile dlen=tfile.tell() if not dlen: return # No data in this trans file=self._file write=file.write tfile.seek(0) id=self._serial user, desc, ext = self._ude | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
tid, tpos = transaction_id[:8], u64(transaction_id[8:]) | tid, tpos = transaction_id[:8], U64(transaction_id[8:]) | def undo(self, transaction_id): self._lock_acquire() try: self._clear_index() transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) packt=self._packt if packt is None or packt > tid: raise POSException.UndoError, ( 'Undo is currently disabled for database main... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
tl=u64(h[8:16]) | tl=U64(h[8:16]) | def undo(self, transaction_id): self._lock_acquire() try: self._clear_index() transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) packt=self._packt if packt is None or packt > tid: raise POSException.UndoError, ( 'Undo is currently disabled for database main... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
pos=tpos+23+ul+dl+el | pos=tpos+(23+ul+dl+el) | def undo(self, transaction_id): self._lock_acquire() try: self._clear_index() transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) packt=self._packt if packt is None or packt > tid: raise POSException.UndoError, ( 'Undo is currently disabled for database main... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
plen=u64(splen) prev=u64(sprev) | plen=U64(splen) prev=U64(sprev) | def undo(self, transaction_id): self._lock_acquire() try: self._clear_index() transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) packt=self._packt if packt is None or packt > tid: raise POSException.UndoError, ( 'Undo is currently disabled for database main... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if vlen: dlen=dlen+16+vlen | if vlen: dlen=dlen+(16+vlen) | def undo(self, transaction_id): self._lock_acquire() try: self._clear_index() transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) packt=self._packt if packt is None or packt > tid: raise POSException.UndoError, ( 'Undo is currently disabled for database main... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
pos=pos-u64(read(8))-8 | pos=pos-U64(read(8))-8 | def undoLog(self, first, last, filter=None): self._lock_acquire() try: packt=self._packt if packt is None: raise POSException.UndoError, ( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unpack strip=string.strip... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
seek(u64(t)+16) | seek(U64(t)+16) | def versionEmpty(self, version): self._lock_acquire() try: index=self._index file=self._file seek=file.seek read=file.read srcpos=self._vindex_get(version, 0) t=tstatus=None while srcpos: seek(srcpos) oid=read(8) if index[oid]==srcpos: return 0 h=read(50) # serial, prev(oid), tloc, vlen, plen, pnv, pv tloc=h[16:24] if ... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
srcpos=u64(spos) | srcpos=U64(spos) | def versionEmpty(self, version): self._lock_acquire() try: index=self._index file=self._file seek=file.seek read=file.read srcpos=self._vindex_get(version, 0) t=tstatus=None while srcpos: seek(srcpos) oid=read(8) if index[oid]==srcpos: return 0 h=read(50) # serial, prev(oid), tloc, vlen, plen, pnv, pv tloc=h[16:24] if ... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
prev=u64(prev) | prev=U64(prev) | def history(self, oid, version=None, length=1, filter=None): self._lock_acquire() try: r=[] file=self._file seek=file.seek read=file.read pos=self._index[oid] wantver=version | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
seek(u64(tloc)) | seek(U64(tloc)) | def history(self, oid, version=None, length=1, filter=None): self._lock_acquire() try: r=[] file=self._file seek=file.seek read=file.read pos=self._index[oid] wantver=version | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if el < 0: el=t32-el | def history(self, oid, version=None, length=1, filter=None): self._lock_acquire() try: r=[] file=self._file seek=file.seek read=file.read pos=self._index[oid] wantver=version | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py | |
d['size']=u64(plen) | d['size']=U64(plen) | def history(self, oid, version=None, length=1, filter=None): self._lock_acquire() try: r=[] file=self._file seek=file.seek read=file.read pos=self._index[oid] wantver=version | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
p=u64(file.read(8)) | p=U64(file.read(8)) | def _redundant_pack(self, file, pos): file.seek(pos-8) p=u64(file.read(8)) file.seek(pos-p+8) return file.read(1) not in ' u' | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
offset=0 pos=opos=4 | offset=0L pos=opos=4L | def pack(self, t, referencesf): """Copy data from the current database file to a packed file Non-current records from transactions with time-stamp strings less than packtss are ommitted. As are all undone records. Also, data back pointers that point before packtss are resolved and the associated data are copied, sinc... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
def pack(self, t, referencesf): """Copy data from the current database file to a packed file Non-current records from transactions with time-stamp strings less than packtss are ommitted. As are all undone records. Also, data back pointers that point before packtss are resolved and the associated data are copied, sinc... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py | ||
if el < 0: el=t32-el tl=u64(stl) | tl=U64(stl) | def pack(self, t, referencesf): """Copy data from the current database file to a packed file Non-current records from transactions with time-stamp strings less than packtss are ommitted. As are all undone records. Also, data back pointers that point before packtss are resolved and the associated data are copied, sinc... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
plen=u64(splen) | plen=U64(splen) | def pack(self, t, referencesf): """Copy data from the current database file to a packed file Non-current records from transactions with time-stamp strings less than packtss are ommitted. As are all undone records. Also, data back pointers that point before packtss are resolved and the associated data are copied, sinc... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
dlen=dlen+16+vlen | dlen=dlen+(16+vlen) | def pack(self, t, referencesf): """Copy data from the current database file to a packed file Non-current records from transactions with time-stamp strings less than packtss are ommitted. As are all undone records. Also, data back pointers that point before packtss are resolved and the associated data are copied, sinc... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.