)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"474a177a9338f0b0fb545041b7025ae99145189f","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Correct such logic in store.get() when chunk_size param provided"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The change corrected the logic of image content reading function in"},{"line_number":10,"context_line":"get() for some store drivers. if the chunk_size param provided from"},{"line_number":11,"context_line":"outside, it means client want to read partial image content from"},{"line_number":12,"context_line":"storage, current implementation is incomplete and has some problem."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9a80dd14_67407257","line":10,"updated":"2015-03-04 05:51:33.000000000","message":"if \u003e\u003e If","commit_id":"89e88841fa2055149d63399b20507f150f117a5b"}],"glance_store/_drivers/filesystem.py":[{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"3d44b7bd5942b8ecf28f7f145fc5b099e77c83de","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    something that can iterate over a large file"},{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, filepath, offset\u003d0, chunk_size\u003d4096,"},{"line_number":104,"context_line":"                 length\u003dNone, partial\u003dFalse):"},{"line_number":105,"context_line":"        self.partial \u003d partial"},{"line_number":106,"context_line":"        self.filepath \u003d filepath"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_72261b6a","line":103,"updated":"2014-11-20 18:08:53.000000000","message":"Nit: Where does this default value come from? Is it just the size which is typically used?","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"a051c42ea26dd4505277f3297d34f6605d256470","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    something that can iterate over a large file"},{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, filepath, offset\u003d0, chunk_size\u003d4096,"},{"line_number":104,"context_line":"                 length\u003dNone, partial\u003dFalse):"},{"line_number":105,"context_line":"        self.partial \u003d partial"},{"line_number":106,"context_line":"        self.filepath \u003d filepath"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_c167f74f","line":103,"in_reply_to":"5a890539_72261b6a","updated":"2014-11-20 20:38:52.000000000","message":"Looks like pretty default block size to me.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"d601f2a50157c4194ff108d658b110dcc63b9e42","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    something that can iterate over a large file"},{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, filepath, offset\u003d0, chunk_size\u003d4096,"},{"line_number":104,"context_line":"                 length\u003dNone, partial\u003dFalse):"},{"line_number":105,"context_line":"        self.partial \u003d partial"},{"line_number":106,"context_line":"        self.filepath \u003d filepath"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_9c1d4869","line":103,"in_reply_to":"5a890539_9d0e2f31","updated":"2014-11-21 06:55:35.000000000","message":"for 4096 due to almost all block device use 4KB block size.\n\nactually, by L391, it will be overwrite by self.READ_CHUNKSIZE.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"d0f1f122cf14a0372d52777008a8e030dbb44fa5","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    something that can iterate over a large file"},{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, filepath, offset\u003d0, chunk_size\u003d4096,"},{"line_number":104,"context_line":"                 length\u003dNone, partial\u003dFalse):"},{"line_number":105,"context_line":"        self.partial \u003d partial"},{"line_number":106,"context_line":"        self.filepath \u003d filepath"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_9d0e2f31","line":103,"in_reply_to":"5a890539_c167f74f","updated":"2014-11-20 22:38:17.000000000","message":"I know, but why this over 2048, for example?","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"3d44b7bd5942b8ecf28f7f145fc5b099e77c83de","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if self.fp:"},{"line_number":117,"context_line":"                while True:"},{"line_number":118,"context_line":"                    if self.partial:"},{"line_number":119,"context_line":"                        size \u003d min(self.chunk_size, self.length)"},{"line_number":120,"context_line":"                    else:"},{"line_number":121,"context_line":"                        size \u003d self.chunk_size"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_d2c8af77","line":119,"updated":"2014-11-20 18:08:53.000000000","message":"If either of chunk_size or length is None, size will also be None. It\u0027s rather unintuitive behavior from min(), but I\u0027m not sure that\u0027s how you want this to work.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e75425335beefbeb83dcb4cb0f6c466734eedff2","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if self.fp:"},{"line_number":117,"context_line":"                while True:"},{"line_number":118,"context_line":"                    if self.partial:"},{"line_number":119,"context_line":"                        size \u003d min(self.chunk_size, self.length)"},{"line_number":120,"context_line":"                    else:"},{"line_number":121,"context_line":"                        size \u003d self.chunk_size"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_e46a8e1a","line":119,"in_reply_to":"5a890539_45dbf31a","updated":"2014-11-27 06:17:35.000000000","message":"Done","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"6bc011fae69daf86ee68d91ab9b90b1bed05e3f7","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if self.fp:"},{"line_number":117,"context_line":"                while True:"},{"line_number":118,"context_line":"                    if self.partial:"},{"line_number":119,"context_line":"                        size \u003d min(self.chunk_size, self.length)"},{"line_number":120,"context_line":"                    else:"},{"line_number":121,"context_line":"                        size \u003d self.chunk_size"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_e6c78496","line":119,"in_reply_to":"5a890539_45dbf31a","updated":"2014-11-21 17:33:01.000000000","message":"Let\u0027s keep this change focuses on the original idea and keep it be minimum, we can do this kind of change in a dedicated patch if you ok.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"c527ff91a4db9069a88edea3abb0413a71840075","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if self.fp:"},{"line_number":117,"context_line":"                while True:"},{"line_number":118,"context_line":"                    if self.partial:"},{"line_number":119,"context_line":"                        size \u003d min(self.chunk_size, self.length)"},{"line_number":120,"context_line":"                    else:"},{"line_number":121,"context_line":"                        size \u003d self.chunk_size"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_45dbf31a","line":119,"in_reply_to":"5a890539_7c3c1cc0","updated":"2014-11-21 15:51:35.000000000","message":"This isn\u0027t a blocker on this patch, but why not move that logic on L393 into ChunkedFile?","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"a051c42ea26dd4505277f3297d34f6605d256470","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if self.fp:"},{"line_number":117,"context_line":"                while True:"},{"line_number":118,"context_line":"                    if self.partial:"},{"line_number":119,"context_line":"                        size \u003d min(self.chunk_size, self.length)"},{"line_number":120,"context_line":"                    else:"},{"line_number":121,"context_line":"                        size \u003d self.chunk_size"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_61d1e3cc","line":119,"in_reply_to":"5a890539_d2c8af77","updated":"2014-11-20 20:38:52.000000000","message":"Good catch","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"d601f2a50157c4194ff108d658b110dcc63b9e42","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if self.fp:"},{"line_number":117,"context_line":"                while True:"},{"line_number":118,"context_line":"                    if self.partial:"},{"line_number":119,"context_line":"                        size \u003d min(self.chunk_size, self.length)"},{"line_number":120,"context_line":"                    else:"},{"line_number":121,"context_line":"                        size \u003d self.chunk_size"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_7c3c1cc0","line":119,"in_reply_to":"5a890539_d2c8af77","updated":"2014-11-21 06:55:35.000000000","message":"as we designed, self.chunk_size has a default value, and when self.partial equals True self.length will has a non-None value.\n\nReading code at L393.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"3d44b7bd5942b8ecf28f7f145fc5b099e77c83de","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                    else:"},{"line_number":121,"context_line":"                        size \u003d self.chunk_size"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"                    chunk \u003d self.fp.read(size)"},{"line_number":124,"context_line":"                    if chunk:"},{"line_number":125,"context_line":"                        yield chunk"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_b27b2328","line":123,"updated":"2014-11-20 18:08:53.000000000","message":"file.read(None) will fail if size does end up as being None","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"d601f2a50157c4194ff108d658b110dcc63b9e42","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                    else:"},{"line_number":121,"context_line":"                        size \u003d self.chunk_size"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"                    chunk \u003d self.fp.read(size)"},{"line_number":124,"context_line":"                    if chunk:"},{"line_number":125,"context_line":"                        yield chunk"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_1c6f98c6","line":123,"in_reply_to":"5a890539_b27b2328","updated":"2014-11-21 06:55:35.000000000","message":"\u0027size\u0027 var has a proper value with the context.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"a051c42ea26dd4505277f3297d34f6605d256470","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"                        if self.partial:"},{"line_number":128,"context_line":"                            self.length -\u003d len(chunk)"},{"line_number":129,"context_line":"                            if self.length \u003d\u003d 0:"},{"line_number":130,"context_line":"                                break"},{"line_number":131,"context_line":"                    else:"},{"line_number":132,"context_line":"                        break"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_e1579324","line":129,"updated":"2014-11-20 20:38:52.000000000","message":"perhaps \u003c\u003d so we ensure we get out of the loop even something fails and we get negative self.length","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"d10e2f96a8a76bd4faac8e9a1d21a5b1ae49cc93","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"                        if self.partial:"},{"line_number":128,"context_line":"                            self.length -\u003d len(chunk)"},{"line_number":129,"context_line":"                            if self.length \u003d\u003d 0:"},{"line_number":130,"context_line":"                                break"},{"line_number":131,"context_line":"                    else:"},{"line_number":132,"context_line":"                        break"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_3d21bb9f","line":129,"in_reply_to":"5a890539_8f59955d","updated":"2014-11-20 22:35:47.000000000","message":"Ignore me. get_size is for the Store object.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"d0f1f122cf14a0372d52777008a8e030dbb44fa5","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"                        if self.partial:"},{"line_number":128,"context_line":"                            self.length -\u003d len(chunk)"},{"line_number":129,"context_line":"                            if self.length \u003d\u003d 0:"},{"line_number":130,"context_line":"                                break"},{"line_number":131,"context_line":"                    else:"},{"line_number":132,"context_line":"                        break"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_52167656","line":129,"in_reply_to":"5a890539_8f59955d","updated":"2014-11-20 22:38:17.000000000","message":"Why not check\n\n    if not self.length \u003e 0:","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"e592e536638a8933fc5e1e39f6c9d732135b84df","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"                        if self.partial:"},{"line_number":128,"context_line":"                            self.length -\u003d len(chunk)"},{"line_number":129,"context_line":"                            if self.length \u003d\u003d 0:"},{"line_number":130,"context_line":"                                break"},{"line_number":131,"context_line":"                    else:"},{"line_number":132,"context_line":"                        break"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_8f59955d","line":129,"in_reply_to":"5a890539_e1579324","updated":"2014-11-20 22:14:17.000000000","message":"Won\u0027t self.length possibly be None too? Assuming that\u0027s the case we\u0027ll have an exception even before that. Perhaps a default value for length of -1 would be better? I know it defeats the line above using min(self.chunk_size, self.length) but that can be fixed by using self.get_size() and taking the min of self.chunk_size and that.\n\nIn reality, I agree with checking for \u003c\u003d 0 but I think this needs more work before we can determine what the check needs to be.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"d601f2a50157c4194ff108d658b110dcc63b9e42","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"                        if self.partial:"},{"line_number":128,"context_line":"                            self.length -\u003d len(chunk)"},{"line_number":129,"context_line":"                            if self.length \u003d\u003d 0:"},{"line_number":130,"context_line":"                                break"},{"line_number":131,"context_line":"                    else:"},{"line_number":132,"context_line":"                        break"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_7caa5cd3","line":129,"in_reply_to":"5a890539_e1579324","updated":"2014-11-21 06:55:35.000000000","message":"currently I couldn\u0027t think a case for \"get negative self.length\" due to fp.read(size) call guarantees the return value never greater than \u0027size\u0027 argument (but it could be less under non-blocking IO model)\n\nIf I miss anything pls let me know.","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"d5dafddc60658a643560b7132d76c5a8f74eec84","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, filepath, offset\u003d0, chunk_size\u003d4096,"},{"line_number":104,"context_line":"                 length\u003dNone, partial\u003dFalse):"},{"line_number":105,"context_line":"        self.partial \u003d partial"},{"line_number":106,"context_line":"        self.filepath \u003d filepath"},{"line_number":107,"context_line":"        self.chunk_size \u003d chunk_size"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_64fa6c76","line":104,"updated":"2014-11-25 08:54:23.000000000","message":"Why do we need to add length here? I think we could do it without adding another keyword to the constructor. Also, reading length makes me think about the file length not the size of the chunk that should be read.","commit_id":"3b7d0f3b88f0f4fc32148babd8d5afa5100b7790"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a1e207259f93c89e94473a2b8e25ea08c17492fd","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, filepath, offset\u003d0, chunk_size\u003d4096,"},{"line_number":104,"context_line":"                 length\u003dNone, partial\u003dFalse):"},{"line_number":105,"context_line":"        self.partial \u003d partial"},{"line_number":106,"context_line":"        self.filepath \u003d filepath"},{"line_number":107,"context_line":"        self.chunk_size \u003d chunk_size"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_84e0eacd","line":104,"in_reply_to":"5a890539_59e0b6cc","updated":"2014-11-27 06:17:27.000000000","message":"Done, thanks for your constructive suggestion.","commit_id":"3b7d0f3b88f0f4fc32148babd8d5afa5100b7790"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"2cb79a2002012b01706bb56833d4abb8567a0118","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, filepath, offset\u003d0, chunk_size\u003d4096,"},{"line_number":104,"context_line":"                 length\u003dNone, partial\u003dFalse):"},{"line_number":105,"context_line":"        self.partial \u003d partial"},{"line_number":106,"context_line":"        self.filepath \u003d filepath"},{"line_number":107,"context_line":"        self.chunk_size \u003d chunk_size"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_764cbd9e","line":104,"in_reply_to":"5a890539_64fa6c76","updated":"2014-11-26 05:08:07.000000000","message":"\u003e\u003e\u003e\u003e Why do we need to add length here?\n\nBecause under original idea, chunk_size was designed to indicate the read unit for each loop, so without adding new argument there\u0027s not an argument could be used to indicate how length of image content should be read out.\n\n\u003e\u003e\u003e\u003e Also, reading length makes me think about the file length not the size of the chunk that should be read.\n\nIt\u0027s not a big deal to me, I can rename \u0027length\u0027 argument for your confusing, but I didn\u0027t see a better name, frankly.","commit_id":"3b7d0f3b88f0f4fc32148babd8d5afa5100b7790"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"815233010d458edf9ad9c8a280451b5166652c6d","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    \"\"\""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def __init__(self, filepath, offset\u003d0, chunk_size\u003d4096,"},{"line_number":104,"context_line":"                 length\u003dNone, partial\u003dFalse):"},{"line_number":105,"context_line":"        self.partial \u003d partial"},{"line_number":106,"context_line":"        self.filepath \u003d filepath"},{"line_number":107,"context_line":"        self.chunk_size \u003d chunk_size"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_59e0b6cc","line":104,"in_reply_to":"5a890539_764cbd9e","updated":"2014-11-26 19:59:38.000000000","message":"Is that correct that if partial\u003d\u003dTrue, we necessarily have length !\u003d None?\n\nIf that\u0027s the case, I would get rid of partial which seems to be redundant.\n\nI tend to agree with Flavio, length is a bit confusing: partial_length?","commit_id":"3b7d0f3b88f0f4fc32148babd8d5afa5100b7790"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"f8a319db76db8a8250b510e0986d0e1bb17105da","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            if self.fp:"},{"line_number":118,"context_line":"                while True:"},{"line_number":119,"context_line":"                    if self.partial:"},{"line_number":120,"context_line":"                        size \u003d min(self.chunk_size, self.partial_length)"},{"line_number":121,"context_line":"                    else:"},{"line_number":122,"context_line":"                        size \u003d self.chunk_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_f9094785","line":119,"updated":"2015-01-12 11:01:49.000000000","message":"Nit: imho a oneliner will be easier to read here\n\nsize \u003d min(self.chunk_size, self.partial_length) if self.partial else self.chunk_size","commit_id":"8cc4cd8cccd7e9332c653a43c7a60ad7bf6e9f7e"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"586712c5638d515af2d7cd9281e27af96efb0af4","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            if self.fp:"},{"line_number":118,"context_line":"                while True:"},{"line_number":119,"context_line":"                    if self.partial:"},{"line_number":120,"context_line":"                        size \u003d min(self.chunk_size, self.partial_length)"},{"line_number":121,"context_line":"                    else:"},{"line_number":122,"context_line":"                        size \u003d self.chunk_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_6e7aaf26","line":119,"in_reply_to":"3a961159_37903396","updated":"2015-01-13 18:54:50.000000000","message":"Ternaries, while being valid syntax, are generally frowned up on by PEP-0008 unless they make perfect sense. Perhaps a comment or two before this decision would be helpful.","commit_id":"8cc4cd8cccd7e9332c653a43c7a60ad7bf6e9f7e"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"5f959c1d6f6f8f670fbea3f21f2645c997f5046e","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            if self.fp:"},{"line_number":118,"context_line":"                while True:"},{"line_number":119,"context_line":"                    if self.partial:"},{"line_number":120,"context_line":"                        size \u003d min(self.chunk_size, self.partial_length)"},{"line_number":121,"context_line":"                    else:"},{"line_number":122,"context_line":"                        size \u003d self.chunk_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_37903396","line":119,"in_reply_to":"3a961159_5f4ebbc3","updated":"2015-01-12 12:17:04.000000000","message":"Perhaps the splitting of partial/non-partial cases (if that\u0027s the intent) should be made more explicit then. Though if it is ok for everyone else, I don\u0027t insist on refactor.","commit_id":"8cc4cd8cccd7e9332c653a43c7a60ad7bf6e9f7e"},{"author":{"_account_id":11356,"name":"Louis Taylor","email":"louis@kragniz.eu","username":"kragniz"},"change_message_id":"68a8c69229c59cf2c3c84fb68d49a182ca7f3d24","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            if self.fp:"},{"line_number":118,"context_line":"                while True:"},{"line_number":119,"context_line":"                    if self.partial:"},{"line_number":120,"context_line":"                        size \u003d min(self.chunk_size, self.partial_length)"},{"line_number":121,"context_line":"                    else:"},{"line_number":122,"context_line":"                        size \u003d self.chunk_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_5f4ebbc3","line":119,"in_reply_to":"3a961159_f9094785","updated":"2015-01-12 11:05:56.000000000","message":"-1 on this. Splitting the two different cases makes more sense to me in this case, despite being more verbose.","commit_id":"8cc4cd8cccd7e9332c653a43c7a60ad7bf6e9f7e"}],"glance_store/_drivers/http.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"2df79b9f33fc91809059cdab74b9fe1ff30da081","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        \"\"\""},{"line_number":122,"context_line":"        conn, resp, content_length \u003d self._query(location, \u0027GET\u0027)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        cs \u003d chunk_size or self.READ_CHUNKSIZE"},{"line_number":125,"context_line":"        iterator \u003d http_response_iterator(conn, resp, cs)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        class ResponseIndexable(glance_store.Indexable):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_2d08b7d8","side":"PARENT","line":124,"updated":"2014-11-20 17:53:06.000000000","message":"The reason why I change this is:\n\nIn http_response_iterator(), \u0027cs\u0027 param just is the unit for each read operation in the iteration, finally all the image content will be loaded.\n\nAs the definition of of \u0027chunk_size\u0027 param, it used to control how may image bits should be returned to client/glance, so pass it into http_response_iterator doesn\u0027t work as required.\n\nAlso, at L134, the size of image complete content will be return in any case.","commit_id":"221fc84fba35bfb3f766bd7406ace7be59415bbb"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"3386400330098eee1bf707e179ea600e67e084f5","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            LOG.error(reason)"},{"line_number":134,"context_line":"            raise exceptions.RemoteServiceUnavailable()"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        iterator \u003d http_response_iterator(conn, resp, self.READ_CHUNKSIZE)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        class ResponseIndexable(glance_store.Indexable):"},{"line_number":139,"context_line":"            def another(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_d86c220b","line":136,"updated":"2015-02-17 17:36:08.000000000","message":"Since we\u0027re removing the chunk_size parameter, can we issue a deprecation warning for the parameter, something like\n\n    if chunk_size is not None:\n        warnings.warn(\n            \"The \u0027chunk_size\u0027 parameter will be \"\n            \"deprecated in 0.2.0 of glance_store \"\n            \"and removed in 0.3.0\", DeprecationWarning)\n\nThat way we can remove it eventually so it doesn\u0027t end up as permanent cruft? Perhaps we should also add a TODO note in there to remove it in the right version.","commit_id":"6c6503adf5ff81a217c379eedfef5cfe487eaf64"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b750d83c6a4615ad68b94c3a31fbae721ec77d4d","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            LOG.error(reason)"},{"line_number":134,"context_line":"            raise exceptions.RemoteServiceUnavailable()"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        iterator \u003d http_response_iterator(conn, resp, self.READ_CHUNKSIZE)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        class ResponseIndexable(glance_store.Indexable):"},{"line_number":139,"context_line":"            def another(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_e7738213","line":136,"in_reply_to":"da86d52c_d86c220b","updated":"2015-03-04 05:32:02.000000000","message":"Actually with the store-capabilities feature, this code will never be reached if \u0027chunk_size\u0027 is not None, due to under current http store implementation, driver static capabilities didn\u0027t support READ_CHUNK, so exceptions.StoreRandomGetNotSupported exception will be raised in operation checker (@capabilities.check) instead. actually this behaviour is just a purpose why to add store-capabilites.","commit_id":"6c6503adf5ff81a217c379eedfef5cfe487eaf64"}],"glance_store/_drivers/rbd.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"2df79b9f33fc91809059cdab74b9fe1ff30da081","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        \"\"\""},{"line_number":219,"context_line":"        loc \u003d location.store_location"},{"line_number":220,"context_line":"        return (ImageIterator(loc.pool, loc.image, loc.snapshot,"},{"line_number":221,"context_line":"                              self, chunk_size\u003dchunk_size),"},{"line_number":222,"context_line":"                chunk_size or self.get_size(location))"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def get_size(self, location, context\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_dc452616","side":"PARENT","line":221,"updated":"2014-11-20 17:53:06.000000000","message":"The reason why I change this is:\n\nAt L162, whatever we pass any value of chunk_size, all image content will be read and returned to client/glance.","commit_id":"221fc84fba35bfb3f766bd7406ace7be59415bbb"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"3386400330098eee1bf707e179ea600e67e084f5","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                        from glance_store.location.get_location_from_uri()"},{"line_number":220,"context_line":"        :raises `glance_store.exceptions.NotFound` if image does not exist"},{"line_number":221,"context_line":"        \"\"\""},{"line_number":222,"context_line":"        loc \u003d location.store_location"},{"line_number":223,"context_line":"        return (ImageIterator(loc.pool, loc.image, loc.snapshot, self),"},{"line_number":224,"context_line":"                self.get_size(location))"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_58575226","line":222,"updated":"2015-02-17 17:36:08.000000000","message":"Same thing here regarding the chunk_size parameter?","commit_id":"6c6503adf5ff81a217c379eedfef5cfe487eaf64"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b750d83c6a4615ad68b94c3a31fbae721ec77d4d","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                        from glance_store.location.get_location_from_uri()"},{"line_number":220,"context_line":"        :raises `glance_store.exceptions.NotFound` if image does not exist"},{"line_number":221,"context_line":"        \"\"\""},{"line_number":222,"context_line":"        loc \u003d location.store_location"},{"line_number":223,"context_line":"        return (ImageIterator(loc.pool, loc.image, loc.snapshot, self),"},{"line_number":224,"context_line":"                self.get_size(location))"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_07eed68b","line":222,"in_reply_to":"da86d52c_136cdd35","updated":"2015-03-04 05:32:02.000000000","message":"@Ian, ditto\n\n@Gorka, currently I\u0027d like to use this minor patch to make store drivers stay back to a correct position, to adding other capabilities to store is a separated idea (but worth to have in near feature).","commit_id":"6c6503adf5ff81a217c379eedfef5cfe487eaf64"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4f1ead2b15f46aac64c9fd6c00835ce954111c41","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                        from glance_store.location.get_location_from_uri()"},{"line_number":220,"context_line":"        :raises `glance_store.exceptions.NotFound` if image does not exist"},{"line_number":221,"context_line":"        \"\"\""},{"line_number":222,"context_line":"        loc \u003d location.store_location"},{"line_number":223,"context_line":"        return (ImageIterator(loc.pool, loc.image, loc.snapshot, self),"},{"line_number":224,"context_line":"                self.get_size(location))"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_136cdd35","line":222,"in_reply_to":"da86d52c_58575226","updated":"2015-02-18 08:22:05.000000000","message":"Why will the chunck_size parameter be removed instead of implementing its functionality together with the offset parameter (READ_RANDOM)?\n\n(Sorry if my question doesn\u0027t make any sense, I\u0027m new here)","commit_id":"6c6503adf5ff81a217c379eedfef5cfe487eaf64"}],"glance_store/_drivers/s3.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"2df79b9f33fc91809059cdab74b9fe1ff30da081","unresolved":false,"context_lines":[{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        key \u003d self._retrieve_key(location)"},{"line_number":378,"context_line":"        cs \u003d chunk_size or self.READ_CHUNKSIZE"},{"line_number":379,"context_line":"        key.BufferSize \u003d cs"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":"        class ChunkedIndexable(glance_store.Indexable):"},{"line_number":382,"context_line":"            def another(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_922387a6","side":"PARENT","line":379,"updated":"2014-11-20 17:53:06.000000000","message":"The reason why I change this is:\n\n\u0027cs\u0027 param could only control the unit (\u0027buffer\u0027) for internal read operation, finally the whole content will be returned.\n\nAlso at L386, the size of complete image content return whatever \u0027chunk_size\u0027 param required.","commit_id":"221fc84fba35bfb3f766bd7406ace7be59415bbb"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"e592e536638a8933fc5e1e39f6c9d732135b84df","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        :raises `glance_store.exceptions.NotFound` if image does not exist"},{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        key \u003d self._retrieve_key(location)"},{"line_number":378,"context_line":"        cs \u003d self.READ_CHUNKSIZE"},{"line_number":379,"context_line":"        key.BufferSize \u003d cs"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":"        class ChunkedIndexable(glance_store.Indexable):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_f2d04255","line":378,"updated":"2014-11-20 22:14:17.000000000","message":"So this can rather confusing. For one thing it doesn\u0027t need such a short name that\u0027s uninformative. For another, this binding is used in the class definition below. Why are we defining a new class everytime we go through this function instead of having a solitary class that subclasses glance_store.Indexable and accepts the chunksize parameter? I guess I\u0027m also confused why we\u0027re passing a chunked file and explicitly accessing the wrapped file to read data in chunks if ChunkedFile should already take care of that for us (in one way or another).","commit_id":"c9dd736f7413f180a18bb34e4a89d838f0b52a32"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"3386400330098eee1bf707e179ea600e67e084f5","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                        from glance_store.location.get_location_from_uri()"},{"line_number":378,"context_line":"        :raises `glance_store.exceptions.NotFound` if image does not exist"},{"line_number":379,"context_line":"        \"\"\""},{"line_number":380,"context_line":"        key \u003d self._retrieve_key(location)"},{"line_number":381,"context_line":"        cs \u003d self.READ_CHUNKSIZE"},{"line_number":382,"context_line":"        key.BufferSize \u003d cs"},{"line_number":383,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_d83a62e6","line":380,"updated":"2015-02-17 17:36:08.000000000","message":"And here?","commit_id":"6c6503adf5ff81a217c379eedfef5cfe487eaf64"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b750d83c6a4615ad68b94c3a31fbae721ec77d4d","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                        from glance_store.location.get_location_from_uri()"},{"line_number":378,"context_line":"        :raises `glance_store.exceptions.NotFound` if image does not exist"},{"line_number":379,"context_line":"        \"\"\""},{"line_number":380,"context_line":"        key \u003d self._retrieve_key(location)"},{"line_number":381,"context_line":"        cs \u003d self.READ_CHUNKSIZE"},{"line_number":382,"context_line":"        key.BufferSize \u003d cs"},{"line_number":383,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_67edd28b","line":380,"in_reply_to":"da86d52c_d83a62e6","updated":"2015-03-04 05:32:02.000000000","message":"ditto","commit_id":"6c6503adf5ff81a217c379eedfef5cfe487eaf64"}],"glance_store/_drivers/sheepdog.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"2df79b9f33fc91809059cdab74b9fe1ff30da081","unresolved":false,"context_lines":[{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        loc \u003d location.store_location"},{"line_number":224,"context_line":"        image \u003d SheepdogImage(self.addr, self.port, loc.image,"},{"line_number":225,"context_line":"                              chunk_size or self.READ_CHUNKSIZE)"},{"line_number":226,"context_line":"        if not image.exist():"},{"line_number":227,"context_line":"            raise exceptions.NotFound(_(\"Sheepdog image %s does not exist\")"},{"line_number":228,"context_line":"                                      % image.name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_b267a3e9","side":"PARENT","line":225,"updated":"2014-11-20 17:53:06.000000000","message":"Key point at L164, all image content will be loaded even chunk_size just required a part of image (size).","commit_id":"221fc84fba35bfb3f766bd7406ace7be59415bbb"}]}
