Лимит на суммарный размер файлов
Bases: BaseFileLimit, FrozenModel
Limits the total size of files handled by onetl.file.file_downloader.file_downloader.FileDownloader or onetl.file.file_mover.file_mover.FileMover.
Calculates the sum of downloaded/moved files size (.stat().st_size),
and checks that this sum is less or equal to specified limit.
After limit is reached, no more files will be downloaded/moved.
Doesn't affect directories, paths without .stat() method or files with zero size.
Added in 0.13.0
Note
SI unit prefixes
means that 1KB == 1 kilobyte == 1000 bytes.
If you need 1024 bytes, use 1 KiB == 1 kibibyte.
Parameters
limit
Maximum total size of files to be handled. Can be an integer (bytes) or a string like 1GiB.
Examples
Create filter which allows to download/move files with total size up to 1GiB, but not higher:
from onetl.file.limit import MaxFilesCount
limit = TotalFilesSize("1GiB")
Source code in onetl/file/limit/total_files_size.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
is_reached
property
reset()
Source code in onetl/file/limit/total_files_size.py
64 65 66 | |
stops_at(path)
Source code in onetl/file/limit/total_files_size.py
68 69 70 71 72 73 74 75 76 77 78 79 80 | |