Exemplo n.º 1
0
 def add_check_and_repair(self, r, path):
     if not r:
         return  # non-distributed object, i.e. LIT file
     r = ICheckAndRepairResults(r)
     assert isinstance(path, (list, tuple))
     pre_repair = r.get_pre_repair_results()
     post_repair = r.get_post_repair_results()
     self.objects_checked += 1
     if pre_repair.is_healthy():
         self.objects_healthy += 1
     else:
         self.objects_unhealthy += 1
     if not pre_repair.is_recoverable():
         self.objects_unrecoverable += 1
     self.corrupt_shares.extend(pre_repair.get_corrupt_shares())
     if r.get_repair_attempted():
         self.repairs_attempted += 1
         if r.get_repair_successful():
             self.repairs_successful += 1
         else:
             self.repairs_unsuccessful += 1
     if post_repair.is_healthy():
         self.objects_healthy_post_repair += 1
     else:
         self.objects_unhealthy_post_repair += 1
     if not post_repair.is_recoverable():
         self.objects_unrecoverable_post_repair += 1
     self.all_results[tuple(path)] = r
     self.all_results_by_storage_index[r.get_storage_index()] = r
     self.corrupt_shares_post_repair.extend(
         post_repair.get_corrupt_shares())
Exemplo n.º 2
0
 def add_check_and_repair(self, r, path):
     if not r:
         return # non-distributed object, i.e. LIT file
     r = ICheckAndRepairResults(r)
     assert isinstance(path, (list, tuple))
     pre_repair = r.get_pre_repair_results()
     post_repair = r.get_post_repair_results()
     self.objects_checked += 1
     if pre_repair.is_healthy():
         self.objects_healthy += 1
     else:
         self.objects_unhealthy += 1
     if not pre_repair.is_recoverable():
         self.objects_unrecoverable += 1
     self.corrupt_shares.extend(pre_repair.get_data()["list-corrupt-shares"])
     if r.get_repair_attempted():
         self.repairs_attempted += 1
         if r.get_repair_successful():
             self.repairs_successful += 1
         else:
             self.repairs_unsuccessful += 1
     if post_repair.is_healthy():
         self.objects_healthy_post_repair += 1
     else:
         self.objects_unhealthy_post_repair += 1
     if not post_repair.is_recoverable():
         self.objects_unrecoverable_post_repair += 1
     self.all_results[tuple(path)] = r
     self.all_results_by_storage_index[r.get_storage_index()] = r
     self.corrupt_shares_post_repair.extend(post_repair.get_data()["list-corrupt-shares"])