Hash path implementation for compressing file paths.
Sequence
Iterable
functools0
FNV
FNVcompute0
compute(Class, data)
FNV__init__0
__init__(self)
FNVupdate0
update(self, data)
FNVhexdigest0str
hexdigest(self)
FNVdigest150%int
digest(self)
Segmentation0
Hash implementation container providing division logic for constructing the path segment to be used by a resource's key.
Segmentation__init__0
__init__(self, implementation, algorithm, depth, length)
Segmentationdivide0Sequence[str]
divide(digest, length, edge, step)
Split the hex digest into parts for building a Route to the bucket.
Segmentation__call__0Sequence[str]
__call__(self, key)
Hash the given key with the configured algorithm returning the divided digest.
Segmentationidentity233%tuple[str, int, int]
identity(self)
Return a tuple consisting of the algorithm identifier, the number of divisions, and the character length of the hex digest.
Segmentationfrom_identity650%
from_identity(Class)
Create an instance using the identity.
Index0
A bucket index for Directory resources.
Manages the sequence of entries for a bucket.
The index files are a series of entry identifiers followed by the key on a greater indentation level; the trailing newline of each indentation block not being part of the key.
Indexstructure0
structure(seq)
Structure the indentation blocks into (key, entry) pairs. The keys are the indented section and the entries are the leading unindented identifier.
Trailing newlines MUST be present. Structure presumes that the index file was loaded using readlines.
Entries (unindented areas) must be a single line followed by one or more indented lines. The initial indentation level (first tab) will be remove; the content will be considered to be the continuation of the key (that's hashed to select this bucket's index).
Underscore attributes are representations of stored data.
Indexfrom_path40%
from_path(Class, path)
Index__init__0
__init__(self)
Indexload0
load(self, lines)
Load the index from the given line sequence. lines items must have trailing newlines.
Indexsequence0
sequence(self)
Send the serialized index state to the given write function.
Indexkeys20%
keys(self)
Iterator containing the keys loaded from the index.
Indexitems0
items(self)
Indexhas_key0
has_key(self, key)
Check if a key exists in the index.
Index__getitem__0
__getitem__(self, key)
Index__delitem__10%
__delitem__(self, key)
Indexallocate0
allocate(self, keys, filename)
Allocate a sequence of entries for the given keys.
Indexinsert0
insert(self, key, filename)
Insert the key into the bucket. The key must not already be present.
Indexdelete0
delete(self, key)
Delete the key from the index returning the entry for removal.
Directory0
Filesystem based hash tree.
DirectoryProperties
- addressing
The address resolution method. Usually a Segmentation instance.
Directoryindex_name0
index_name = '.index'
Directory__init__0
__init__(self, addressing, directory)
Directoryitems0Iterable[(bytes, object)]
items(self)
Returns an iterator to all the keys and their associated routes.
Directory_index0
_index(self, route)
Directoryallocate0object
allocate(self, key)
Allocate a position for the given key and return its route.
If already allocated, return the reference to the resource.
Directoryavailable0bool
available(self, key)
Whether the resource has not been allocated.
Directoryrelease0
release(self, key)
Release the allocated resource associated with the key and delete it from the index.