Allow to deprecate policy

if a policy is marked as 'deprecate = yes' in swift.conf:
    * it will not appear in /info of the cluster
    * upload/download/delete/post are allowed on the existing containers
      with this policy.
    * clients will get error when trying to create container with this policy
    * clients can get the policy info via HEAD on the existing
      containers created with this policy
    * clients also can set new metadata via POST to the containers with
      this policy

corner cases:
    * deprecated policy will ignore the default option
    * deprecating a default policy make the policy with the lowest index default

Change-Id: Ia72d39dca0c993e461e0e8cadef1dc91be98f3f4
EC: Add 'erasure_coding' policy type, PyEClib dependency

This patch adds support for a new policy type called
'erasure_coding' to lay the groundwork required to
support Erasure Codes in Swift.

Changes:

 - Policy config changes
   - New policy type 'erasure_coding'
   - Add:
     ec_type (EC backend),
     ec_num_data_fragments (number of fragments original
         data split into after erasure coding operation),
     ec_num_parity_fragments (number of redundant parity
         fragments generated during erasure coding)

 - Subclass StoragePolicy into ECStoragePolicy and
   ReplicationStoragePolicy.

 - ECStoragePolicy holds EC specific metadata and ring
   validator methods.

Implements: blueprint ec-proxy-work
Change-Id: Id79eb337176462b43a116812117fb569f4dbe868
EC: Make quorum_size() specific to storage policy

quorum size ie, the number of successful backend operations
needed for the proxy to consider the client request
serviceable or successful, depends on the policy type.
For 'replication' policies, it is a function of the number
of object replicas configured, whereas for 'erasure_coding'
policies, it is a function of the number of fragments which
is also the number of nodes that the original data was split
across.

This patch adds quorum_size() definitions for the currently
supported storage policy (sub)classes:
   ReplicationStoragePolicy and ECStoragePolicy.

Changes:

 - Move quorum_size() from utils to *StoragePolicy
 - Update callers of quorum_size() to reflect this change
 - Add quorum_size() unit test code taking policy_type
   into account
 - Add proxy-object-controller-specific _quorum_size()
   taking policy into account

Implements: blueprint ec-proxy-work
Change-Id: Ifaf8696e45c42176936c91d3a50b8426ec6bec78
EC: Datapath - HTTP PUT handling

This patch is a first cut at adding erasure_coding type
policy support to the Swift proxy handler for HTTP PUT
requests.

Terminology:

 - object chunks: HTTP chunks received over wire
 - object segments: consecutive HTTP chunks buffered up to
   a min threshold for erasure coding before they are erasure
   coded
 - EC fragments: data and parity fragments generated when
   erasure coding transformation is applied to object segments
 - EC archive: concatenation of EC fragments
 - ec_ndata - number of EC data fragments
 - ec_nparity - number of EC parity fragments

Design notes and Assumptions:

 - Swift requires PyECLib for erasure code primitives
   (Hosted at bitbucket.org and pypi.org)

 - Rough flow of operations -

   - Proxy opens (ec_ndata + ec_nparity) backend requests to object servers
   - Proxy buffers HTTP chunks up-to a minimum segment size
     (defined as a constraint in swift.conf, 1MB to start with)
   - Proxy feeds the assembled segment to PyECLib's encode() to get
     ec_ndata + ec_nparity fragments
   - Proxy sends the (ec_ndata + ec_nparity) fragments to the object servers
     to be _appended_ to the previous set
   - Proxy then continues with the next set of HTTP chunks

   - Object servers store objects which are EC archives (their
     contents are the concatenation of erasure coded fragments)

   - Length (8 bytes) and md5sum (16 bytes) for the original object are
     appended to the payload being streamed to the object server which
     the object server reads from the stored object

 - Assumptions around PyECLib -

   - PyECLib gurantees that data/parity fragments are the same size
     (with appropriate padding added)
   - PyECLib generates a unique header for each erasure code fragment it
     generates on encode() - the header has the fragment size
   - PyECLib store a digest with each erasure coded fragment for integrity
     checking
   - PyECLib provides a get_segment_info API to help calculate EC
     fragment archive

Changes (TBD):

 - Proxy HTTP PUT request handling changes
   - Intercept EC request based on policy type
   - Validate ring replica count against (ec_ndata + ec_nparity)
   - Calculate EC quorum size for min_conns
   - Call into PyEClib to encode to client_chunk_size sized
     object chunks to generate (ec_ndata + ec_nparity) EC fragments.
   - Queue chunk EC fragments for writing to nodes

 - Object metadata changes: object server treats fragments archives as
   normal objects

     Content-Length: Length of the EC Fragment archive
     Etag: md5sum of the EC Fragment archive
     X-EC-Content-Length: length of original object
     X-EC-Etag: md5sum of original object
     X-EC-Fragment-Size: Individual Fragment Size
     X-EC-Type-Version:	EC backend + version

 - Container metadata (Content-Length, Etag) still stores the length and
   md5sum of the original object

Under construction:

 - Unit test code

Change-Id: Ic31b563d355bfdd89204f791ec114e57a3dd1d8b
Implements: blueprint ec-proxy-work