Tracing GET request for Object

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


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

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

torgomatic gravatar image

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

edit flag offensive delete link more

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

Thanks Samuel Merritt, that solved my question.

edit flag offensive delete link more

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

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

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

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

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


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

Seen: 9 times

Last updated: Dec 12 '12