Beispiel #1
0
 def init_chunks(self):
     """Fetch a list of all object keys from repository
     """
     # Explicity set the initial hash table capacity to avoid performance issues
     # due to hash table "resonance"
     capacity = int(len(self.repository) * 1.2)
     self.chunks = ChunkIndex.create(os.path.join(self.tmpdir, 'chunks').encode('utf-8'), capacity=capacity)
     marker = None
     while True:
         result = self.repository.list(limit=10000, marker=marker)
         if not result:
             break
         marker = result[-1]
         for id_ in result:
             self.chunks[id_] = (0, 0, 0)
Beispiel #2
0
 def init_chunks(self):
     """Fetch a list of all object keys from repository
     """
     # Explicity set the initial hash table capacity to avoid performance issues
     # due to hash table "resonance"
     capacity = int(len(self.repository) * 1.2)
     self.chunks = ChunkIndex.create(os.path.join(self.tmpdir, 'chunks').encode('utf-8'), capacity=capacity)
     marker = None
     while True:
         result = self.repository.list(limit=10000, marker=marker)
         if not result:
             break
         marker = result[-1]
         for id_ in result:
             self.chunks[id_] = (0, 0, 0)