#NEWLINE# def add_to_reconciler_queue( container_ring , account , container , obj , obj_policy_index , obj_timestamp , op , force = False , conn_timeout = 5 , response_timeout = 15 ) : #NEWLINE# #INDENT# '\n    Add an object to the container reconciler\'s queue. This will cause the\n    container reconciler to move it from its current storage policy index to\n    the correct storage policy index.\n\n    :param container_ring: container ring\n    :param account: the misplaced object\'s account\n    :param container: the misplaced object\'s container\n    :param obj: the misplaced object\n    :param obj_policy_index: the policy index where the misplaced object\n                             currently is\n    :param obj_timestamp: the misplaced object\'s X-Timestamp. We need this to\n                          ensure that the reconciler doesn\'t overwrite a newer\n                          object with an older one.\n    :param op: the method of the operation (DELETE or PUT)\n    :param force: over-write queue entries newer than obj_timestamp\n    :param conn_timeout: max time to wait for connection to container server\n    :param response_timeout: max time to wait for response from container\n                             server\n\n    :returns: .misplaced_object container name, False on failure. "Success"\n              means a quorum of containers got the update.\n    ' #NEWLINE# container_name = get_reconciler_container_name ( obj_timestamp ) #NEWLINE# object_name = get_reconciler_obj_name ( nodes , account , container , obj ) #NEWLINE# if force : #NEWLINE# #INDENT# x_timestamp = Timestamp ( time . time ( ) ) . internal #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# x_timestamp = obj_timestamp #NEWLINE# #UNINDENT# q_op_type = get_reconciler_content_type ( op ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'X-Size' : 0 , #NEWLINE# 'X-Etag' : obj_timestamp , #NEWLINE# 'X-Timestamp' : x_timestamp , #NEWLINE# 'X-Content-Type' : q_op_type , #NEWLINE# #UNINDENT# } #NEWLINE# def _check_success( * args , **kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# direct_put_container_object ( * args , ** kwargs ) #NEWLINE# return 1 #NEWLINE# #UNINDENT# except ( ClientException , Timeout , socket . error ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# #UNINDENT# pile = GreenPile ( ) #NEWLINE# ( part , nodes ) = container_ring . get_nodes ( MISPLACED_OBJECTS_ACCOUNT , container_name ) #NEWLINE# for node in nodes : #NEWLINE# #INDENT# pile . spawn ( _check_success , node , part , MISPLACED_OBJECTS_ACCOUNT , container_name , object_name , headers = headers , conn_timeout = conn_timeout , response_timeout = response_timeout ) #NEWLINE# #UNINDENT# successes = sum ( pile ) #NEWLINE# if ( successes >= quorum_size ( len ( nodes ) ) ) : #NEWLINE# #INDENT# return container_name #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False