Table Of Contents

Previous topic

Account

Next topic

Account DB and Container DB

This Page

Container

Container Server

class swift.container.server.ContainerController(conf)

Bases: object

WSGI Controller for the container server.

DELETE(*a, **kw)

Handle HTTP DELETE request.

GET(*a, **kw)

Handle HTTP GET request.

HEAD(*a, **kw)

Handle HTTP HEAD request.

POST(*a, **kw)

Handle HTTP POST request.

PUT(*a, **kw)

Handle HTTP PUT request.

REPLICATE(*a, **kw)

Handle HTTP REPLICATE request (json-encoded RPC calls for replication.)

account_update(req, account, container, broker)

Update the account server(s) with latest container info.

Parameters:
  • req – swob.Request object
  • account – account name
  • container – container name
  • broker – container DB broker object
Returns:

if all the account requests return a 404 error code, HTTPNotFound response object, if the account cannot be updated due to a malformed header, an HTTPBadRequest response object, otherwise None.

derive_content_type_metadata(content_type, size)

Will check the last parameter and if it starts with ‘swift_bytes=’ will strip it off. Returns either the passed in content_type and size or the content_type without the swift_bytes param and its value as the new size. :params content_type: Content Type from db :params size: # bytes from db, an int :returns: tuple: content_type, size

save_headers = ['x-container-read', 'x-container-write', 'x-container-sync-key', 'x-container-sync-to']
swift.container.server.app_factory(global_conf, **local_conf)

paste.deploy app factory for creating WSGI container server apps

Container Updater

class swift.container.updater.ContainerUpdater(conf)

Bases: swift.common.daemon.Daemon

Update container information in account listings.

container_report(node, part, container, put_timestamp, delete_timestamp, count, bytes)

Report container info to an account server.

Parameters:
  • node – node dictionary from the account ring
  • part – partition the account is on
  • container – container name
  • put_timestamp – put timestamp
  • delete_timestamp – delete timestamp
  • count – object count in the container
  • bytes – bytes used in the container
container_sweep(path)

Walk the path looking for container DBs and process them.

Parameters:path – path to walk
get_account_ring()

Get the account ring. Load it if it hasn’t been yet.

get_paths()

Get paths to all of the partitions on each drive to be processed.

Returns:a list of paths
process_container(dbfile)

Process a container, and update the information in the account.

Parameters:dbfile – container DB to process
run_forever(*args, **kwargs)

Run the updator continuously.

run_once(*args, **kwargs)

Run the updater once.

swift.container.updater.random() → x in the interval [0, 1).

Container Auditor

class swift.container.auditor.ContainerAuditor(conf)

Bases: swift.common.daemon.Daemon

Audit containers.

container_audit(path)

Audits the given container path

Parameters:path – the path to a container db
run_forever(*args, **kwargs)

Run the container audit until stopped.

run_once(*args, **kwargs)

Run the container audit once.

swift.container.auditor.random() → x in the interval [0, 1).

Container Sync