buildgrid.server.cas.storage.disk module

DiskStorage

A CAS storage provider that stores files as blobs on disk.

class buildgrid.server.cas.storage.disk.DiskStorage(path)

Bases: buildgrid.server.cas.storage.storage_abc.StorageABC

has_blob(digest)

Return True if the blob with the given instance/digest exists.

get_blob(digest)

Return a file-like object containing the blob.

If the blob isn’t present in storage, return None.

delete_blob(digest)

Delete the blob from storage if it’s present.

begin_write(digest)

Return a file-like object to which a blob’s contents could be written.

commit_write(digest, write_session)

Commit the write operation. write_session must be an object returned by begin_write.

The storage object is not responsible for verifying that the data written to the write_session actually matches the digest. The caller must do that.