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
2014-03-25 11:36:39 +00:00
2016-11-09 11:25:15 -08:00
2016-12-27 15:47:18 -08:00
2014-05-09 09:29:04 +02:00
2017-01-25 15:12:59 -08:00
2017-01-25 15:12:59 -08:00
2016-12-27 15:47:18 -08:00
2017-01-25 15:12:59 -08:00
2012-05-08 16:30:13 +01:00
2013-05-01 12:23:12 -04:00
2017-04-10 16:00:39 +05:30
2012-05-21 12:52:55 +02:00
2016-10-24 01:52:37 +02:00
2016-12-27 15:47:18 -08:00

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:

Description
OpenStack Storage (Swift) Client
Readme 14 MiB
Languages
Python 99.9%
Shell 0.1%