Feature #12400

arvados.Collection class should be able to calculate collection size

Added by Bryan Cosca 15 days ago.

Status:NewStart date:10/04/2017
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Story points-
Velocity based estimate-


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)
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