Remove map call and estimate call

This commit is contained in:
Joseph Schorr 2014-09-29 15:33:26 -04:00
parent 746936ce66
commit 3d3f2dd6d7

View file

@ -58,9 +58,7 @@ def _import_format_generator(namespace, repository, tag, synthetic_image_id,
# Yield the merged layer data's header. # Yield the merged layer data's header.
estimated_file_size = 0 estimated_file_size = 0
for image in get_image_iterator(): for image in get_image_iterator():
estimated_file_size += (image.storage.uncompressed_size or estimated_file_size += image.storage.uncompressed_size
_get_mapped_size(image) or
_estimate_size(image))
yield _tar_file_header(synthetic_image_id + '/layer.tar', estimated_file_size) yield _tar_file_header(synthetic_image_id + '/layer.tar', estimated_file_size)
@ -128,13 +126,3 @@ def _tar_folder(name):
info = tarfile.TarInfo(name=name) info = tarfile.TarInfo(name=name)
info.type = tarfile.DIRTYPE info.type = tarfile.DIRTYPE
return info.tobuf() return info.tobuf()
def _get_mapped_size(image):
""" Returns a predefined image size for the given image or None if not found. """
return None
def _estimate_size(image):
""" Estimates a file size based on a heuristic. """
# More than 1 SD away from the size difference in the DB, as of 9/29/2014
return image.storage.image_size * 12