Container

Container Server

class swift.container.server.ContainerController(conf)

Bases: object

WSGI Controller for the container server.

DELETE(req)

Handle HTTP DELETE request.

GET(req)

Handle HTTP GET request.

HEAD(req)

Handle HTTP HEAD request.

POST(req)

Handle HTTP POST request.

PUT(req)

Handle HTTP PUT request.

REPLICATE(req)

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

account_update(req, account, container, broker)

Update the account server with latest container info.

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

if the account request returns a 404 error code, HTTPNotFound response object, otherwise None.

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()

Run the updator continuously.

run_once()

Run the updater once.

swift.container.updater.random()

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()

Run the container audit until stopped.

run_once()

Run the container audit once.

swift.container.auditor.random()

random() -> x in the interval [0, 1).

Table Of Contents

Previous topic

Account

Next topic

Account DB and Container DB

This Page