chunk_mod module

Manage the chunk hierarchy.

Holds the contents of files, though for large files that’ll be split up into multiple smaller chunks

class chunk_mod.Chunk(digest)[source]

Bases: object

Perform operations (read, write, update timestamp) on a chunk (of a file).

bytes_canonical_hostname = None
canonical_hostname = None
prefix = b'chunks'
read_chunk()[source]

Read a chunk_bytes back from the chunk.

update_timestamp()[source]

Update the timestamp on a chunk (hash).

write_or_touch_chunk(chunk_bytes)[source]

Write a chunk_bytes if it doesn’t exist, or just update the mtime and atime if it does.

chunk_mod.ad_hoc_sequence()[source]

Produce a less pretty sequence of directory sizes. It seems to give a good growth rate.

chunk_mod.finalize()[source]

Close the databases.

chunk_mod.is_jython(is_it=False)[source]

Return True iff we’re on Jython.

chunk_mod.pieces(string)[source]

Divide up a string into pieces.