rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def f(con, m=m):
def f(con, m=m, attr=attr):
def f(con, m=m): t=getattr(con._cache,attr) m[0]=m[0]+t m[1]=m[1]+1
f39f2055e988ba1e3df76ad857609df20d581115 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f39f2055e988ba1e3df76ad857609df20d581115/DB.py
for oid in self._storage.undo(id): self.invalidate(oid)
storage=self._storage try: supportsTransactionalUndo = storage.supportsTransactionalUndo except AttributeError: supportsTransactionalUndo=0 else: supportsTransactionalUndo=supportsTransactionalUndo() if supportsTransactionalUndo: TransactionalUndo(self, id) else: for oid in storage.undo(id): self.invalidate(oid)
def undo(self, id): for oid in self._storage.undo(id): self.invalidate(oid)
f39f2055e988ba1e3df76ad857609df20d581115 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f39f2055e988ba1e3df76ad857609df20d581115/DB.py
waiting.append(self.unlock, ())
waiting.append((self.unlock, ()))
def tpc_begin(self, id, user, description, ext): t=self._transaction if t is not None: if id == t.id: return else: raise StorageServerError( "Multiple simultaneous tpc_begin requests from the same " "client." ) storage=self.__storage if storage._transaction is not None: try: waiting=storage.__waiting except: waiting=st...
1cbeec85c5ec39b56d29835456323835d2d10998 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/1cbeec85c5ec39b56d29835456323835d2d10998/StorageServer.py
waiting.append(self.try_again_sync, (id, user, description, ext))
waiting.append((self.try_again_sync, (id, user, description, ext)))
def tpc_begin_sync(self, id, user, description, ext): if self.__closed: return t=self._transaction if t is not None and id == t.id: return storage=self.__storage if storage._transaction is None: self.try_again_sync(id, user, description, ext) else: try: waiting=storage.__waiting except: waiting=storage.__waiting=[] wai...
1cbeec85c5ec39b56d29835456323835d2d10998 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/1cbeec85c5ec39b56d29835456323835d2d10998/StorageServer.py
print err
s = str(err) if s: s = ": " + s print err.__class__.__name__ + s
def main(): host = None port = None unix = None write = 1 storage = '1' try: opts, args = getopt.getopt(sys.argv[1:], 'p:h:U:S:1', ['nowrite']) for o, a in opts: if o == '-p': port = int(a) elif o == '-h': host = a elif o == '-U': unix = a elif o == '-S': storage = a elif o == '--nowrite': write = 0 elif o == '-1': ZEO...
6a1571aa798fc23c238b897615505076340ac2b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/6a1571aa798fc23c238b897615505076340ac2b8/zeoup.py
print err
s = str(err) if s: s = ": " + s print err.__class__.__name__ + s
def main(): host = None port = None unix = None write = 1 storage = '1' try: opts, args = getopt.getopt(sys.argv[1:], 'p:h:U:S:1', ['nowrite']) for o, a in opts: if o == '-p': port = int(a) elif o == '-h': host = a elif o == '-U': unix = a elif o == '-S': storage = a elif o == '--nowrite': write = 0 elif o == '-1': ZEO...
6a1571aa798fc23c238b897615505076340ac2b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/6a1571aa798fc23c238b897615505076340ac2b8/zeoup.py
POSException.StorageSystemError):
POSException.StorageSystemError):
def panic(message, *data): message=message%data LOG('ZODB FS',PANIC,"%s ERROR: %s\n" % (packed_version, message)) raise CorruptedTransactionError, message
a1627c9451718e079aa248014709b67064a035ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/a1627c9451718e079aa248014709b67064a035ce/FileStorage.py
def main(): ZEOInstanceBuilder().run() print "All done."
9b5a2a8823c7114b825ff01deb44dd0fdbd94775 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9b5a2a8823c7114b825ff01deb44dd0fdbd94775/mkzeoinst.py
home = args[0] if not os.path.isabs(home): home = os.path.abspath(home)
instance_home = args[0] if not os.path.isabs(instance_home): instance_home = os.path.abspath(instance_home) for entry in sys.path: if os.path.exists(os.path.join(entry, 'Zope')): zope_home = entry break else: print "Can't find the Zope home (not in sys.path)" sys.exit(2)
def run(self): try: opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) except getopt.error, msg: print msg sys.exit(2) program = os.path.basename(sys.argv[0]) if opts: # There's only the help options, so just dump some help: msg = __doc__ % {"program": program} print msg sys.exit() if len(args) not in [1, 2]: prin...
9b5a2a8823c7114b825ff01deb44dd0fdbd94775 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9b5a2a8823c7114b825ff01deb44dd0fdbd94775/mkzeoinst.py
params = self.get_params(home, port) self.create(home, params) def get_params(self, home, port):
params = self.get_params(zope_home, instance_home, port) self.create(instance_home, params) def get_params(self, zope_home, instance_home, port):
def run(self): try: opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) except getopt.error, msg: print msg sys.exit(2) program = os.path.basename(sys.argv[0]) if opts: # There's only the help options, so just dump some help: msg = __doc__ % {"program": program} print msg sys.exit() if len(args) not in [1, 2]: prin...
9b5a2a8823c7114b825ff01deb44dd0fdbd94775 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9b5a2a8823c7114b825ff01deb44dd0fdbd94775/mkzeoinst.py
"home": home,
"zope_home": zope_home, "instance_home": instance_home,
def get_params(self, home, port): return { "package": "zeo", "PACKAGE": "ZEO", "home": home, "port": port, "python": sys.executable, "server": which("runzeo.py"), "zdrun": which("zdrun.py"), "zdctl": which("zdctl.py"), }
9b5a2a8823c7114b825ff01deb44dd0fdbd94775 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9b5a2a8823c7114b825ff01deb44dd0fdbd94775/mkzeoinst.py
"server": which("runzeo.py"), "zdrun": which("zdrun.py"), "zdctl": which("zdctl.py"),
def get_params(self, home, port): return { "package": "zeo", "PACKAGE": "ZEO", "home": home, "port": port, "python": sys.executable, "server": which("runzeo.py"), "zdrun": which("zdrun.py"), "zdctl": which("zdctl.py"), }
9b5a2a8823c7114b825ff01deb44dd0fdbd94775 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9b5a2a8823c7114b825ff01deb44dd0fdbd94775/mkzeoinst.py
poll_fun = asyncore.poll
poll_fun = poll
def loop(timeout=30.0, use_poll=0, map=None): """Invoke asyncore mainloop This function functions like the regular asyncore.loop() function except that it also triggers ThreadedAsync callback functions before starting the loop. """ if use_poll: if hasattr(select, 'poll'): poll_fun = asyncore.poll3 else: poll_fun = asy...
0dc7ce85bb6b43173d62d343a0d78389c74a6922 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0dc7ce85bb6b43173d62d343a0d78389c74a6922/LoopCallback.py
name = str(self.storage)
name = str(storage)
def slog(storage, msg, level=zLOG.INFO, error=None, pid=os.getpid()): name = getattr(storage, '__name__', None) if name is None: name = str(self.storage) zLOG.LOG("ZEO Server:%s:%s" % (pid, name), level, msg, error=error)
e2f5a9f798e024c101241507d75b4bce10abd7e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e2f5a9f798e024c101241507d75b4bce10abd7e2/StorageServer.py
cserial, cdataptr, cver, cdata = self._undoDataInfo(
cserial, cdataptr, cdata, cver = self._undoDataInfo(
def _transactionalUndoRecord(self, oid, pos, serial, pre, version): """Get the indo information for a data record
95cb91701f7d86606224a80c504041b4cee33a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/95cb91701f7d86606224a80c504041b4cee33a74/FileStorage.py
def panic(message, *data): message=message%data LOG('ZODB FS',PANIC,"%s ERROR: %s\n" % (packed_version, message)) raise CorruptedTransactionError, message
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
class FileStorage: _packt=0 _transaction=None _serial=z64 def __init__(self, file_name, create=0, read_only=0, stop=None):
class FileStorage(BaseStorage.BaseStorage): _packt=z64 def __init__(self, file_name, create=0, read_only=0, stop=None, base=None):
def panic(message, *data): message=message%data LOG('ZODB FS',PANIC,"%s ERROR: %s\n" % (packed_version, message)) raise CorruptedTransactionError, message
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
self.__name__=file_name
BaseStorage.BaseStorage.__init__(self, file_name)
def __init__(self, file_name, create=0, read_only=0, stop=None):
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
self._index=index self._vindex=vindex self._tindex=tindex self._tvindex=tvindex self._indexpos=index.get self._vindexpos=vindex.get self._tappend=tindex.append l=bpthread.allocate_lock() self._a=l.acquire self._r=l.release l=bpthread.allocate_lock() self._ca=l.acquire self._cr=l.release
self._initIndex(index, vindex, tindex, tvindex) self._base=base
def __init__(self, file_name, create=0, read_only=0, stop=None):
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
return self.commitVersion(src, '', transaction, abort=1) def close(self): self._file.close() def commitVersion(self, src, dest, transaction, abort=None): if dest and abort: raise 'VersionCommitError', ( 'Internal error, can\'t abort to a version')
def abortVersion(self, src, transaction): # We are going to abort by simply storing back pointers.
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
self._a()
self._lock_acquire()
def abortVersion(self, src, transaction): # We are going to abort by simply storing back pointers.
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
srcpos=self._vindex.get(src, 0)
srcpos=self._vindex_get(src, 0)
def abortVersion(self, src, transaction): # We are going to abort by simply storing back pointers.
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
middle=p64(self._pos)+'\0'*10 here=tfile.tell()+self._pos+self._thl oids=[] appoids=oids.append while srcpos: seek(srcpos) h=read(58) oid=h[:8] if index[oid]==srcpos: tappend((oid,here)) appoids(oid) write(h[:16] + spos + middle + h[-16:-8]) here=here+50 spos=h[-8:] srcpos=u64(spos) self._tvindex[src]=0 return o...
def abortVersion(self, src, transaction): # We are going to abort by simply storing back pointers.
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
sd=p64(self._vindex.get(dest, 0))
sd=p64(self._vindex_get(dest, 0))
def commitVersion(self, src, dest, transaction): # We are going to commit by simply storing back pointers. if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._a() try: file=self._file read=file.read seek=file.seek tfile=self._tfile write=tfile.write tappend=sel...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
current_oids={} current=current_oids.has_key t=None tstatus=' '
def commitVersion(self, src, dest, transaction): # We are going to commit by simply storing back pointers. if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._a() try: file=self._file read=file.read seek=file.seek tfile=self._tfile write=tfile.write tappend=sel...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
write(h[-16:-8]+sd+dest)
write(pnv+sd+dest)
def commitVersion(self, src, dest, transaction): # We are going to commit by simply storing back pointers. if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._a() try: file=self._file read=file.read seek=file.seek tfile=self._tfile write=tfile.write tappend=sel...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
write(spos)
write(abort and pnv or spos)
def commitVersion(self, src, dest, transaction): # We are going to commit by simply storing back pointers. if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._a() try: file=self._file read=file.read seek=file.seek tfile=self._tfile write=tfile.write tappend=sel...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
tvindex[src]=0
def commitVersion(self, src, dest, transaction): # We are going to commit by simply storing back pointers. if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._a() try: file=self._file read=file.read seek=file.seek tfile=self._tfile write=tfile.write tappend=sel...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
finally: self._r() def getName(self): return self.__name__
finally: self._lock_release()
def commitVersion(self, src, dest, transaction): # We are going to commit by simply storing back pointers. if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._a() try: file=self._file read=file.read seek=file.seek tfile=self._tfile write=tfile.write tappend=sel...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
def history(self, oid, version, length=1): pass
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: file.seek(16,1) version=read(vlen) else: version='' if plen != z64: return read(u64(plen)), version return _loadB...
def getSize(self): return self._pos
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
self._a()
self._lock_acquire()
def load(self, oid, version, _stuff=None): self._a() try: pos=self._index[oid] file=self._file 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(...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
pos=self._index[oid] file=self._file 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) if (not version or len(version) != vlen or (read(8) and version != read(vlen)) ): return _loadBack(file, oid, pnv) ...
try: return self._load(oid, version, self._index, self._file) except: if self._base is not None: return self._base.load(oid, version) raise finally: self._lock_release()
def load(self, oid, version, _stuff=None): self._a() try: pos=self._index[oid] file=self._file 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(...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
self._a()
self._lock_acquire()
def modifiedInVersion(self, oid): self._a() try: pos=self._index[oid] file=self._file seek=file.seek seek(pos) doid,serial,prev,tloc,vlen = unpack(">8s8s8s8sH", file.read(34)) if doid != oid: raise CorruptedDataError, h if vlen: seek(24,1) # skip plen, pnv, and pv return file.read(vlen) return '' finally: self._r()
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
finally: self._r() def new_oid(self, last=None): if last is None: self._a() try: last=self._oid d=ord(last[-1]) if d < 255: last=last[:-1]+chr(d+1) else: last=self.new_oid(last[:-1]) self._oid=last return last finally: self._r() else: d=ord(last[-1]) if d < 255: return last[:-1]+chr(d+1)+'\0'*(8-len(last)) else:...
finally: self._lock_release()
def modifiedInVersion(self, oid): self._a() try: pos=self._index[oid] file=self._file seek=file.seek seek(pos) doid,serial,prev,tloc,vlen = unpack(">8s8s8s8sH", file.read(34)) if doid != oid: raise CorruptedDataError, h if vlen: seek(24,1) # skip plen, pnv, and pv return file.read(vlen) return '' finally: self._r()
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
self._a()
self._lock_acquire()
def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction)
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
old=self._indexpos(oid, 0)
old=self._index_get(oid, 0)
def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction)
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
pv=tvindex.get(version, 0) or self._vindexpos(version, 0)
pv=tvindex.get(version, 0) or self._vindex_get(version, 0)
def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction)
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
finally: self._r() def registerDB(self, db, limit): pass def supportsUndo(self): return 0
finally: self._lock_release() def supportsUndo(self): return 1
def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction)
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
def tpc_abort(self, transaction): self._a()
def _clear_temp(self): del self._tindex[:] self._tvindex.clear() self._tfile.seek(0) def _begin(self, tid, u, d, e): self._thl=23+len(u)+len(d)+len(e) def _finish(self, tid, u, d, e): file=self._file write=file.write tfile=self._tfile dlen=tfile.tell() tfile.seek(0) id=self._serial user, desc, ext = self._ude tlen=...
def supportsVersions(self): return 1
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
if transaction is not self._transaction: return del self._tindex[:] self._transaction=None self._cr() finally: self._r() def tpc_begin(self, transaction): self._a() try: if self._transaction is transaction: return self._r() self._ca() self._a() self._transaction=transaction del self._tindex[:] self._tvindex.clear() se...
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 maintenance.<p>')
def tpc_abort(self, transaction): self._a() try: if transaction is not self._transaction: return del self._tindex[:] self._transaction=None self._cr() finally: self._r()
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
indexpos=self._indexpos
index_get=self._index_get
def undo(self, transaction_id): self._a() try: file=self._file seek=file.seek read=file.read indexpos=self._indexpos unpack=struct.unpack transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) seek(tpos) h=read(23) if len(h) != 23 or h[:8] != tid: raise UndoErr...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:])
def undo(self, transaction_id): self._a() try: file=self._file seek=file.seek read=file.read indexpos=self._indexpos unpack=struct.unpack transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) seek(tpos) h=read(23) if len(h) != 23 or h[:8] != tid: raise UndoErr...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
t=[] tappend=t.append
t={}
def undo(self, transaction_id): self._a() try: file=self._file seek=file.seek read=file.read indexpos=self._indexpos unpack=struct.unpack transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) seek(tpos) h=read(23) if len(h) != 23 or h[:8] != tid: raise UndoErr...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
if indexpos(oid,0) != pos:
if index_get(oid,0) != pos:
def undo(self, transaction_id): self._a() try: file=self._file seek=file.seek read=file.read indexpos=self._indexpos unpack=struct.unpack transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) seek(tpos) h=read(23) if len(h) != 23 or h[:8] != tid: raise UndoErr...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
tappend((oid,prev))
t[oid]=prev
def undo(self, transaction_id): self._a() try: file=self._file seek=file.seek read=file.read indexpos=self._indexpos unpack=struct.unpack transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) seek(tpos) h=read(23) if len(h) != 23 or h[:8] != tid: raise UndoErr...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
for oid, pos in t: index[oid]=pos finally: self._r()
for oid, pos in t.items(): index[oid]=pos return t.keys() finally: self._lock_release()
def undo(self, transaction_id): self._a() try: file=self._file seek=file.seek read=file.read indexpos=self._indexpos unpack=struct.unpack transaction_id=base64.decodestring(transaction_id+'==\n') tid, tpos = transaction_id[:8], u64(transaction_id[8:]) seek(tpos) h=read(23) if len(h) != 23 or h[:8] != tid: raise UndoErr...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
self._a()
self._lock_acquire()
def undoLog(self, first, last, filter=None): self._a() try: pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unpack strip=string.strip encode=base64.encodestring r=[] append=r.append i=0 while i < last and pos > 39: seek(pos-8) pos=pos-u64(read(8))-8 if i < first: continu...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
finally: self._r()
finally: self._lock_release()
def undoLog(self, first, last, filter=None): self._a() try: pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unpack strip=string.strip encode=base64.encodestring r=[] append=r.append i=0 while i < last and pos > 39: seek(pos-8) pos=pos-u64(read(8))-8 if i < first: continu...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
return not self._vindex.get(version, 0)
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) tloc=h[16:24] if t != tloc: t=tloc seek(u64(t)+16) tstatus=read(1) if tstatus != 'u': return 1...
def versionEmpty(self, version): return not self._vindex.get(version, 0)
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
if max: return self._vindex.keys()[:max] return self._vindex.keys()
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 return r 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...
def versions(self, max=None): if max: return self._vindex.keys()[:max] return self._vindex.keys()
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
indexpos=index.get
index_get=index.get
def read_index(file, name, index, vindex, tindex, stop='\377'*8): indexpos=index.get vndexpos=vindex.get tappend=tindex.append read=file.read seek=file.seek seek(0,2) file_size=file.tell() seek(0) if file_size: if file_size < 4: raise FileStorageFormatError, file.name if read(4) != packed_version: raise FileStorageFor...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
pos=tpos+tl seek(pos)
seek(tend)
def read_index(file, name, index, vindex, tindex, stop='\377'*8): indexpos=index.get vndexpos=vindex.get tappend=tindex.append read=file.read seek=file.seek seek(0,2) file_size=file.tell() seek(0) if file_size: if file_size < 4: raise FileStorageFormatError, file.name if read(4) != packed_version: raise FileStorageFor...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
pos=pos+8
pos=tend+8
def read_index(file, name, index, vindex, tindex, stop='\377'*8): indexpos=index.get vndexpos=vindex.get tappend=tindex.append read=file.read seek=file.seek seek(0,2) file_size=file.tell() seek(0) if file_size: if file_size < 4: raise FileStorageFormatError, file.name if read(4) != packed_version: raise FileStorageFor...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
if indexpos(oid,0) != prev:
if index_get(oid,0) != prev:
def read_index(file, name, index, vindex, tindex, stop='\377'*8): indexpos=index.get vndexpos=vindex.get tappend=tindex.append read=file.read seek=file.seek seek(0,2) file_size=file.tell() seek(0) if file_size: if file_size < 4: raise FileStorageFormatError, file.name if read(4) != packed_version: raise FileStorageFor...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
def _loadBack(file, oid, back): seek=file.seek read=file.read while 1: old=u64(back) if not old: raise KeyError, oid seek(old) h=read(42) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) #if doid != oid: # panic(lambda x: None, # "%s version record back pointer points to " # "invalid re...
c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py
pos = 4
pos = 4L
def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print "Recovering", inp, "into", outp if os.path.exists(outp) and not force: die("%s exists" % outp) f = open(inp, "rb") if f.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") f.seek(0,2) file_size = f.tell() ofs = ZODB.File...
21058f0d29a3ec9524eb6649b4d14c7de7577dc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/21058f0d29a3ec9524eb6649b4d14c7de7577dc0/fsrecover.py
"src/ZEO/runzeo.py", "src/ZEO/zeopasswd.py", "src/ZEO/mkzeoinst.py", "src/ZEO/zeoctl.py",
def BTreeExtension(flavor): key = flavor[0] value = flavor[1] name = "BTrees._%sBTree" % flavor sources = ["src/BTrees/_%sBTree.c" % flavor] kwargs = {"include_dirs": include} if flavor != "fs": kwargs["depends"] = (base_btrees_depends + [KEY_H % _flavors[key], VALUE_H % _flavors[value]]) if key != "O": kwargs["define_...
e20e5b29b38a7d2eabb133c25cef38e5c5a8e01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e20e5b29b38a7d2eabb133c25cef38e5c5a8e01f/setup.py
self.strategy.tpc_abort()
strategy = self.strategy strategy.tpc_abort()
def tpc_abort(self, id): if not self._check_tid(id): return self.strategy.tpc_abort() self._transaction = None self.strategy = None self._handle_waiting()
f89b404bcec6e43c49a946f2141591dce1efa810 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f89b404bcec6e43c49a946f2141591dce1efa810/StorageServer.py
self._handle_waiting()
if isinstance(strategy, ImmediateCommitStrategy): self._handle_waiting()
def tpc_abort(self, id): if not self._check_tid(id): return self.strategy.tpc_abort() self._transaction = None self.strategy = None self._handle_waiting()
f89b404bcec6e43c49a946f2141591dce1efa810 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f89b404bcec6e43c49a946f2141591dce1efa810/StorageServer.py
'opened': c._opened and ctime(c._opened),
'opened': o and ("%s (%.2fs)" % (ctime(o), t-o)),
def connectionDebugInfo(self): r=[] pools,pooll=self._pools for version, (pool, allocated, lock) in pools.items(): for c in allocated: r.append({ 'opened': c._opened and ctime(c._opened), 'info': c._debug_info, 'version': version, }) return r
cfccb5da10708611bb5d1c6bd1ffe70f9d09cb98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/cfccb5da10708611bb5d1c6bd1ffe70f9d09cb98/DB.py
class ISized(ICollection): def __len__(): """Return the number of items in the set""" class IReadSequence(Interface.Base): def __getitem__(index): """Return an item for a given index."""
class IReadSequence(Interface.Standard.Sequence):
def __nonzero__(): """Check if the collection is non-empty.
70f54df688f1f24815738cc3f414b25689a001b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/70f54df688f1f24815738cc3f414b25689a001b5/Interfaces.py
class IKeySequence(IKeyed, ISized):
class IKeySequence(IKeyed, Interface.Standard.Sized):
def update(seq): """Add the items from the given sequence to the set"""
70f54df688f1f24815738cc3f414b25689a001b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/70f54df688f1f24815738cc3f414b25689a001b5/Interfaces.py
class IDictionaryIsh(IKeyed, ISized): def __getitem__(key): """Get the value for the given key Raise a key error if the key if not in the collection. """ def get(key, default=None): """Get the value for the given key Raise a key error if the key if not in the collection and no default is specified. Return the defa...
class IDictionaryIsh(IKeyed, Interface.Standard.MinimalDictionary):
def __getitem__(index): """Return the key in the given index position
70f54df688f1f24815738cc3f414b25689a001b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/70f54df688f1f24815738cc3f414b25689a001b5/Interfaces.py
class IMerge(Interfaces.Base):
class IMerge(Interface.Base):
def insert(key, value): """Insert a key and value into the collection.
70f54df688f1f24815738cc3f414b25689a001b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/70f54df688f1f24815738cc3f414b25689a001b5/Interfaces.py
Interface.assertTypeImplements(OOBTree.OOSet, ISet) Interface.assertTypeImplements(OOBTree.OOTreeSet, ITreeSet) Interface.assertTypeImplements(OOBTree.OOBucket, IDictionaryIsh) Interface.assertTypeImplements(OOBTree.OOBTree, IBTree)
OOBTree.OOSet.__implements__=ISet OOBTree.OOTreeSet.__implements__=ITreeSet OOBTree.OOBucket.__implements__=IDictionaryIsh OOBTree.OOBTree.__implements__=IBTree
def weightedIntersection(c1, c2, weight1=1, weight2=1): """Compute the weighted intersection of c1 and c2.
70f54df688f1f24815738cc3f414b25689a001b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/70f54df688f1f24815738cc3f414b25689a001b5/Interfaces.py
class FileStorageError: pass class FileStorageFormatError(FileStorageError, POSException.StorageError):
class FileStorageError(POSException.StorageError): pass class FileStorageFormatError(FileStorageError):
def panic(message, *data): message=message%data LOG('ZODB FS',PANIC,"%s ERROR: %s\n" % (packed_version, message)) raise CorruptedTransactionError, message
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/FileStorage.py
file.seek(16,1)
nv = read(8) != z64 file.seek(8,1)
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: file.seek(16,1) version=read(vlen) else: version=''
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/FileStorage.py
if plen != z64: return read(u64(plen)), version return _loadBack(file, oid, read(8))[0], version
nv=0 if plen != z64: return read(u64(plen)), version, nv return _loadBack(file, oid, read(8))[0], 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: file.seek(16,1) version=read(vlen) else: version=''
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/FileStorage.py
p, v = _loada(oid, index, file)
p, v, nv = _loada(oid, index, file)
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...
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/FileStorage.py
if v:
if nv:
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...
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/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...
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/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...
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/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...
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/FileStorage.py
def read_index(file, name, index, vindex, tindex, stop='\377'*8): index_get=index.get vndexpos=vindex.get tappend=tindex.append read=file.read seek=file.seek seek(0,2) file_size=file.tell() seek(0) if file_size: if file_size < 4: raise FileStorageFormatError, file.name if read(4) != packed_version: raise FileStorageFo...
3dc5f44ee6e70343dff189bf1cbf55c6b0274821 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3dc5f44ee6e70343dff189bf1cbf55c6b0274821/FileStorage.py
def _bad_message(self, msg): # Establish a connection, then send the server an ill-formatted # request. Verify that the connection is closed and that it is # possible to establish a new connection.
19f15f097171914c9041f6030a78776a815d9a67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/19f15f097171914c9041f6030a78776a815d9a67/ConnectionTests.py
def checkMultiStorageTransaction(self):
def NOcheckMultiStorageTransaction(self):
def checkMultiStorageTransaction(self): # Configuration parameters (larger values mean more likely deadlocks) N = 2 # These don't *have* to be all the same, but it's convenient this way self.nservers = N self.nthreads = N self.ntrans = N self.nobj = N
19f15f097171914c9041f6030a78776a815d9a67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/19f15f097171914c9041f6030a78776a815d9a67/ConnectionTests.py
if verbose:
if verbose or code in (0x00, 0x70):
def main(): # Parse options verbose = 0 dostats = 1 try: opts, args = getopt.getopt(sys.argv[1:], "vS") except getopt.error, msg: usage(msg) return 2 for o, a in opts: if o == "-v": verbose = 1 if o == "-S": dostats = 0 verbose = 1 if len(args) != 1: usage("exactly one file argument required") return 2 filename = args[...
7dd84cc1ddfee84a8c28768c379062ad59fe02e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7dd84cc1ddfee84a8c28768c379062ad59fe02e6/stats.py
if verbose: print
print
def main(): # Parse options verbose = 0 dostats = 1 try: opts, args = getopt.getopt(sys.argv[1:], "vS") except getopt.error, msg: usage(msg) return 2 for o, a in opts: if o == "-v": verbose = 1 if o == "-S": dostats = 0 verbose = 1 if len(args) != 1: usage("exactly one file argument required") return 2 filename = args[...
7dd84cc1ddfee84a8c28768c379062ad59fe02e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7dd84cc1ddfee84a8c28768c379062ad59fe02e6/stats.py
h, v = unpack(">II", s)
h, v = struct.unpack(">II", s)
def U64(s): h, v = unpack(">II", s) return (long(h) << 32) + v
7dd84cc1ddfee84a8c28768c379062ad59fe02e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7dd84cc1ddfee84a8c28768c379062ad59fe02e6/stats.py
s.connect(('', 42000))
s.connect(('localhost', 42000))
def get_monitor_output(self): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('', 42000)) L = [] while 1: buf = s.recv(8192) if buf: L.append(buf) else: break s.close() return "".join(L)
3b6a81109ca7cbe2d26943e0ff06eb086a004592 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3b6a81109ca7cbe2d26943e0ff06eb086a004592/testMonitor.py
consider the int() of this valua to be significant.
consider the int() of this value to be significant.
def LOG(subsystem, severity, summary, detail='', error=None, reraise=None): """Log some information The required arguments are: subsystem -- The subsystem generating the message (e.g. ZODB) severity -- The "severity" of the event. This may be an integer or a floating point number. Logging back ends may consider th...
3fcd20bdd4b6720f2520d2772d1b7acd432a2460 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3fcd20bdd4b6720f2520d2772d1b7acd432a2460/__init__.py
"""Insert a key and value into the colelction.
"""Insert a key and value into the collection.
def insert(key, value): """Insert a key and value into the colelction.
aeab8c93a7c0a5bda69374c81d8b24424f026a2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/aeab8c93a7c0a5bda69374c81d8b24424f026a2b/Interfaces.py
zLOG.LOG('ZEO Server', zLOG.INFO, 'Serving %s:\t%s' % kv)
LOG('ZEO Server', INFO, 'Serving %s:\t%s' % kv)
def handler(signum, frame, storages=storages, die=signal.SIGTERM): for storage in storages.values(): try: storage.close() finally: pass if signum==dir: sys.exit(0) else: sys.exit(1)
b57d55e2f6e81d57914c84317992c5405ddd644c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b57d55e2f6e81d57914c84317992c5405ddd644c/start.py
auth_filename=self.options.auth_database,
auth_database=self.options.auth_database,
def create_server(self): from ZEO.StorageServer import StorageServer self.server = StorageServer( self.options.address, self.storages, read_only=self.options.read_only, invalidation_queue_size=self.options.invalidation_queue_size, transaction_timeout=self.options.transaction_timeout, monitor_address=self.options.monito...
220b5ca0ff1822ae49d0ad8dc03e72b825f12944 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/220b5ca0ff1822ae49d0ad8dc03e72b825f12944/runzeo.py
def testReadConflictIgnored(self):
def checkReadConflictIgnored(self):
def testReadConflictIgnored(self): # Test that an application that catches a read conflict and # continues can not commit the transaction later. root = self._db.open().root() root["real_data"] = real_data = PersistentDict() root["index"] = index = PersistentDict()
b196e7d1cc01a98bb2538b5a1fbab66e345f00a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b196e7d1cc01a98bb2538b5a1fbab66e345f00a0/testZODB.py
root["real_data"] = real_data = PersistentDict() root["index"] = index = PersistentDict() real_data["a"] = PersistentDict({"indexed_value": 0}) real_data["b"] = PersistentDict({"indexed_value": 1}) index[1] = PersistentDict({"b": 1}) index[0] = PersistentDict({"a": 1})
root["real_data"] = real_data = PersistentMapping() root["index"] = index = PersistentMapping() real_data["a"] = PersistentMapping({"indexed_value": 0}) real_data["b"] = PersistentMapping({"indexed_value": 1}) index[1] = PersistentMapping({"b": 1}) index[0] = PersistentMapping({"a": 1})
def testReadConflictIgnored(self): # Test that an application that catches a read conflict and # continues can not commit the transaction later. root = self._db.open().root() root["real_data"] = real_data = PersistentDict() root["index"] = index = PersistentDict()
b196e7d1cc01a98bb2538b5a1fbab66e345f00a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b196e7d1cc01a98bb2538b5a1fbab66e345f00a0/testZODB.py
cn2.getTransaction().commit()
get_transaction().commit()
def testReadConflictIgnored(self): # Test that an application that catches a read conflict and # continues can not commit the transaction later. root = self._db.open().root() root["real_data"] = real_data = PersistentDict() root["index"] = index = PersistentDict()
b196e7d1cc01a98bb2538b5a1fbab66e345f00a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b196e7d1cc01a98bb2538b5a1fbab66e345f00a0/testZODB.py
self.assertRaises(ConflictError, get_transaction().commit)
self.assertRaises(ConflictError, cn2.getTransaction().commit)
def testReadConflictIgnored(self): # Test that an application that catches a read conflict and # continues can not commit the transaction later. root = self._db.open().root() root["real_data"] = real_data = PersistentDict() root["index"] = index = PersistentDict()
b196e7d1cc01a98bb2538b5a1fbab66e345f00a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b196e7d1cc01a98bb2538b5a1fbab66e345f00a0/testZODB.py
self.sub1._p_jar = SubTransactionJar(errors='tpc_finish') self.nosub1.modify() self.sub1.modify(nojar=1)
for sub in self.sub1, self.sub2: sub._p_jar = SubTransactionJar(errors='tpc_finish') sub.modify(nojar=1) self.nosub1.modify()
def testExceptionInTpcFinish(self):
87b49138068d7b09413d83d983876ec44c830b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/87b49138068d7b09413d83d983876ec44c830b2a/testTransaction.py
self.sub1._p_jar = SubTransactionJar(errors='tpc_finish') self.nosub1.modify() self.sub1.modify(nojar=1)
for sub in self.sub1, self.sub2: sub._p_jar = SubTransactionJar(errors='tpc_finish') sub.modify(nojar=1) self.nosub1.modify()
def testHoserStoppage(self):
87b49138068d7b09413d83d983876ec44c830b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/87b49138068d7b09413d83d983876ec44c830b2a/testTransaction.py
has_mac = 0
def handle_read(self): self.__input_lock.acquire() try: # Use a single __inp buffer and integer indexes to make this fast. try: d = self.recv(8192) except socket.error, err: if err[0] in expected_socket_read_errors: return raise if not d: return
a0d97c9c0701a12df8ea85991da665028dda979f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/a0d97c9c0701a12df8ea85991da665028dda979f/smac.py
self.locked = True
self.locked = 1
def pack(self): # Pack copies all data reachable at the pack time or later. # # Copying occurs in two phases. In the first phase, txns # before the pack time are copied if the contain any reachable # data. In the second phase, all txns after the pack time # are copied. # # Txn and data records contain pointers to pre...
41713b26e7d5b49ec6bf01be485f3d5c731feb7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/41713b26e7d5b49ec6bf01be485f3d5c731feb7c/fspack.py
(self.tid, length, self.status, self.user_len, self.descr_len,
(self.tid, self.length, self.status, self.user_len, self.descr_len,
def _read_header(self): self._file.seek(self._pos) self._hdr = self._file.read(TRANS_HDR_LEN) (self.tid, length, self.status, self.user_len, self.descr_len, self.ext_len) = struct.unpack(TRANS_HDR, self._hdr) self.length = u64(length)
52dc3a30671c23470e83304f3c1c8091af606f30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/52dc3a30671c23470e83304f3c1c8091af606f30/fstools.py
self.length = u64(length)
def _read_header(self): self._file.seek(self._pos) self._hdr = self._file.read(TRANS_HDR_LEN) (self.tid, length, self.status, self.user_len, self.descr_len, self.ext_len) = struct.unpack(TRANS_HDR, self._hdr) self.length = u64(length)
52dc3a30671c23470e83304f3c1c8091af606f30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/52dc3a30671c23470e83304f3c1c8091af606f30/fstools.py
def main():
def test_suite():
def main(): TIOBTree = makeSuite(TestIOBTrees, 'test') TOOBTree = makeSuite(TestOOBTrees, 'test') TOIBTree = makeSuite(TestOIBTrees, 'test') TIIBTree = makeSuite(TestIIBTrees, 'test') TIOSet = makeSuite(TestIOSets, 'test') TOOSet = makeSuite(TestOOSets, 'test') TOISet = makeSuite(TestIOSets, 'test') TIISet = makeSuite...
11d192345cbe0fbfc32322caad074a329978e352 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/11d192345cbe0fbfc32322caad074a329978e352/testBTrees.py
l = filter(lambda x, l1=l1: x not in l1, l2) l = l + filter(lambda x, l2=l2: x not in l2, l1) return l
l1=list(l1) l2=list(l2) l = filter(lambda x, l1=l1: x not in l1, l2) l = l + filter(lambda x, l2=l2: x not in l2, l1) return l
def lsubtract(l1, l2): l = filter(lambda x, l1=l1: x not in l1, l2) l = l + filter(lambda x, l2=l2: x not in l2, l1) return l
11d192345cbe0fbfc32322caad074a329978e352 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/11d192345cbe0fbfc32322caad074a329978e352/testBTrees.py
if __name__ == '__main__': main()
if __name__=='__main__': if len(sys.argv) > 1: globals()[sys.argv[1]]() else: main()
def realseq(itemsob): return map(lambda x: x, itemsob)
11d192345cbe0fbfc32322caad074a329978e352 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/11d192345cbe0fbfc32322caad074a329978e352/testBTrees.py
assert root['t'] == t
assert list(root['t'].items()) == list(t.items())
def testLoadAndStore(self): t = self.t try: root = self._getRoot() root['t'] = t get_transaction().commit() except: self._closeDB(root) self._delDB() raise
5e23fe69eee7bf646e82443419dcdf4b156da2cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5e23fe69eee7bf646e82443419dcdf4b156da2cc/testBTrees.py
assert root['t'] == t
assert list(root['t'].items()) == list(t.items())
def testGhostUnghost(self): t = self.t try: root = self._getRoot() root['t'] = t get_transaction().commit() except: self._closeDB(root) self._delDB() raise
5e23fe69eee7bf646e82443419dcdf4b156da2cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5e23fe69eee7bf646e82443419dcdf4b156da2cc/testBTrees.py
assert len(t) == 1000, len(t)
assert len(t) == 10000, len(t)
def testLen(self): # should sets know their length? t = self.t r = xrange(10000) for x in r: t.insert(x) assert len(t) == 1000, len(t)
5e23fe69eee7bf646e82443419dcdf4b156da2cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5e23fe69eee7bf646e82443419dcdf4b156da2cc/testBTrees.py