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 (json-encoded RPC calls for replication.)
PUT(req)
Handle HTTP PUT request.
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.

Container Updater

class swift.container.updater.ContainerUpdater(server_conf, updater_conf)

Bases: object

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.

Parameter: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.

Parameter:dbfile – container DB to process
update_forever()
Run the updator continuously.
update_once_single_threaded()
Run the updater once.
swift.container.updater.random()
random() -> x in the interval [0, 1).

Container Auditor

exception swift.container.auditor.AuditException
Bases: exceptions.Exception
class swift.container.auditor.ContainerAuditor(server_conf, auditor_conf)

Bases: object

Audit containers.

audit_forever()
Run the container audit until stopped.
audit_once()
Run the container audit once.
container_audit(device)

Audit any containers found on the device

Parameter:device – device to audit
get_account_ring()

Get the account ring. Loads the ring if neccesary.

Returns:account ring
get_object_ring()

Get the object ring. Loads the ring if neccesary.

Returns:object ring
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