Commit dafabb41 authored by Chris McDonough's avatar Chris McDonough

Clean up formatting to 80 cols and add a restriction noting that BlobFiles...

Clean up formatting to 80 cols and add a restriction noting that BlobFiles can't live beyond the transaction in which their "open" call was invoked.
parent d3b088a7
Goal: Handle BLOBs (within the Zope context) better. Goal: Handle storage and retrieval of binary large objects efficiently,
transactionally, and transparently.
Measure: Measure:
...@@ -13,10 +14,13 @@ Measure: ...@@ -13,10 +14,13 @@ Measure:
Comments: Comments:
- Cache: BLOBs could be cached in a seperate "BLOB" space, e.g. in single files - Cache: BLOBs could be cached in a seperate "BLOB" space, e.g. in
single files
- Be storage independent? - Be storage independent?
- Memory efficiency: Storge.load() currently holds all data of an object in a string. - Memory efficiency: Storge.load() currently holds all data of an
object in a string.
Steps: Steps:
...@@ -36,30 +40,40 @@ Steps: ...@@ -36,30 +40,40 @@ Steps:
- complicated aspects - complicated aspects
- temporary files holding blob data could server as a
- temporary files holding blob data could server as a separated cache for blob data separated cache for blob data
- storage / zodb api change - storage / zodb api change
-
Restrictions: Restrictions:
- a particular BLOB instance can't be open for read _and_ write at the same time - a particular BLOB instance can't be open for read _and_ write at
the same time
- Allowed: N readers, no writers; 1 writer, no readers - Allowed: N readers, no writers; 1 writer, no readers
- Reason: - Reason:
- a writable filehandle opened via a BLOB's 'open' method has a
lifetime tied to the transaction in which the 'open' method was
called. We do this in order to prevent changes to blob data
from "bleeding over" between transactions.
- Data has been committed? -> File(name) for commited data available - Data has been committed? -> File(name) for commited data available
- .open("r") on fresh loaded blob returns committed data - .open("r") on fresh loaded blob returns committed data
- first .open("w") -> new empty file for uncommitted data - first .open("w") -> new empty file for uncommitted data
- .open("a") or .open("r+"), we copy existing data into file for uncommitted data
- if uncommitted data exists, subsequent .open("*") will use the uncommitted data - .open("a") or .open("r+"), we copy existing data into file for
- if opened for writing, the object is marked as changed (optimiziation possible) uncommitted data
- if uncommitted data exists, subsequent .open("*") will use the
uncommitted data
- if opened for writing, the object is marked as changed
(optimiziation possible)
- connections want to recognize blobs on transaction boundaries - connections want to recognize blobs on transaction boundaries
-
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