~ubuntu-branches/ubuntu/trusty/swift/trusty-updates

« back to all changes in this revision

Viewing changes to swift/common/db.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Soren Hansen, Chuck Short
  • Date: 2012-09-07 19:02:36 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20120907190236-fqrmbzm7v6zivs8d
Tags: 1.7.0-0ubuntu1
[ Soren Hansen ]
* Update debian/watch to account for symbolically named tarballs and
  use newer URL.
* Run unit tests at build time.
* Fix Launchpad URLs in debian/watch.

[ Chuck Short ]
* New upstream release
* debian/control: Add pubthon-moc as a build dep
* debian/rules: Dont fail if testsuite fails.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from tempfile import mkstemp
30
30
 
31
31
from eventlet import sleep, Timeout
32
 
import simplejson as json
33
32
import sqlite3
34
33
 
35
 
from swift.common.utils import normalize_timestamp, renamer, \
 
34
from swift.common.utils import json, normalize_timestamp, renamer, \
36
35
        mkdirs, lock_parent_directory, fallocate
37
36
from swift.common.exceptions import LockTimeout
38
37
 
1048
1047
            conn.commit()
1049
1048
 
1050
1049
    def list_objects_iter(self, limit, marker, end_marker, prefix, delimiter,
1051
 
                          path=None, format=None):
 
1050
                          path=None):
1052
1051
        """
1053
1052
        Get a list of objects sorted by name starting at marker onward, up
1054
1053
        to limit entries.  Entries will begin with the prefix and will not
1061
1060
        :param delimeter: delimeter for query
1062
1061
        :param path: if defined, will set the prefix and delimter based on
1063
1062
                     the path
1064
 
        :param format: TOOD: remove as it is no longer used
1065
1063
 
1066
1064
        :returns: list of tuples of (name, created_at, size, content_type,
1067
1065
                  etag)
1373
1371
    def reclaim(self, container_timestamp, sync_timestamp):
1374
1372
        """
1375
1373
        Delete rows from the container table that are marked deleted and
1376
 
        whose created_at timestamp is < object_timestamp.  Also deletes rows
 
1374
        whose created_at timestamp is < container_timestamp.  Also deletes rows
1377
1375
        from incoming_sync and outgoing_sync where the updated_at timestamp is
1378
1376
        < sync_timestamp.
1379
1377
 
1380
1378
        In addition, this calls the DatabaseBroker's :func:_reclaim method.
1381
1379
 
1382
 
        :param object_timestamp: max created_at timestamp of container rows to
1383
 
                                 delete
 
1380
        :param container_timestamp: max created_at timestamp of container rows
 
1381
                                    to delete
1384
1382
        :param sync_timestamp: max update_at timestamp of sync rows to delete
1385
1383
        """
1386
1384