Ejemplo n.º 1
0
 def _packetAcked(self, packet, ownerID, packetID):
     from storage import backup_matrix
     backupID, blockNum, supplierNum, dataORparity = packetid.BidBnSnDp(packetID)
     backup_matrix.RemoteFileReport(
         backupID, blockNum, supplierNum, dataORparity, True)
     if ownerID not in self.statistic:
         self.statistic[ownerID] = [0, 0]
     self.statistic[ownerID][0] += 1
     self.automat('block-acked', (ownerID, packetID))
Ejemplo n.º 2
0
 def _packetFailed(self, remoteID, packetID, why):
     from storage import backup_matrix
     backupID, blockNum, supplierNum, dataORparity = packetid.BidBnSnDp(
         packetID)
     backup_matrix.RemoteFileReport(backupID, blockNum, supplierNum,
                                    dataORparity, False)
     if remoteID not in self.statistic:
         self.statistic[remoteID] = [0, 0]
     self.statistic[remoteID][1] += 1
     self.automat('block-failed', (remoteID, packetID))
Ejemplo n.º 3
0
 def _packetFailed(self, remoteID, packetID, why):
     from storage import backup_matrix
     backupID, blockNum, supplierNum, dataORparity = packetid.BidBnSnDp(
         packetID)
     backup_matrix.RemoteFileReport(backupID, blockNum, supplierNum,
                                    dataORparity, False)
     if remoteID not in self.statistic:
         self.statistic[remoteID] = {
             'acked': 0,
             'failed': 0,
             'latest': '',
         }
     self.statistic[remoteID]['failed'] += 1
     self.statistic[remoteID]['latest'] += '-'
     self.statistic[remoteID]['latest'] = self.statistic[remoteID][
         'latest'][-STAT_KEEP_LATEST_RESULTS_COUNT:]
     self.automat('block-failed', (remoteID, packetID))
Ejemplo n.º 4
0
 def _packetAcked(self, packet, ownerID, packetID):
     from storage import backup_matrix
     backupID, blockNum, supplierNum, dataORparity = packetid.BidBnSnDp(
         packetID)
     backup_matrix.RemoteFileReport(backupID, blockNum, supplierNum,
                                    dataORparity, True)
     if ownerID not in self.statistic:
         self.statistic[ownerID] = {
             'acked': 0,
             'failed': 0,
             'latest': '',
         }
     self.statistic[ownerID]['acked'] += 1
     self.statistic[ownerID]['latest'] += '+'
     self.statistic[ownerID]['latest'] = self.statistic[ownerID]['latest'][
         -STAT_KEEP_LATEST_RESULTS_COUNT:]
     self.automat('block-acked', (ownerID, packetID))