synccopy.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:blobxfer 作者: Azure 项目源码 文件源码
def __init__(self, src_ase, dst_ase, block_list, options, resume_mgr):
        # type: (Descriptior, blobxfer.models.azure.StorageEntity,
        #        blobxfer.models.azure.StorageEntity, list,
        #        blobxfer.models.options.SyncCopy,
        #        blobxfer.operations.resume.SyncCopyResumeManager) -> None
        """Ctor for Descriptor
        :param Descriptor self: this
        :param blobxfer.models.azure.StorageEntity src_ase:
            source Azure Storage Entity
        :param blobxfer.models.azure.StorageEntity dst_ase:
            destination Azure Storage Entity
        :param list block_list: source blob block list
        :param blobxfer.models.options.SyncCopy options: synccopy options
        :param blobxfer.operations.resume.SyncCopyResumeManager resume_mgr:
            synccopy resume manager
        """
        self._offset = 0
        self._chunk_num = 0
        self._finalized = False
        self._meta_lock = threading.Lock()
        self._resume_mgr = resume_mgr
        self._src_ase = src_ase
        self._dst_ase = dst_ase
        self._src_block_list = block_list
        self._chunk_size = self._compute_chunk_size()
        # calculate the total number of ops required for transfer
        self._total_chunks = self._compute_total_chunks(self._chunk_size)
        self._outstanding_ops = self._total_chunks
        if blobxfer.util.is_not_empty(self._dst_ase.replica_targets):
            self._outstanding_ops *= len(self._dst_ase.replica_targets) + 1
        if self._resume_mgr:
            self._completed_chunks = bitstring.BitArray(
                length=self._total_chunks)
            self._replica_counters = {}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号