OpenStack Storage (Swift) Client
Go to file
John Dickinson 0cc4d8af18 respect bulk delete page size and fix logic error
Previously, using SwiftService to delete "many" objects would use
bulk delete if available, but it would not respect the bulk delete
page size. If the number of objects to delete exceeded the bulk delete
page size, SwiftService would ignore the error and nothing would be
deleted.

This patch changes _should_bulk_delete() to be _bulk_delete_page_size();
instead of returning a simple True/False, it returns the page size for
the bulk deleter, or 1 if objects should be deleted one at a time.
Delete SDK calls are then spread across multiple bulk DELETEs if the
requested number of objects to delete exceeds the returned page size.

Fixed the logic in _should_bulk_delete() so that if the object list
is exactly 2x the thread count, it will not bulk delete. This is the
natural conclusion following the logic that existed previously: if
the delete request can be satisfied by every worker thread doing one
or two tasks, don't bulk delete. But if it requires a worker thread
to do three or more tasks, do a bulk delete instead. Previously, the
logic would mean that if every worker thread did exactly two tasks, it
would bulk delete. This patch changes a "<" to a "<=".

Closes-Bug: 1679851
Change-Id: I3c18f89bac1170dc62187114ef06dbe721afcc2e
2017-04-20 09:41:53 -07:00
bin Make bin/swift testable part 2 2014-03-25 11:36:39 +00:00
doc Removing duplicated doc from client-api 2017-03-27 16:23:16 -03:00
examples Merge "Fix examples and missing code-block" 2016-08-25 20:29:54 +00:00
releasenotes/notes 3.2.0 release notes 2016-11-09 11:25:15 -08:00
swiftclient respect bulk delete page size and fix logic error 2017-04-20 09:41:53 -07:00
tests respect bulk delete page size and fix logic error 2017-04-20 09:41:53 -07:00
tools Add Constraints support 2016-12-27 15:47:18 -08:00
.coveragerc remove swiftclient/openstack/common/* in the .coveragerc 2016-09-21 15:48:35 +08:00
.functests Fix running the unittests under py3 2014-05-09 09:29:04 +02:00
.gitignore do hand-curated authors/changelog files 2015-09-04 18:29:30 +01:00
.gitreview Add openstack project infrastructure. 2012-05-16 17:30:46 -04:00
.mailmap 3.3.0 authors/changelog update 2017-01-25 15:12:59 -08:00
.manpages adding .manpages script to swift client 2016-02-25 16:07:28 -05:00
.testr.conf Fix running the unittests under py3 2014-05-09 09:29:04 +02:00
.unittests Add functional tests for python-swiftclient 2014-05-05 11:53:37 +02:00
AUTHORS 3.3.0 authors/changelog update 2017-01-25 15:12:59 -08:00
CONTRIBUTING.rst Migrated contributing file from .md to .rst 2016-05-16 11:55:14 +00:00
ChangeLog 3.3.0 authors/changelog update 2017-01-25 15:12:59 -08:00
LICENSE Add CHANGELOG LICENSE and MANIFEST.in 2012-05-08 16:30:13 +01:00
MANIFEST.in Switch to pbr for setup. 2013-05-01 12:23:12 -04:00
README.rst Optimize the link address 2017-04-10 16:00:39 +05:30
bindep.txt Add Constraints support 2016-12-27 15:47:18 -08:00
requirements.txt Installs futures only for python 2.7 and 2.6 2016-09-27 16:28:11 +00:00
run_tests.sh Add run_tests.sh script here. 2012-05-21 12:52:55 +02:00
setup.cfg Add v1password keystoneauth plugin 2016-10-24 01:52:37 +02:00
setup.py Add python version constraint python>=2.7 2016-07-06 02:16:52 +00:00
test-requirements.txt Require newer version of oslosphinx 2016-09-27 07:53:42 +00:00
tox.ini Add Constraints support 2016-12-27 15:47:18 -08:00

README.rst

Team and repository tags

image

Python bindings to the OpenStack Object Storage API

Latest Version

Downloads

This is a python client for the Swift API. There's a Python API (the swiftclient module), and a command-line script (swift).

Development takes place via the usual OpenStack processes as outlined in the OpenStack wiki.

This code is based on the original client previously included with OpenStack's Swift The python-swiftclient is licensed under the Apache License like the rest of OpenStack.

Contents: