Commit 7855a8f9 authored by Chrysostomos Nanakos's avatar Chrysostomos Nanakos
Browse files

pithos: Remove mapfile hexlification functionality

Until now Pithos was using unhexlified mapfiles but now
Archipelago transparently converts those mapfiles
to hexlified.
Mapper functions do not need to convert unhexlified mapfiles
to hexlified ones.
parent 41aeda06
......@@ -61,7 +61,7 @@ class ArchipelagoMapper(object):
hashes = ()
ioctx = self.ioctx_pool.pool_get()
req = Request.get_mapr_request(ioctx, self.mapperd_port,
hexlify(maphash), offset=0, size=size)
maphash, offset=0, size=size)
flags = req.get_flags()
flags |= XF_ASSUMEV0
req.set_flags(flags)
......@@ -80,12 +80,12 @@ class ArchipelagoMapper(object):
self.ioctx_pool.pool_put(ioctx)
raise Exception("Could not retrieve Archipelago mapfile.")
req = Request.get_close_request(ioctx, self.mapperd_port,
hexlify(maphash))
maphash)
req.submit()
req.wait()
ret = req.success()
if ret is False:
logger.warning("Could not close map %s" % hexlify(maphash))
logger.warning("Could not close map %s" % maphash)
pass
req.put()
self.ioctx_pool.pool_put(ioctx)
......@@ -99,7 +99,7 @@ class ArchipelagoMapper(object):
objects.append({'name': hexlify(h), 'flags': XF_MAPFLAG_READONLY})
ioctx = self.ioctx_pool.pool_get()
req = Request.get_create_request(ioctx, self.mapperd_port,
hexlify(maphash),
maphash,
mapflags=XF_MAPFLAG_READONLY,
objects=objects, blocksize=block_size,
size=size)
......@@ -109,6 +109,6 @@ class ArchipelagoMapper(object):
if ret is False:
req.put()
self.ioctx_pool.pool_put(ioctx)
raise IOError("Could not write map %s" % hexlify(maphash))
raise IOError("Could not write map %s" % maphash)
req.put()
self.ioctx_pool.pool_put(ioctx)
......@@ -32,6 +32,6 @@ class Mapper(object):
"""
return self.archip_map.map_retr(maphash, size)
def map_stor(self, maphash, hashes, blocksize, size):
def map_stor(self, maphash, hashes, size, blocksize):
"""Store hashes in the given hashes map."""
self.archip_map.map_stor(maphash, hashes, blocksize, size)
self.archip_map.map_stor(maphash, hashes, size, blocksize)
......@@ -1162,9 +1162,8 @@ class ModularBackend(BaseBackend):
hashmap = self._update_available(props)
return props[self.SIZE], [x for x in hashmap]
else:
hashmap = self.store.map_get(self._unhexlify_hash(
props[self.HASH]), props[self.SIZE])
return props[self.SIZE], [binascii.hexlify(x) for x in hashmap]
hashmap = self.store.map_get(props[self.HASH], props[self.SIZE])
return props[self.SIZE], [x for x in hashmap]
def _update_object_hash(self, user, account, container, name, size, type,
hash, checksum, domain, meta, replace_meta,
......
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