see underlined code below. it is invoked by sending http request and get result from response.
pragya jain
<prag_2648@yahoo.
co.in> To
Hua ZZ Zhang/China/IBM@IBMCN,
2013-09-27 下午 cc
04:11 "[email protected]"
<[email protected]>
Subject
Please respond to Re: [Openstack] Fw: problem in
pragya jain understanding interaction between
<prag_2648@yahoo. swift proxy and other servers
co.in> through swift source code
But, Sir, At which line of code in the func
def _make_request(self, nodes, part, method, path, headers, query,
logger_thread_locals):
flow of control move to the AccoountController class defined in
swift/account/server.py (for example)
def _make_request(self, nodes, part, method, path, headers, query,
logger_thread_locals):
"""
Sends an HTTP request to a single node and
aggregates the result.
It attempts the primary node, then iterates over the handoff nodes
as needed.
:param nodes: an iterator of the backend server and handoff servers
:param part: the partition number
:param method: the method to send to the
backend
:param path: the path to send to the backend
:param headers: a list of dicts, where each dict represents one
backend request that should be made.
:param query: query string to send to the backend.
:param logger_thread_locals: The thread local values to be set on
the
self.app.logger to retain transaction
logging information.
:returns: a swob.Response object
"""
self.app.logger.thread_locals = logger_thread_locals
for node in nodes:
try:
start_node_timing = time.time()
with ConnectionTimeout(self.app.conn_timeout):
conn = http_connect(node['ip'], node['port'],
node['device'], part, method, path,
headers=headers, query_string=
query)
conn.node = node
self.app.set_node_timing(node, time.time() -
start_node_timing)
with Timeout(self.app.node_timeout):
resp = conn.getresponse()
if not is_informational(resp.status) and \
not is_server_error(resp.status):
return resp.status, resp.reason, resp.getheaders(),
\
resp.read()
elif resp.status == HTTP_INSUFFICIENT_STORAGE:
self.error_limit(node, _('ERROR Insufficient
Storage'))
except (Exception, Timeout):
self.exception_occurred(node, self.server_type,
_('Trying to %(method)s %(path)s')
%
{'method': method, 'path': path})
---
Thank you very much
Pragya Jain
From: Hua ZZ Zhang <[email protected]>
To: pragya jain <[email protected]>
Cc: "[email protected]" <[email protected]>
Sent: Friday, 27 September 2013 1:12 PM
Subject: Re: [Openstack] Fw: problem in understanding interaction between
swift proxy and other servers through swift source code
in swift/proxy/controllers/base.py
def make_requests(self, req, ring, part, method, path, headers,
query_string=''):
def _make_request(self, nodes, part, method, path, headers, query,
logger_thread_locals):
Inactive hide details for pragya jain ---2013-09-27 下午 02:55:44---pragya
jain <[email protected]>pragya jain ---2013-09-27 下午
02:55:44---pragya jain <[email protected]>
To
cc
Subject
Thanks Zhang for the reply.
but my question is:
According to swift source code,
through which function call, the proxy server interact with account
server, i.e., flow of control go from proxy server code to account server
code?
Thanks again
Pragya Jain
<<inline: graycol.gif>>
<<inline: pic29732.gif>>
<<inline: ecblank.gif>>
<<inline: EB007987.gif>>
_______________________________________________ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : [email protected] Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
