mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-19 15:28:28 +01:00
remote: add comments for s3/azure exists() method
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+2
-1
@@ -137,7 +137,8 @@ class RemoteAzure(RemoteBase):
|
||||
} for md5 in md5s]
|
||||
|
||||
def exists(self, path_infos):
|
||||
# TODO: why does S3 fetch all blobs first?
|
||||
# TODO: check whether per-key exists() is faster than listing all
|
||||
# objects altogether.
|
||||
ret = []
|
||||
|
||||
for path_info in path_infos:
|
||||
|
||||
@@ -119,6 +119,10 @@ class RemoteS3(RemoteBase):
|
||||
'key': posixpath.join(self.prefix, md5[0:2], md5[2:])} for md5 in md5s]
|
||||
|
||||
def exists(self, path_infos):
|
||||
# NOTE: We mostly use exists() method when filtering a bulk of cache
|
||||
# files to decide if we need to download/upload them and in s3
|
||||
# list_objects_v2() is much-much faster than trying to check keys
|
||||
# one-by-one.
|
||||
ret = []
|
||||
session = boto3.session.Session()
|
||||
s3 = session.client('s3')
|
||||
|
||||
Reference in New Issue
Block a user