swift.account.auditor.
AccountAuditor
(conf, logger=None)¶Bases: swift.common.daemon.Daemon
Audit accounts.
account_audit
(path)¶Audits the given account path
Parameters: | path – the path to an account db |
---|
run_forever
(*args, **kwargs)¶Run the account audit until stopped.
run_once
(*args, **kwargs)¶Run the account audit once.
validate_per_policy_counts
(broker)¶swift.account.auditor.
random
() → x in the interval [0, 1).¶Pluggable Back-end for Account Server
swift.account.backend.
AccountBroker
(db_file, timeout=25, logger=None, account=None, container=None, pending_timeout=None, stale_reads_ok=False, skip_commits=False)¶Bases: swift.common.db.DatabaseBroker
Encapsulates working with an account database.
create_account_stat_table
(conn, put_timestamp)¶Create account_stat table which is specific to the account DB. Not a part of Pluggable Back-ends, internal to the baseline code.
Parameters: |
|
---|
create_container_table
(conn)¶Create container table which is specific to the account DB.
Parameters: | conn – DB connection object |
---|
create_policy_stat_table
(conn)¶Create policy_stat table which is specific to the account DB. Not a part of Pluggable Back-ends, internal to the baseline code.
Parameters: | conn – DB connection object |
---|
db_contains_type
= 'container'¶db_reclaim_timestamp
= 'delete_timestamp'¶db_type
= 'account'¶empty
()¶Check if the account DB is empty.
Returns: | True if the database has no active containers. |
---|
get_db_version
(conn)¶get_info
()¶Get global data for the account.
Returns: | dict with keys: account, created_at, put_timestamp, delete_timestamp, status_changed_at, container_count, object_count, bytes_used, hash, id |
---|
get_policy_stats
(do_migrations=False)¶Get global policy stats for the account.
Parameters: | do_migrations – boolean, if True the policy stat dicts will always include the ‘container_count’ key; otherwise it may be omitted on legacy databases until they are migrated. |
---|---|
Returns: | dict of policy stats where the key is the policy index and the value is a dictionary like {‘object_count’: M, ‘bytes_used’: N, ‘container_count’: L} |
is_status_deleted
()¶Only returns true if the status field is set to DELETED.
list_containers_iter
(limit, marker, end_marker, prefix, delimiter, reverse=False)¶Get a list of containers sorted by name starting at marker onward, up to limit entries. Entries will begin with the prefix and will not have the delimiter after the prefix.
Parameters: |
|
---|---|
Returns: | list of tuples of (name, object_count, bytes_used, put_timestamp, 0) |
make_tuple_for_pickle
(record)¶Turn this db record dict into the format this service uses for pending pickles.
merge_items
(item_list, source=None)¶Merge items into the container table.
Parameters: |
|
---|
put_container
(name, put_timestamp, delete_timestamp, object_count, bytes_used, storage_policy_index)¶Create a container with the given attributes.
Parameters: |
|
---|
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.