)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"ae33601d49694eb8da95806029a94884f6fe6f2c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"This patch tries to provide random access read to the driver using"},{"line_number":12,"context_line":"parameters offset and chunk in the following way:"},{"line_number":13,"context_line":"offset: the Byte count (position) from the start of the image"},{"line_number":14,"context_line":"chunk_size: the total number of bytes we want to be readusing parameters"},{"line_number":15,"context_line":"offset and chunk."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"So get method returns an iterator that will return blocks of"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"fa1b9901_0a005ca9","line":14,"updated":"2015-08-19 09:42:13.000000000","message":"read using* (since you have to submit a new PS anyway)","commit_id":"23f56d6dde25bc6f1cf4e1655f8a00023053b676"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"1f3453a9811f70445f29c9ff60a5979c2fc09576","unresolved":false,"context_lines":[{"line_number":11,"context_line":"This patch tries to provide random access read to the driver using"},{"line_number":12,"context_line":"parameters offset and chunk in the following way:"},{"line_number":13,"context_line":"offset: the Byte count (position) from the start of the image"},{"line_number":14,"context_line":"chunk_size: the total number of bytes we want to be readusing parameters"},{"line_number":15,"context_line":"offset and chunk."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"So get method returns an iterator that will return blocks of"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"fa1b9901_72af8e94","line":14,"in_reply_to":"fa1b9901_0a005ca9","updated":"2015-08-19 10:41:24.000000000","message":"Done","commit_id":"23f56d6dde25bc6f1cf4e1655f8a00023053b676"},{"author":{"_account_id":9064,"name":"Danny Al-Gaaf","email":"danny.al-gaaf@bisect.de","username":"dalgaaf"},"change_message_id":"e5be24e03704dcea7d41b48d9f9c43f972a3d55b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Currently RBD driver does not make use of an offset and a chunk_size"},{"line_number":10,"context_line":"parameters."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch provides a random access read to the driver using offset"},{"line_number":13,"context_line":"and chunk_size parameters in the following way:"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"offset: the byte count (position) from the start of the image"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"5a18252c_bcfc1773","line":12,"range":{"start_line":12,"start_character":22,"end_line":12,"end_character":35},"updated":"2016-04-14 10:23:02.000000000","message":"I would recommend to change this to : \"This patch provides partial read if image data to the driver ...\" since this has nothing to do with random access. There is nothing random in here the range is well defined by offset and lenght of the read/get operation.","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"}],"glance_store/_drivers/rbd.py":[{"author":{"_account_id":9064,"name":"Danny Al-Gaaf","email":"danny.al-gaaf@bisect.de","username":"dalgaaf"},"change_message_id":"e5be24e03704dcea7d41b48d9f9c43f972a3d55b","unresolved":false,"context_lines":[{"line_number":169,"context_line":"    def __iter__(self):"},{"line_number":170,"context_line":"        if self.chunk_size \u003d\u003d 0:"},{"line_number":171,"context_line":"            raise StopIteration"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        try:"},{"line_number":174,"context_line":"            with self.store.get_connection(conffile\u003dself.conf_file,"},{"line_number":175,"context_line":"                                           rados_id\u003dself.user) as conn:"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_7c655f1c","line":172,"updated":"2016-04-14 10:23:02.000000000","message":"We need here (or some lines down) probably some more save guards to check if the range we try to read exceeds the size of the image.\n\ne.g.:\n\nif (self.offset \u003e size):\n raise IndexError(_(\u0027offset out of range\u0027))\nif (self.chunk_size \u003e (size - self.offset)):\n raise ValueError(_(\u0027range larger than size\u0027))\n\nSince glance use Content-Range for this there are some expectations like that it should return only the requested range. If it can\u0027t be read because it\u0027s out of range or if there is a request to read more data than available we should fail here.","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"644b53dcde6c92cb6658c10c7c257f0aae8ef0e8","unresolved":false,"context_lines":[{"line_number":169,"context_line":"    def __iter__(self):"},{"line_number":170,"context_line":"        if self.chunk_size \u003d\u003d 0:"},{"line_number":171,"context_line":"            raise StopIteration"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        try:"},{"line_number":174,"context_line":"            with self.store.get_connection(conffile\u003dself.conf_file,"},{"line_number":175,"context_line":"                                           rados_id\u003dself.user) as conn:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_3e7dc7e7","line":172,"in_reply_to":"5a18252c_7c655f1c","updated":"2016-06-07 14:47:50.000000000","message":"Done","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":9064,"name":"Danny Al-Gaaf","email":"danny.al-gaaf@bisect.de","username":"dalgaaf"},"change_message_id":"e5be24e03704dcea7d41b48d9f9c43f972a3d55b","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                                                   reason\u003dreason)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    @capabilities.check"},{"line_number":250,"context_line":"    def get(self, location, offset\u003d0, chunk_size\u003dNone, context\u003dNone):"},{"line_number":251,"context_line":"        \"\"\""},{"line_number":252,"context_line":"        Takes a `glance_store.location.Location` object that indicates"},{"line_number":253,"context_line":"        where to find the image file, and returns a tuple of generator"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_7ceb9f13","line":250,"range":{"start_line":250,"start_character":38,"end_line":250,"end_character":48},"updated":"2016-04-14 10:23:02.000000000","message":"See comment below, maybe it would be more clear if we change the parameter name to avoid collision with e.g. READ_CHUNKSIZE like chunk size.","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"644b53dcde6c92cb6658c10c7c257f0aae8ef0e8","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                                                   reason\u003dreason)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    @capabilities.check"},{"line_number":250,"context_line":"    def get(self, location, offset\u003d0, chunk_size\u003dNone, context\u003dNone):"},{"line_number":251,"context_line":"        \"\"\""},{"line_number":252,"context_line":"        Takes a `glance_store.location.Location` object that indicates"},{"line_number":253,"context_line":"        where to find the image file, and returns a tuple of generator"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_132f19f7","line":250,"range":{"start_line":250,"start_character":38,"end_line":250,"end_character":48},"in_reply_to":"5a18252c_7ceb9f13","updated":"2016-06-07 14:47:50.000000000","message":"Done","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"d9a92636fb0b13d40e0027e9391ebd4dba38439d","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        will return)."},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        Iterator will return blocks of self.READ_CHUNKSIZE size until it"},{"line_number":258,"context_line":"        reaches chunk_size or end of image."},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        :param location `glance_store.location.Location` object, supplied"},{"line_number":261,"context_line":"                        from glance_store.location.get_location_from_uri()"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a57f1b5_00759362","line":258,"updated":"2016-02-11 22:21:21.000000000","message":"AFAIU, we should read the whole image to Glance.\nChunk size defines size of image pieces (i.e. defines how to transfer images).","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":9064,"name":"Danny Al-Gaaf","email":"danny.al-gaaf@bisect.de","username":"dalgaaf"},"change_message_id":"e5be24e03704dcea7d41b48d9f9c43f972a3d55b","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        will return)."},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        Iterator will return blocks of self.READ_CHUNKSIZE size until it"},{"line_number":258,"context_line":"        reaches chunk_size or end of image."},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        :param location `glance_store.location.Location` object, supplied"},{"line_number":261,"context_line":"                        from glance_store.location.get_location_from_uri()"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_99384d3f","line":258,"in_reply_to":"3a57f1b5_00759362","updated":"2016-04-14 10:23:02.000000000","message":"Not if you check what glance is doing here. It uses Content-Range to get the data from the image. Therefore is should only read until chunk_size (the range) was read and not until the end of the image if it was not requested.","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"d9a92636fb0b13d40e0027e9391ebd4dba38439d","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        loc \u003d location.store_location"},{"line_number":267,"context_line":"        return (ImageIterator(loc.pool, loc.image, loc.snapshot, self,"},{"line_number":268,"context_line":"                              chunk_size\u003dchunk_size, offset\u003doffset),"},{"line_number":269,"context_line":"                chunk_size or self.get_size(location))"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def get_size(self, location, context\u003dNone):"},{"line_number":272,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"3a57f1b5_00fcb3b6","line":269,"updated":"2016-02-11 22:21:21.000000000","message":"If I call \nstore.get(.., chunk_size, ..) \nthen I would probably expect the whole image to be read.\nSo I think we need delete \"chunk_size or\" here and use something like:\nself.get_size(location - offset) here.\nI also notices that filesystem does the same so we need to fix that there.","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":9064,"name":"Danny Al-Gaaf","email":"danny.al-gaaf@bisect.de","username":"dalgaaf"},"change_message_id":"e5be24e03704dcea7d41b48d9f9c43f972a3d55b","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        loc \u003d location.store_location"},{"line_number":267,"context_line":"        return (ImageIterator(loc.pool, loc.image, loc.snapshot, self,"},{"line_number":268,"context_line":"                              chunk_size\u003dchunk_size, offset\u003doffset),"},{"line_number":269,"context_line":"                chunk_size or self.get_size(location))"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def get_size(self, location, context\u003dNone):"},{"line_number":272,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_bc1ed75c","line":269,"in_reply_to":"3a57f1b5_00fcb3b6","updated":"2016-04-14 10:23:02.000000000","message":"IMO the name of the parameter is really misleading. It must be differentiated between chunk_size (meaning how large the chunks should be in general, but this is already handled in store.READ_CHUNKSIZE) and the range that needs to be read. \n\nThe parameter should probably be called range_length or something like that. to be more clear.","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"644b53dcde6c92cb6658c10c7c257f0aae8ef0e8","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        loc \u003d location.store_location"},{"line_number":267,"context_line":"        return (ImageIterator(loc.pool, loc.image, loc.snapshot, self,"},{"line_number":268,"context_line":"                              chunk_size\u003dchunk_size, offset\u003doffset),"},{"line_number":269,"context_line":"                chunk_size or self.get_size(location))"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def get_size(self, location, context\u003dNone):"},{"line_number":272,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_f877cc37","line":269,"in_reply_to":"5a18252c_bc1ed75c","updated":"2016-06-07 14:47:50.000000000","message":"I renamed it \"length\".","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"}],"glance_store/tests/unit/test_rbd_store.py":[{"author":{"_account_id":9064,"name":"Danny Al-Gaaf","email":"danny.al-gaaf@bisect.de","username":"dalgaaf"},"change_message_id":"e5be24e03704dcea7d41b48d9f9c43f972a3d55b","unresolved":false,"context_lines":[{"line_number":431,"context_line":""},{"line_number":432,"context_line":"    @mock.patch.object(MockRBD.Image, \u0027read\u0027)"},{"line_number":433,"context_line":"    @mock.patch.object(MockRBD.Image, \u0027stat\u0027, return_value\u003d{\u0027size\u0027: FILE_SIZE})"},{"line_number":434,"context_line":"    def test_get_random_access(self, stat_mock, read_mock):"},{"line_number":435,"context_line":"        \"\"\"Test a random (with offset and chunk size) retrieval of an image.\"\"\""},{"line_number":436,"context_line":"        # First fake the image"},{"line_number":437,"context_line":"        read_mock.side_effect \u003d self._fake_read"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_1c16ebf0","line":434,"range":{"start_line":434,"start_character":17,"end_line":434,"end_character":23},"updated":"2016-04-14 10:23:02.000000000","message":"Can we change this to a different name since this is not about random access it\u0027s about read a range, there is nothing random involved. IMO the name of the whole feature is wrong.","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"644b53dcde6c92cb6658c10c7c257f0aae8ef0e8","unresolved":false,"context_lines":[{"line_number":431,"context_line":""},{"line_number":432,"context_line":"    @mock.patch.object(MockRBD.Image, \u0027read\u0027)"},{"line_number":433,"context_line":"    @mock.patch.object(MockRBD.Image, \u0027stat\u0027, return_value\u003d{\u0027size\u0027: FILE_SIZE})"},{"line_number":434,"context_line":"    def test_get_random_access(self, stat_mock, read_mock):"},{"line_number":435,"context_line":"        \"\"\"Test a random (with offset and chunk size) retrieval of an image.\"\"\""},{"line_number":436,"context_line":"        # First fake the image"},{"line_number":437,"context_line":"        read_mock.side_effect \u003d self._fake_read"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_b378c5c5","line":434,"range":{"start_line":434,"start_character":17,"end_line":434,"end_character":23},"in_reply_to":"5a18252c_1c16ebf0","updated":"2016-06-07 14:47:50.000000000","message":"Done","commit_id":"44e648fdb6a51458feb3e0013e50b74f850f4602"}]}
