Ask Your Question
0

Tracing GET request for Object

asked 2012-12-07 13:21:27 -0500

Hi,

I am trying to understand object server code. I understood PUT request completely. It uses os.write to write the content of objects.

I was not able to understand How GET Request sends the object data. Where the content of object gets read from disk? Can anyone point to the particular function.?

Any help is appreciated. Thanks!

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2012-12-07 19:34:47 -0500

torgomatic gravatar image

Take a look at swift.obj.server.DiskFile.__iter__().

edit flag offensive delete link more
0

answered 2012-12-12 03:33:34 -0500

Thanks Samuel Merritt, that solved my question.

edit flag offensive delete link more
0

answered 2012-12-10 09:43:41 -0500

Thanks Samuel !

I have some more questions.

  1. Where does this iterator gets called?

  2. Is swift.obj.server.DiskFile.__iter__() is only way by which swift read contents of an object?

  3. Is it that only object server uses this method and Auditor use some other way?

Thanks !

edit flag offensive delete link more
0

answered 2012-12-12 00:58:43 -0500

torgomatic gravatar image

It's a little complicated how it gets called, but essentially the object server returns a swob.Response(app_iter=X), where X is a DiskFile. Then, swob.Response.__call__ gets invoked by WSGI, and that returns an iterator that ultimately wraps the DiskFile, and that's how the file's bytes get up to WSGI and hence onto the wire.

As for the auditor, it's fairly easy to read; look through and see if "DiskFile" appears in the code anywhere, and that'll answer your question.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-12-07 13:21:27 -0500

Seen: 4 times

Last updated: Dec 12 '12