swift/proxy/controllers/obj.py
def add_response(self, get, parts_iter):
        """
        Add a response to the collection.

        :param get: An instance of
                    :class:`~swift.proxy.controllers.base.ResumingGetter`
        :param parts_iter: An iterator over response body parts
        :raises ValueError: if the response etag or status code values do not
            match any values previously received for the same timestamp
        """
        headers = get.last_headers
        # Add the response to the appropriate bucket keyed by data file
        # timestamp. Fall back to using X-Backend-Timestamp as key for object
        # servers that have not been upgraded.
        t_data_file = headers.get('X-Backend-Data-Timestamp')
        t_obj = headers.get('X-Backend-Timestamp', headers.get('X-Timestamp'))
        self._get_bucket(t_data_file or t_obj).add_response(get, parts_iter)

        # The node may also have alternate fragments indexes (possibly at
        # different timestamps). For each list of alternate fragments indexes,
        # find the bucket for their data file timestamp and add the node and
        # list to that bucket's alternate nodes.
        frag_sets = safe_json_loads(headers.get('X-Backend-Fragments')) or {}
        for t_frag, frag_set in frag_sets.items():
            self._get_bucket(t_frag).add_alternate_nodes(get.node, frag_set)
        # If the response includes a durable timestamp then mark that bucket as
        # durable. Note that this may be a different bucket than the one this
        # response got added to, and that we may never go and get a durable
        # frag from this node; it is sufficient that we have been told that a
        # durable frag exists, somewhere, at t_durable.
        t_durable = headers.get('X-Backend-Durable-Timestamp')
        if not t_durable and not t_data_file:
            # obj server not upgraded so assume this response's frag is durable
            t_durable = t_obj
        if t_durable:
            self._get_bucket(t_durable).set_durable()

        Add a response to the collection.

        :param get: An instance of
                    :class:`~swift.proxy.controllers.base.ResumingGetter`
        :param parts_iter: An iterator over response body parts
        :raises ValueError: if the response etag or status code values do not
            match any values previously received for the same timestamp
        
Add a response to the collection.
Add a response to the collection .
def add_response(self, get, parts_iter):
        headers = get.last_headers
        t_data_file = headers.get('X-Backend-Data-Timestamp')
        t_obj = headers.get('X-Backend-Timestamp', headers.get('X-Timestamp'))
        self._get_bucket(t_data_file or t_obj).add_response(get, parts_iter)
        frag_sets = safe_json_loads(headers.get('X-Backend-Fragments')) or {}
        for t_frag, frag_set in frag_sets.items():
            self._get_bucket(t_frag).add_alternate_nodes(get.node, frag_set)
        t_durable = headers.get('X-Backend-Durable-Timestamp')
        if not t_durable and not t_data_file:
            t_durable = t_obj
        if t_durable:
            self._get_bucket(t_durable).set_durable()
def add_response ( self , get , parts_iter ) : headers = get . last_headers t_data_file = headers . get ( 'X-Backend-Data-Timestamp' ) t_obj = headers . get ( 'X-Backend-Timestamp' , headers . get ( 'X-Timestamp' ) ) self . _get_bucket ( t_data_file or t_obj ) . add_response ( get , parts_iter ) frag_sets = safe_json_loads ( headers . get ( 'X-Backend-Fragments' ) ) or { } for t_frag , frag_set in frag_sets . items ( ) : self . _get_bucket ( t_frag ) . add_alternate_nodes ( get . node , frag_set ) t_durable = headers . get ( 'X-Backend-Durable-Timestamp' ) if not t_durable and not t_data_file : t_durable = t_obj if t_durable : self . _get_bucket ( t_durable ) . set_durable ( )
Add a response to the collection.
Add a response to the collection .
"""
        Add a response to the collection.

        :param get: An instance of
                    :class:`~swift.proxy.controllers.base.ResumingGetter`
        :param parts_iter: An iterator over response body parts
        :raises ValueError: if the response etag or status code values do not
            match any values previously received for the same timestamp
        """ # Add the response to the appropriate bucket keyed by data file # timestamp. Fall back to using X-Backend-Timestamp as key for object # servers that have not been upgraded. # The node may also have alternate fragments indexes (possibly at # different timestamps). For each list of alternate fragments indexes, # find the bucket for their data file timestamp and add the node and # list to that bucket's alternate nodes. # If the response includes a durable timestamp then mark that bucket as # durable. Note that this may be a different bucket than the one this # response got added to, and that we may never go and get a durable # frag from this node; it is sufficient that we have been told that a # durable frag exists, somewhere, at t_durable. # obj server not upgraded so assume this response's frag is durable
if the response etag or status code values do not
match any values previously received for the same timestamp
if the response etag or status code values do not match any values previously received for the same timestamp
ValueError
self
get
An instance of
:class:`~swift.proxy.controllers.base.ResumingGetter`
An instance of : class : ` ~swift . proxy . controllers . base . ResumingGetter `
parts_iter
An iterator over response body parts
An iterator over response body parts