The glance_store._drivers.swift.buffered Module

The glance_store._drivers.swift.buffered Module

class glance_store._drivers.swift.buffered.BufferedReader(fd, checksum, total, verifier=None)

Bases: object

Buffer a chunk (segment) worth of data to disk before sending it swift. This creates the ability to back the input stream up and re-try put object requests. (Swiftclient will try to reset the file pointer on any upload failure if seek and tell methods are provided on the input file.)

Chunks are temporarily buffered to disk. Disk space consumed will be roughly (segment size * number of in-flight upload requests).

There exists a possibility where the disk space consumed for buffering MAY eat into the disk space available for glance cache. This may affect image download performance. So, extra care should be taken while deploying this to ensure there is enough disk space available.

bytes_read
read(size)

Read up to a chunk’s worth of data from the input stream into a file buffer. Then return data out of that buffer.

seek(offset)
tell()
glance_store._drivers.swift.buffered.validate_buffering(buffer_dir)
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.