Commit 3f77de54 authored by Christian Theune's avatar Christian Theune

- removed use of the word "DIRTY" for BlobStorage

 - replaced "DIRTY" with "LOADING" for ClientStorage
parent 2db8f91c
...@@ -35,7 +35,7 @@ from ZEO.Exceptions import ClientStorageError, ClientDisconnected, AuthError ...@@ -35,7 +35,7 @@ from ZEO.Exceptions import ClientStorageError, ClientDisconnected, AuthError
from ZEO.auth import get_module from ZEO.auth import get_module
from ZEO.zrpc.client import ConnectionManager from ZEO.zrpc.client import ConnectionManager
from ZODB.Blobs.BlobStorage import BLOB_SUFFIX, BLOB_DIRTY from ZODB.Blobs.BlobStorage import BLOB_SUFFIX
from ZODB import POSException from ZODB import POSException
from ZODB import utils from ZODB import utils
from ZODB.loglevels import BLATHER from ZODB.loglevels import BLATHER
...@@ -928,10 +928,10 @@ class ClientStorage(object): ...@@ -928,10 +928,10 @@ class ClientStorage(object):
utils.oid_repr(oid) utils.oid_repr(oid)
) )
def _getDirtyFilename(self, oid, serial): def _getLoadingFilename(self, oid, serial):
"""Generate an intermediate filename for two-phase commit. """Generate an intermediate filename for two-phase commit.
""" """
return self._getCleanFilename(oid, serial) + "." + BLOB_DIRTY return self._getCleanFilename(oid, serial) + ".loading"
def _getCleanFilename(self, oid, tid): def _getCleanFilename(self, oid, tid):
return os.path.join(self._getBlobPath(oid), return os.path.join(self._getBlobPath(oid),
...@@ -951,7 +951,7 @@ class ClientStorage(object): ...@@ -951,7 +951,7 @@ class ClientStorage(object):
# We write to a temporary file first, so we do not accidentally # We write to a temporary file first, so we do not accidentally
# allow half-baked copies of this blob be loaded # allow half-baked copies of this blob be loaded
tempfilename = self._getDirtyFilename(oid, serial) tempfilename = self._getLoadingFilename(oid, serial)
tempfile = open(tempfilename, "wb") tempfile = open(tempfilename, "wb")
offset = 0 offset = 0
......
...@@ -24,7 +24,6 @@ from ZODB.Blobs.interfaces import IBlobStorage, IBlob ...@@ -24,7 +24,6 @@ from ZODB.Blobs.interfaces import IBlobStorage, IBlob
from ZODB.POSException import POSKeyError from ZODB.POSException import POSKeyError
BLOB_SUFFIX = ".blob" BLOB_SUFFIX = ".blob"
BLOB_DIRTY = "store"
class BlobStorage(ProxyBase): class BlobStorage(ProxyBase):
"""A storage to support blobs.""" """A storage to support blobs."""
...@@ -209,10 +208,7 @@ class BlobStorage(ProxyBase): ...@@ -209,10 +208,7 @@ class BlobStorage(ProxyBase):
serial = filename[:-len(BLOB_SUFFIX)] serial = filename[:-len(BLOB_SUFFIX)]
oid = utils.repr_to_oid(oid) oid = utils.repr_to_oid(oid)
if serial != BLOB_DIRTY:
serial = utils.repr_to_oid(serial) serial = utils.repr_to_oid(serial)
else:
serial = None
return oid, serial return oid, serial
def undo(self, serial_id, transaction): def undo(self, serial_id, transaction):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment