예제 #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)
예제 #2
0
파일: mapper.py 프로젝트: Erethon/synnefo
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)
예제 #3
0
 def __init__(self, **params):
     self.archip_map = ArchipelagoMapper(**params)
예제 #4
0
파일: mapper.py 프로젝트: Erethon/synnefo
 def __init__(self, **params):
     self.archip_map = ArchipelagoMapper(**params)