in oss-torch-connector/osstorchconnector/_oss_tar_iterable.py [0:0]
def __init__(self, client: OssClient, tar_uri: str, tar_index_uri: str, preload: bool,
chunks: List[Tuple[int, int]] = []):
log.info("OssTarObjectsIterator init")
tar_bucket, tar_key = parse_oss_uri(tar_uri)
index_bucket, index_key = parse_oss_uri(tar_index_uri)
if tar_bucket != index_bucket:
raise ValueError("tar_uri and tar_index_uri must be in the same bucket")
starts = [start for start, _ in chunks] if chunks else []
sizes = [size for _, size in chunks] if chunks else []
self._list_stream = client.list_objects_from_tar(tar_bucket, tar_key, index_key, prefetch=preload,
chunks=starts, sizes=sizes)