Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This class implements the basic QuotaManager API for the Google Cloud Storage backend. (Note the SubmissionInfo.quota_manager method is currently broken for GCS - and always has been, since GCS was introduced.) Note that GCS doesn't (as far as I know) provide any way to limit the storage usage of a bucket or a project, let alone the usage of a particular prefix within a bucket. (I also don't know how Google calculates the cost of storing objects in GCS, but obviously there is some storage used for metadata in addition to the object content.) I also don't know if there is any way to report the storage usage of a bucket or prefix in any meaningful way, other than by actually iterating over all the blobs in the bucket as GCSObject.size does. So GCSQuotaManager calculates bytes_used in the same inefficient way as GCSProjectFiles.active_project_storage_used (which this class is intended to replace.) Currently it does *not* calculate inodes_used (though that should be easy enough to do, it should ideally be done by GCSObject and avoid making more unnecessary requests.) GCSQuotaManager also implements the other QuotaManager methods, such as create_toplevel_directory and check_create_file, in much the same way that DemoQuotaManager does, so that we can eventually use the QuotaManager API in other areas of the code.
- Loading branch information