oio.rdir package

Submodules

oio.rdir.client module

class oio.rdir.client.RdirClient(conf, **kwargs)[source]

Bases: oio.api.base.HttpApi

Client class for rdir services.

admin_clear(volume, clear_all=False, before_incident=False, repair=False, **kwargs)[source]
admin_incident_get(volume, **kwargs)[source]
admin_incident_set(volume, date, **kwargs)[source]
admin_lock(volume, who, **kwargs)[source]
admin_show(volume, **kwargs)[source]
admin_unlock(volume, **kwargs)[source]
base_url = {'meta2': 'rdir/meta2', 'rawx': 'rdir'}
chunk_delete(volume_id, container_id, content_id, chunk_id, **kwargs)[source]

Unreference a chunk from the reverse directory

chunk_fetch(volume, limit=100, rebuild=False, container_id=None, max_attempts=3, **kwargs)[source]

Fetch the list of chunks belonging to the specified volume.

Parameters:
  • volume (str) – the volume to get chunks from
  • limit (int) – maximum number of results to return
  • rebuild (bool) –
  • container_id (str) – get only chunks belonging to the specified container
chunk_push(volume_id, container_id, content_id, chunk_id, headers=None, **data)[source]

Reference a chunk in the reverse directory

create(volume_id, **kwargs)[source]

Create the database for volume_id on the appropriate rdir

meta2_index_create(volume_id, **kwargs)[source]

Create a new meta2 rdir database.

meta2_index_delete(volume_id, container_path, container_id, **kwargs)[source]

Remove a meta2 record from the database.

meta2_index_fetch(volume_id, prefix=None, marker=None, limit=4096, **kwargs)[source]

Fetch specific meta2 records, or a range of records.

meta2_index_push(volume_id, container_url, container_id, mtime, headers=None, **kwargs)[source]

Add a newly created container to the list of containers handled by the meta2 server in question.

status(volume, **kwargs)[source]
class oio.rdir.client.RdirDispatcher(conf, **kwargs)[source]

Bases: object

assign_all_meta2(max_per_rdir=None, **kwargs)[source]

Assign an rdir service to all meta2 servers that aren’t already assigned one.

Parameters:max_per_rdir (int) – Maximum number of services an rdir can handle.
Returns:The list of meta2 that were assigned rdir services.
assign_all_rawx(max_per_rdir=None, **kwargs)[source]

Find an rdir service for all rawx that don’t have one already.

Parameters:max_per_rdir (int) – maximum number or rawx services that an rdir can be linked to
assign_services(service_type, max_per_rdir=None, **kwargs)[source]
cs
get_assignments(service_type, **kwargs)[source]

Get rdir assignments for all services of the specified type.

Returns:a tuple with a list all services of the specified type, and a list of all rdir services.
Return type:tuple<list<dict>,list<dict>>

Module contents