Commit a9072290 authored by Kirill Smelkov's avatar Kirill Smelkov

bigfile/zodb: Clarify which stage .loadblkdata() and __{get,set}state__() do

All those functions move data between DB and ._v_blkdata and only master
then connects data to memory page. Make that fact explicit.
parent 0d8081c4
...@@ -55,8 +55,8 @@ class ZBlk(Persistent): ...@@ -55,8 +55,8 @@ class ZBlk(Persistent):
# NOTE _v_ - so that we can alter it without Persistent noticing -- we'll # NOTE _v_ - so that we can alter it without Persistent noticing -- we'll
# manage ZBlk states by ourselves explicitly. # manage ZBlk states by ourselves explicitly.
# client requests us to load blkdata from DB # client requests us to load blkdata from DB, which will then go to memory
# (DB -> ._v_blkdata -> memory-page) # DB -> ._v_blkdata (-> memory-page)
def loadblkdata(self): def loadblkdata(self):
# ensure ._v_blkdata is loaded # ensure ._v_blkdata is loaded
# (it could be not, if e.g. loadblk is called second time for the same # (it could be not, if e.g. loadblk is called second time for the same
...@@ -78,7 +78,7 @@ class ZBlk(Persistent): ...@@ -78,7 +78,7 @@ class ZBlk(Persistent):
# DB (through pickle) requests us to emit state to save # DB (through pickle) requests us to emit state to save
# (DB <- ._v_blkdata <- memory-page) # DB <- ._v_blkdata (<- memory-page)
def __getstate__(self): def __getstate__(self):
# request to pickle should go in only when zblk was set changed (by # request to pickle should go in only when zblk was set changed (by
# storeblk), and only once. # storeblk), and only once.
...@@ -103,6 +103,7 @@ class ZBlk(Persistent): ...@@ -103,6 +103,7 @@ class ZBlk(Persistent):
# DB (through pickle) loads data to memory # DB (through pickle) loads data to memory
# DB -> ._v_blkdata (-> memory-page)
def __setstate__(self, state): def __setstate__(self, state):
self._v_blkdata = state self._v_blkdata = state
self._v_zfile = None self._v_zfile = None
......
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