Revision a7b7a2c6 snf-pithos-backend/pithos/backends/lib/hashfiler/archipelagomapper.py
b/snf-pithos-backend/pithos/backends/lib/hashfiler/archipelagomapper.py | ||
---|---|---|
137 | 137 |
|
138 | 138 |
def map_retr_archipelago(self, maphash, size): |
139 | 139 |
"""Retrieve Archipelago mapfile""" |
140 |
hashes = [] |
|
140 | 141 |
ioctx = self.ioctx_pool.pool_get() |
141 | 142 |
maphash = maphash.split("archip:")[1] |
142 | 143 |
req = Request.get_mapr_request(ioctx, self.mapperd_port, maphash, |
... | ... | |
148 | 149 |
data = req.get_data(xseg_reply_map) |
149 | 150 |
Segsarray = xseg_reply_map_scatterlist * data.contents.cnt |
150 | 151 |
segs = Segsarray.from_address(ctypes.addressof(data.contents.segs)) |
152 |
hashes = [string_at(segs[idx].target, segs[idx].targetlen) |
|
153 |
for idx in xrange(len(segs))] |
|
151 | 154 |
req.put() |
152 | 155 |
else: |
153 | 156 |
req.put() |
154 | 157 |
self.ioctx_pool.pool_put(ioctx) |
155 | 158 |
raise Exception("Could not retrieve Archipelago mapfile.") |
156 | 159 |
self.ioctx_pool.pool_put(ioctx) |
157 |
return [string_at(segs[idx].target, segs[idx].targetlen) |
|
158 |
for idx in xrange(len(segs))] |
|
160 |
return hashes |
|
159 | 161 |
|
160 | 162 |
def map_stor(self, maphash, hashes=(), blkoff=0, create=1): |
161 | 163 |
"""Store hashes in the given hashes map.""" |
Also available in: Unified diff