Feature #12400

arvados.Collection class should be able to calculate collection size

Added by Bryan Cosca 2 months ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
-
Start date:
10/04/2017
Due date:
% Done:

0%

Estimated time:
Story points:
-

Description

from arvados/sdk/python/arvados/commands/put.py

def _collection_size(self, collection):
"""
Recursively get the total size of the collection
"""
size = 0
for item in listvalues(collection):
if isinstance(item, arvados.collection.Collection) or isinstance(item, arvados.collection.Subcollection):
size += self._collection_size(item)
else:
size += item.size()
return size

This returns the collection size, there should be a method in the Collection class that does the same thing.

Also available in: Atom PDF