Revision 29148653 snf-pithos-backend/pithos/backends/lib/hashfiler/radosblocker.py
b/snf-pithos-backend/pithos/backends/lib/hashfiler/radosblocker.py | ||
---|---|---|
37 | 37 |
|
38 | 38 |
from context_object import RadosObject, file_sync_read_chunks |
39 | 39 |
|
40 |
CEPH_CONF_FILE="/etc/ceph/ceph.conf" |
|
40 |
CEPH_CONF_FILE = "/etc/ceph/ceph.conf" |
|
41 |
|
|
41 | 42 |
|
42 | 43 |
class RadosBlocker(object): |
43 | 44 |
"""Blocker. |
... | ... | |
123 | 124 |
if not rbl: |
124 | 125 |
break |
125 | 126 |
for block in rbl.sync_read_chunks(blocksize, 1, 0): |
126 |
break # there should be just one block there |
|
127 |
break # there should be just one block there
|
|
127 | 128 |
if not block: |
128 | 129 |
break |
129 | 130 |
append(self._pad(block)) |
... | ... | |
138 | 139 |
""" |
139 | 140 |
block_hash = self.block_hash |
140 | 141 |
hashlist = [block_hash(b) for b in blocklist] |
141 |
mf = None
|
|
142 |
missing = [i for i, h in enumerate(hashlist) if not self._check_rear_block(h)]
|
|
142 |
missing = [i for i, h in enumerate(hashlist) if not
|
|
143 |
self._check_rear_block(h)]
|
|
143 | 144 |
for i in missing: |
144 | 145 |
with self._get_rear_block(hashlist[i], 1) as rbl: |
145 |
rbl.sync_write(blocklist[i]) #XXX: verify?
|
|
146 |
rbl.sync_write(blocklist[i]) # XXX: verify?
|
|
146 | 147 |
|
147 | 148 |
return hashlist, missing |
148 | 149 |
|
... | ... | |
202 | 203 |
sextend(sl) |
203 | 204 |
lastsize = len(block) |
204 | 205 |
|
205 |
size = (len(hashlist) -1) * blocksize + lastsize if hashlist else 0 |
|
206 |
size = (len(hashlist) - 1) * blocksize + lastsize if hashlist else 0
|
|
206 | 207 |
return size, hashlist, storedlist |
207 |
|
Also available in: Unified diff