swift/doc/source
Peter Portante 5202b0e586 DiskFile API, with reference implementation
Refactor on-disk knowledge out of the object server by pushing the
async update pickle creation to the new DiskFileManager class (name is
not the best, so suggestions welcome), along with the REPLICATOR
method logic. We also move the mount checking and thread pool storage
to the new ondisk.Devices object, which then also becomes the new home
of the audit_location_generator method.

For the object server, a new setup() method is now called at the end
of the controller's construction, and the _diskfile() method has been
renamed to get_diskfile(), to allow implementation specific behavior.

We then hide the need for the REST API layer to know how and where
quarantining needs to be performed. There are now two places it is
checked internally, on open() where we verify the content-length,
name, and x-timestamp metadata, and in the reader on close where the
etag metadata is checked if the entire file was read.

We add a reader class to allow implementations to isolate the WSGI
handling code for that specific environment (it is used no-where else
in the REST APIs). This simplifies the caller's code to just use a
"with" statement once open to avoid multiple points where close needs
to be called.

For a full historical comparison, including the usage patterns see:
https://gist.github.com/portante/5488238

(as of master, 2b639f5, Merge
 "Fix 500 from account-quota     This Commit
 middleware")
--------------------------------+------------------------------------
                                 DiskFileManager(conf)

                                   Methods:
                                     .pickle_async_update()
                                     .get_diskfile()
                                     .get_hashes()

                                   Attributes:
                                     .devices
                                     .logger
                                     .disk_chunk_size
                                     .keep_cache_size
                                     .bytes_per_sync

DiskFile(a,c,o,keep_data_fp=)    DiskFile(a,c,o)

  Methods:                         Methods:
   *.__iter__()
    .close(verify_file=)
    .is_deleted()
    .is_expired()
    .quarantine()
    .get_data_file_size()
                                     .open()
                                     .read_metadata()
    .create()                        .create()
                                     .write_metadata()
    .delete()                        .delete()

  Attributes:                      Attributes:
    .quarantined_dir
    .keep_cache
    .metadata
                                *DiskFileReader()

                                   Methods:
                                     .__iter__()
                                     .close()

                                   Attributes:
                                    +.was_quarantined

DiskWriter()                     DiskFileWriter()

  Methods:                         Methods:
    .write()                         .write()
    .put()                           .put()

* Note that the DiskFile class   * Note that the DiskReader() object
  implements all the methods       returned by the
  necessary for a WSGI app         DiskFileOpened.reader() method
  iterator                         implements all the methods
                                   necessary for a WSGI app iterator

                                 + Note that if the auditor is
                                   refactored to not use the DiskFile
                                   class, see
                                   https://review.openstack.org/44787
                                   then we don't need the
                                   was_quarantined attribute

A reference "in-memory" object server implementation of a backend
DiskFile class in swift/obj/mem_server.py and
swift/obj/mem_diskfile.py.

One can also reference
https://github.com/portante/gluster-swift/commits/diskfile for the
proposed integration with the gluster-swift code based on these
changes.

Change-Id: I44e153fdb405a5743e9c05349008f94136764916
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013-10-17 15:03:31 -04:00
..
_ga Replaces Copyright statements for LLC with Foundation, removes date. 2013-02-11 16:32:33 -06:00
_static Adding a box to each page that gives readers links to 1.1 and 1.2 Swift docs sites 2011-03-09 23:14:38 -06:00
_theme Update auto-generated docs 2013-01-22 15:24:06 -08:00
account.rst DiskFile API, with reference implementation 2013-10-17 15:03:31 -04:00
admin_guide.rst Configuration options for error regex and log file in the config now 2013-07-23 07:24:29 -05:00
apache_deployment_guide.rst Revert "docfix apache2 now supports client chunked encodin" 2013-07-02 22:18:32 +00:00
associated_projects.rst Add libcloud to associated_projects. 2013-08-09 17:18:40 +02:00
conf.py Replaces Copyright statements for LLC with Foundation, removes date. 2013-02-11 16:32:33 -06:00
container.rst DiskFile API, with reference implementation 2013-10-17 15:03:31 -04:00
cors.rst Remove sphinx build warnings 2013-10-03 11:21:26 -04:00
crossdomain.rst Fix two documentation warnings. 2013-05-11 14:31:42 -07:00
db.rst Initial commit of Swift code 2010-07-12 17:03:45 -05:00
deployment_guide.rst Pool memcache connections 2013-10-02 02:08:04 +00:00
development_auth.rst Adding CORS support 2012-10-23 14:48:59 -05:00
development_guidelines.rst Add documentation about flake8+hacking. 2013-07-15 17:14:16 +02:00
development_ondisk_backends.rst DiskFile API, with reference implementation 2013-10-17 15:03:31 -04:00
development_saio.rst Fedora 19: need to use /etc/rc.d/rc.local 2013-10-03 11:36:31 -04:00
getting_started.rst Doc changes for new pip-requirements 2013-05-06 19:21:53 +03:00
howto_installmultinode.rst Improve config samples 2013-06-06 19:41:13 -06:00
index.rst DiskFile API, with reference implementation 2013-10-17 15:03:31 -04:00
misc.rst Revert "Refactor common/utils methods to common/ondisk" 2013-10-07 17:18:09 -04:00
object.rst DiskFile API, with reference implementation 2013-10-17 15:03:31 -04:00
overview_architecture.rst Spell check for .rst files 2010-10-13 11:28:27 -05:00
overview_auth.rst Add tests and doc entry for request.environ[reseller_request] 2013-03-10 19:21:13 +01:00
overview_container_sync.rst Improved container-sync resiliency 2013-03-08 22:28:06 +02:00
overview_expiring_objects.rst Add parallelism to object expirer daemon. 2013-06-07 20:49:47 +00:00
overview_large_objects.rst fix slo docs 2013-04-17 07:03:46 -07:00
overview_object_versioning.rst Add x-remove-versions-location for feature: disable versioning 2013-03-17 07:30:00 +08:00
overview_reaper.rst account-reaper warns if not making progress 2013-05-22 15:07:17 +01:00
overview_replication.rst Implementation of replication servers 2013-04-21 18:14:42 -04:00
overview_ring.rst Add a region tier to Swift's ring. 2013-03-13 10:00:58 -07:00
proxy.rst Initial commit of Swift code 2010-07-12 17:03:45 -05:00
ratelimit.rst Added container listing ratelimiting 2013-08-14 12:40:25 +00:00
replication_network.rst Implementation of replication servers 2013-04-21 18:14:42 -04:00
ring.rst Initial commit of Swift code 2010-07-12 17:03:45 -05:00