mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 15:28:34 +01:00
gc: choose which cache to process inside the drivers
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+5
-5
@@ -293,19 +293,19 @@ class Project(object):
|
||||
|
||||
def gc(self, all_branches=False):
|
||||
clist = self._used_cache(target=None, all_branches=all_branches)
|
||||
self.cache.local.gc(clist['local'])
|
||||
self.cache.local.gc(clist)
|
||||
|
||||
if self.cache.s3:
|
||||
self.cache.s3.gc(clist['s3'])
|
||||
self.cache.s3.gc(clist)
|
||||
|
||||
if self.cache.gs:
|
||||
self.cache.gs.gc(clist['gs'])
|
||||
self.cache.gs.gc(clist)
|
||||
|
||||
if self.cache.ssh:
|
||||
self.cache.ssh.gc(clist['ssh'])
|
||||
self.cache.ssh.gc(clist)
|
||||
|
||||
if self.cache.hdfs:
|
||||
self.cache.hdfs.gc(clist['hdfs'])
|
||||
self.cache.hdfs.gc(clist)
|
||||
|
||||
def push(self, target=None, jobs=1, remote=None, all_branches=False):
|
||||
self.cloud.push(self._used_cache(target, all_branches)['local'], jobs, remote=remote)
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ class RemoteGS(RemoteBase):
|
||||
return [self._path_to_etag(blob.name) for blob in blobs]
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos]
|
||||
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos['gs']]
|
||||
|
||||
for etag in self._all_etags():
|
||||
if etag in used_etags:
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ class RemoteHDFS(RemoteBase):
|
||||
return [self._path_to_checksum(path) for path in flist]
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_checksums = [info[self.PARAM_CHECKSUM] for info in checksum_infos]
|
||||
used_checksums = [info[self.PARAM_CHECKSUM] for info in checksum_infos['hdfs']]
|
||||
|
||||
for checksum in self._all_checksums():
|
||||
if checksum in used_checksums:
|
||||
|
||||
+1
-1
@@ -327,7 +327,7 @@ class RemoteLOCAL(RemoteBase):
|
||||
return collected, missing
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_md5s = [info[self.PARAM_MD5] for info in self._collect(checksum_infos)[0]]
|
||||
used_md5s = [info[self.PARAM_MD5] for info in self._collect(checksum_infos['local'])[0]]
|
||||
|
||||
for md5 in self.all():
|
||||
if md5 in used_md5s:
|
||||
|
||||
+1
-1
@@ -229,7 +229,7 @@ class RemoteS3(RemoteBase):
|
||||
return [self._path_to_etag(obj.key) for obj in objects]
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos]
|
||||
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos['s3']]
|
||||
|
||||
for etag in self._all():
|
||||
if etag in used_etags:
|
||||
|
||||
+1
-1
@@ -255,7 +255,7 @@ class RemoteSSH(RemoteBase):
|
||||
return [self._path_to_md5(path) for path in flist]
|
||||
|
||||
def gc(self, checksum_infos):
|
||||
used_md5s = [info[self.PARAM_MD5] for info in checksum_infos]
|
||||
used_md5s = [info[self.PARAM_MD5] for info in checksum_infos['ssh']]
|
||||
|
||||
for md5 in self._all_md5s():
|
||||
if md5 in used_md5s:
|
||||
|
||||
Reference in New Issue
Block a user