oio.content package
Submodules
oio.content.content module
-
class
oio.content.content.Chunk(chunk)[source] Bases:
object-
checksum
-
data
-
ec
-
host
-
id
-
imperfections List imperfections of this chunk. Tell how much the quality of this chunk can be improved.
Returns: a positive number telling how many criteria can be improved (0 if all criteria are met).
-
metapos
-
pos
-
quality Get the “quality” of the chunk, i.e. a dictionary telling how it matched the request criteria when it has been selected.
-
raw()[source]
-
size
-
subpos
-
url
-
-
class
oio.content.content.ChunksHelper(chunks, raw_chunk=True)[source] Bases:
object-
all()[source]
-
exclude(id=None, pos=None, metapos=None, subpos=None, host=None, url=None)[source]
-
filter(id=None, pos=None, metapos=None, subpos=None, host=None, url=None)[source]
-
one()[source]
-
raw()[source]
-
-
class
oio.content.content.Content(conf, container_id, metadata, chunks, storage_method, account, container_name, blob_client=None, container_client=None, logger=None)[source] Bases:
object-
create(stream, **kwargs)[source]
-
delete(**kwargs)[source]
-
fetch()[source]
-
mime_type
-
move_chunk(chunk_id, check_quality=False, dry_run=False, max_attempts=3, **kwargs)[source] Move a chunk to another place. Optionally ensure that the new place is an improvement over the current one.
-
move_linked_chunk(chunk_id, from_url)[source]
-
policy
-
properties
-
rebuild_chunk(chunk_id, allow_same_rawx=False, chunk_pos=None, allow_frozen_container=False)[source]
-
-
oio.content.content.cmp(x, y)[source] cmp function as a workaround for python3
-
oio.content.content.compare_chunk_quality(current, candidate)[source] Compare the qualities of two chunks.
Returns: > 0 if the candidate is better quality, 0 if they are equal, < 0 if the candidate is worse.
-
oio.content.content.ensure_better_chunk_qualities(current_chunks, candidates, threshold=1)[source] Ensure that the set of spare chunks is really an improvement over the set of current chunks, raise SpareChunkException if it is not.
oio.content.ec module
-
class
oio.content.ec.ECContent(conf, container_id, metadata, chunks, storage_method, account, container_name, blob_client=None, container_client=None, logger=None)[source] Bases:
oio.content.content.Content-
create(stream, **kwargs)[source]
-
fetch()[source]
-
rebuild_chunk(chunk_id, allow_same_rawx=False, chunk_pos=None, allow_frozen_container=False)[source]
-
oio.content.factory module
-
class
oio.content.factory.ContentFactory(conf, container_client=None, logger=None, **kwargs)[source] Bases:
object-
DEFAULT_DATASEC= ('plain', {'distance': '0', 'nb_copy': '1'})
-
copy(origin, policy=None)[source]
-
get(container_id, content_id, account=None, container_name=None, **kwargs)[source]
-
get_by_path_and_version(container_id, path, version, account=None, container_name=None, **kwargs)[source]
-
new(container_id, path, size, policy, account=None, container_name=None, **kwargs)[source]
-
oio.content.plain module
-
class
oio.content.plain.PlainContent(conf, container_id, metadata, chunks, storage_method, account, container_name, blob_client=None, container_client=None, logger=None)[source] Bases:
oio.content.content.Content-
create(stream, **kwargs)[source]
-
fetch()[source]
-
rebuild_chunk(chunk_id, allow_same_rawx=False, chunk_pos=None, allow_frozen_container=False)[source]
-
oio.content.repairer module
-
class
oio.content.repairer.ContentRepairer(conf, objects=None, **kwargs)[source] Bases:
oio.common.tool.ToolRepair objects.
-
create_worker(queue_workers, queue_reply)[source] Create worker to process the items.
-
static
string_from_item(item)[source]
-
-
class
oio.content.repairer.ContentRepairerWorker(tool, queue_workers, queue_reply)[source] Bases:
oio.common.tool.ToolWorker