Exemplo n.º 1
0
class Mapper(object):
    """Mapper.
       Required constructor parameters: namelen.
    """
    def __init__(self, **params):
        self.archip_map = ArchipelagoMapper(**params)

    def map_retr(self, maphash, size):
        """Return as a list, part of the hashes map of an object
           at the given block offset.
           By default, return the whole hashes map.
        """
        return self.archip_map.map_retr(maphash, size)

    def map_stor(self, maphash, hashes, size, blocksize):
        """Store hashes in the given hashes map."""
        self.archip_map.map_stor(maphash, hashes, size, blocksize)
Exemplo n.º 2
0
class Mapper(object):
    """Mapper.
       Required constructor parameters: mappath, namelen.
       Optional mappool.
    """

    def __init__(self, **params):
        self.archip_map = ArchipelagoMapper(**params)

    def map_retr(self, maphash, size):
        """Return as a list, part of the hashes map of an object
           at the given block offset.
           By default, return the whole hashes map.
        """
        return self.archip_map.map_retr(maphash, size)

    def map_stor(self, maphash, hashes, size, blocksize):
        """Store hashes in the given hashes map."""
        self.archip_map.map_stor(maphash, hashes, size, blocksize)
Exemplo n.º 3
0
 def __init__(self, **params):
     self.archip_map = ArchipelagoMapper(**params)
Exemplo n.º 4
0
 def __init__(self, **params):
     self.archip_map = ArchipelagoMapper(**params)