)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"89209d72e2bf9817c782f07e6a499826c2736611","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add db.instance_get_by_sort_filters()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds a method to the DB API that lets us query out the next"},{"line_number":10,"context_line":"instance for a sort query, but without a marker UUID. If the marker"},{"line_number":11,"context_line":"is from another cell, we\u0027ll need to resume the pagination sequence"},{"line_number":12,"context_line":"based on the sort keys and the values from the marker instance."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This adds the method and a test to be used later."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7f515b1d_cdbebafe","line":12,"range":{"start_line":10,"start_character":54,"end_line":12,"end_character":63},"updated":"2017-09-21 23:38:47.000000000","message":"I assume this is explaining why we need this method, right? To be used later when we have a problem where the marker isn\u0027t found in a given cell.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"33f4072493447e44e90cc65db21b914880417d5c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add db.instance_get_by_sort_filters()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds a method to the DB API that lets us query out the next"},{"line_number":10,"context_line":"instance for a sort query, but without a marker UUID. If the marker"},{"line_number":11,"context_line":"is from another cell, we\u0027ll need to resume the pagination sequence"},{"line_number":12,"context_line":"based on the sort keys and the values from the marker instance."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This adds the method and a test to be used later."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7f515b1d_10406935","line":12,"range":{"start_line":10,"start_character":54,"end_line":12,"end_character":63},"in_reply_to":"7f515b1d_cdbebafe","updated":"2017-09-22 00:31:09.000000000","message":"It\u0027s used by the pagination patch to get the local marker for the cells that didn\u0027t have the global marker.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"}],"nova/db/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"89209d72e2bf9817c782f07e6a499826c2736611","unresolved":false,"context_lines":[{"line_number":782,"context_line":"        sort_dirs\u003dsort_dirs)"},{"line_number":783,"context_line":""},{"line_number":784,"context_line":""},{"line_number":785,"context_line":"def instance_get_by_sort_filters(context, sort_keys, sort_dirs, values):"},{"line_number":786,"context_line":"    return IMPL.instance_get_by_sort_filters(context, sort_keys, sort_dirs,"},{"line_number":787,"context_line":"                                             values)"},{"line_number":788,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_db5b1752","line":785,"updated":"2017-09-21 23:38:47.000000000","message":"nit: docstring would be good","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f58ca5d28222a9a33fb8e41735e9dc753e5f5b82","unresolved":false,"context_lines":[{"line_number":2280,"context_line":"def instance_get_by_sort_filters(context, sort_keys, sort_dirs, values):"},{"line_number":2281,"context_line":"    \"\"\"Attempt to get a single instance based on a combination of sort"},{"line_number":2282,"context_line":"    keys, directions and filter values. This is used to try to find a"},{"line_number":2283,"context_line":"    marker instance when we don\u0027t have a marker uuid."},{"line_number":2284,"context_line":""},{"line_number":2285,"context_line":"    \"\"\""},{"line_number":2286,"context_line":"    query \u003d context.session.query(models.Instance.uuid)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf57530f_4b3bd99b","line":2283,"updated":"2017-09-20 00:15:07.000000000","message":"This could use expanding, like saying it\u0027s returning a uuid.","commit_id":"f6cc05e533e3b891762fa68adc17e8ffbadaf068"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"89209d72e2bf9817c782f07e6a499826c2736611","unresolved":false,"context_lines":[{"line_number":2278,"context_line":"@require_context"},{"line_number":2279,"context_line":"@pick_context_manager_reader_allow_async"},{"line_number":2280,"context_line":"def instance_get_by_sort_filters(context, sort_keys, sort_dirs, values):"},{"line_number":2281,"context_line":"    \"\"\"Attempt to get a single instance based on a combination of sort"},{"line_number":2282,"context_line":"    keys, directions and filter values. This is used to try to find a"},{"line_number":2283,"context_line":"    marker instance when we don\u0027t have a marker uuid."},{"line_number":2284,"context_line":""},{"line_number":2285,"context_line":"    This returns just a uuid of the instance that matched."},{"line_number":2286,"context_line":"    \"\"\""},{"line_number":2287,"context_line":"    query \u003d context.session.query(models.Instance.uuid)"},{"line_number":2288,"context_line":"    for skey, sdir, val in zip(sort_keys, sort_dirs, values):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_4df2ca08","line":2285,"range":{"start_line":2281,"start_character":4,"end_line":2285,"end_character":58},"updated":"2017-09-21 23:38:47.000000000","message":"what if we have more than one instance with a sort key/filter value that are the same? we just pick the first, but does that cause any problems?","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"33f4072493447e44e90cc65db21b914880417d5c","unresolved":false,"context_lines":[{"line_number":2278,"context_line":"@require_context"},{"line_number":2279,"context_line":"@pick_context_manager_reader_allow_async"},{"line_number":2280,"context_line":"def instance_get_by_sort_filters(context, sort_keys, sort_dirs, values):"},{"line_number":2281,"context_line":"    \"\"\"Attempt to get a single instance based on a combination of sort"},{"line_number":2282,"context_line":"    keys, directions and filter values. This is used to try to find a"},{"line_number":2283,"context_line":"    marker instance when we don\u0027t have a marker uuid."},{"line_number":2284,"context_line":""},{"line_number":2285,"context_line":"    This returns just a uuid of the instance that matched."},{"line_number":2286,"context_line":"    \"\"\""},{"line_number":2287,"context_line":"    query \u003d context.session.query(models.Instance.uuid)"},{"line_number":2288,"context_line":"    for skey, sdir, val in zip(sort_keys, sort_dirs, values):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_506f01c5","line":2285,"range":{"start_line":2281,"start_character":4,"end_line":2285,"end_character":58},"in_reply_to":"7f515b1d_4df2ca08","updated":"2017-09-22 00:31:09.000000000","message":"Yeah if you have a lot of things that are dupes based on the sort_key you could get some dupes around the page edges. However, you can get dupes around the page edges today if something is created between page calls that change the ordering.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f6f84dc6d7c47754fc06c8b01429677e2264de08","unresolved":false,"context_lines":[{"line_number":2296,"context_line":"    # be looking for, so just return nothing if no match."},{"line_number":2297,"context_line":"    result \u003d query.limit(1).first()"},{"line_number":2298,"context_line":"    if result:"},{"line_number":2299,"context_line":"        return result[0]"},{"line_number":2300,"context_line":"    else:"},{"line_number":2301,"context_line":"        return result"},{"line_number":2302,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_9b559f20","line":2299,"range":{"start_line":2299,"start_character":21,"end_line":2299,"end_character":24},"updated":"2017-09-21 23:42:14.000000000","message":"What does this do if we already called first()? Can\u0027t we just return \u0027result\u0027 in all cases?","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"49b3ce0f54d862dfc9aac4324ac22c9067afc667","unresolved":false,"context_lines":[{"line_number":2296,"context_line":"    # be looking for, so just return nothing if no match."},{"line_number":2297,"context_line":"    result \u003d query.limit(1).first()"},{"line_number":2298,"context_line":"    if result:"},{"line_number":2299,"context_line":"        return result[0]"},{"line_number":2300,"context_line":"    else:"},{"line_number":2301,"context_line":"        return result"},{"line_number":2302,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_50f26108","line":2299,"range":{"start_line":2299,"start_character":21,"end_line":2299,"end_character":24},"in_reply_to":"7f515b1d_106989bd","updated":"2017-09-22 00:39:22.000000000","message":"Ah okay, thanks. Didn\u0027t know that about the column query (models.Instance.uuid).","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"33f4072493447e44e90cc65db21b914880417d5c","unresolved":false,"context_lines":[{"line_number":2296,"context_line":"    # be looking for, so just return nothing if no match."},{"line_number":2297,"context_line":"    result \u003d query.limit(1).first()"},{"line_number":2298,"context_line":"    if result:"},{"line_number":2299,"context_line":"        return result[0]"},{"line_number":2300,"context_line":"    else:"},{"line_number":2301,"context_line":"        return result"},{"line_number":2302,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_106989bd","line":2299,"range":{"start_line":2299,"start_character":21,"end_line":2299,"end_character":24},"in_reply_to":"7f515b1d_9b559f20","updated":"2017-09-22 00:31:09.000000000","message":"Since we\u0027re querying for a column, we get back a tuple (of one thing). So .first() gives us the first row, and this gives us the first (and only) column in the tuple.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"}],"nova/tests/unit/db/test_db_api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"10efc7c2a7966b5211f849deaa046646b3e93fed","unresolved":false,"context_lines":[{"line_number":10785,"context_line":"            db_instance \u003d db.instance_create(self.context, inst)"},{"line_number":10786,"context_line":"            self.instances.append(db_instance)"},{"line_number":10787,"context_line":""},{"line_number":10788,"context_line":"    def test_thing(self):"},{"line_number":10789,"context_line":"        # Pull out the first instance sorted by our desired key"},{"line_number":10790,"context_line":"        first \u003d db.instance_get_all_by_filters_sort(self.context, {}, limit\u003d1,"},{"line_number":10791,"context_line":"                                                    sort_keys\u003d[\u0027memory_mb\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f5c4f37_c831f9ee","line":10788,"range":{"start_line":10788,"start_character":8,"end_line":10788,"end_character":18},"updated":"2017-09-21 12:50:55.000000000","message":":)","commit_id":"d8762954851c5adccdde3201076551d5228c2e29"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"89209d72e2bf9817c782f07e6a499826c2736611","unresolved":false,"context_lines":[{"line_number":10771,"context_line":"        td \u003d datetime.timedelta"},{"line_number":10772,"context_line":""},{"line_number":10773,"context_line":"        values \u003d {"},{"line_number":10774,"context_line":"            \u0027key_name\u0027: [\u0027dan\u0027, \u0027dan\u0027, \u0027taylor\u0027, \u0027jax\u0027],"},{"line_number":10775,"context_line":"            \u0027memory_mb\u0027: [512, 1024, 2048, 256],"},{"line_number":10776,"context_line":"            \u0027launched_at\u0027: [launched + td(1), launched - td(256),"},{"line_number":10777,"context_line":"                            launched + td(32), launched - td(5000)],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_6d2c6699","line":10774,"range":{"start_line":10774,"start_character":24,"end_line":10774,"end_character":56},"updated":"2017-09-21 23:38:47.000000000","message":"aww","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"33f4072493447e44e90cc65db21b914880417d5c","unresolved":false,"context_lines":[{"line_number":10771,"context_line":"        td \u003d datetime.timedelta"},{"line_number":10772,"context_line":""},{"line_number":10773,"context_line":"        values \u003d {"},{"line_number":10774,"context_line":"            \u0027key_name\u0027: [\u0027dan\u0027, \u0027dan\u0027, \u0027taylor\u0027, \u0027jax\u0027],"},{"line_number":10775,"context_line":"            \u0027memory_mb\u0027: [512, 1024, 2048, 256],"},{"line_number":10776,"context_line":"            \u0027launched_at\u0027: [launched + td(1), launched - td(256),"},{"line_number":10777,"context_line":"                            launched + td(32), launched - td(5000)],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_909a19c3","line":10774,"range":{"start_line":10774,"start_character":24,"end_line":10774,"end_character":56},"in_reply_to":"7f515b1d_6d2c6699","updated":"2017-09-22 00:31:09.000000000","message":"...and only we know the significance of the launched date above.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"89209d72e2bf9817c782f07e6a499826c2736611","unresolved":false,"context_lines":[{"line_number":10790,"context_line":"        first \u003d db.instance_get_all_by_filters_sort(self.context, {}, limit\u003d1,"},{"line_number":10791,"context_line":"                                                    sort_keys\u003d[\u0027memory_mb\u0027],"},{"line_number":10792,"context_line":"                                                    sort_dirs\u003d[\u0027asc\u0027])"},{"line_number":10793,"context_line":"        marker \u003d first[0][\u0027uuid\u0027]"},{"line_number":10794,"context_line":""},{"line_number":10795,"context_line":"        # Starting with the marker, page through one at a time looking for the"},{"line_number":10796,"context_line":"        # instance that would match if the previous marker was our marker."}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_cd491a61","line":10793,"range":{"start_line":10793,"start_character":8,"end_line":10793,"end_character":33},"updated":"2017-09-21 23:38:47.000000000","message":"assert that the marker is the uuid of self.instances[3], which has the smallest memory_mb and you\u0027re sorting ascending.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"33f4072493447e44e90cc65db21b914880417d5c","unresolved":false,"context_lines":[{"line_number":10790,"context_line":"        first \u003d db.instance_get_all_by_filters_sort(self.context, {}, limit\u003d1,"},{"line_number":10791,"context_line":"                                                    sort_keys\u003d[\u0027memory_mb\u0027],"},{"line_number":10792,"context_line":"                                                    sort_dirs\u003d[\u0027asc\u0027])"},{"line_number":10793,"context_line":"        marker \u003d first[0][\u0027uuid\u0027]"},{"line_number":10794,"context_line":""},{"line_number":10795,"context_line":"        # Starting with the marker, page through one at a time looking for the"},{"line_number":10796,"context_line":"        # instance that would match if the previous marker was our marker."}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_f0aa6dd0","line":10793,"range":{"start_line":10793,"start_character":8,"end_line":10793,"end_character":33},"in_reply_to":"7f515b1d_cd491a61","updated":"2017-09-22 00:31:09.000000000","message":"Is that a question?","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a2e8452e539d689a056536e9009b8aa353c8ade5","unresolved":false,"context_lines":[{"line_number":10790,"context_line":"        first \u003d db.instance_get_all_by_filters_sort(self.context, {}, limit\u003d1,"},{"line_number":10791,"context_line":"                                                    sort_keys\u003d[\u0027memory_mb\u0027],"},{"line_number":10792,"context_line":"                                                    sort_dirs\u003d[\u0027asc\u0027])"},{"line_number":10793,"context_line":"        marker \u003d first[0][\u0027uuid\u0027]"},{"line_number":10794,"context_line":""},{"line_number":10795,"context_line":"        # Starting with the marker, page through one at a time looking for the"},{"line_number":10796,"context_line":"        # instance that would match if the previous marker was our marker."}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_50b5c1ed","line":10793,"range":{"start_line":10793,"start_character":8,"end_line":10793,"end_character":33},"in_reply_to":"7f515b1d_d0ef71e7","updated":"2017-09-22 00:48:13.000000000","message":"I guess you could throw that into the change at the end of the series.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00fad48da37966b2561634592e816940f6f4ff43","unresolved":false,"context_lines":[{"line_number":10790,"context_line":"        first \u003d db.instance_get_all_by_filters_sort(self.context, {}, limit\u003d1,"},{"line_number":10791,"context_line":"                                                    sort_keys\u003d[\u0027memory_mb\u0027],"},{"line_number":10792,"context_line":"                                                    sort_dirs\u003d[\u0027asc\u0027])"},{"line_number":10793,"context_line":"        marker \u003d first[0][\u0027uuid\u0027]"},{"line_number":10794,"context_line":""},{"line_number":10795,"context_line":"        # Starting with the marker, page through one at a time looking for the"},{"line_number":10796,"context_line":"        # instance that would match if the previous marker was our marker."}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_d0ef71e7","line":10793,"range":{"start_line":10793,"start_character":8,"end_line":10793,"end_character":33},"in_reply_to":"7f515b1d_f0aa6dd0","updated":"2017-09-22 00:47:26.000000000","message":"Kind of, asking if we should add an assertion.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dde58a252b849356df8664b04718c1ee2f0858d4","unresolved":false,"context_lines":[{"line_number":10802,"context_line":"                self.context,"},{"line_number":10803,"context_line":"                [\u0027memory_mb\u0027],"},{"line_number":10804,"context_line":"                [\u0027asc\u0027],"},{"line_number":10805,"context_line":"                [marker_inst[\u0027memory_mb\u0027] + 1,"},{"line_number":10806,"context_line":"                 marker_inst[\u0027key_name\u0027] + \u0027z\u0027])"},{"line_number":10807,"context_line":"            if not marker:"},{"line_number":10808,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_d0abf172","line":10805,"range":{"start_line":10805,"start_character":17,"end_line":10805,"end_character":45},"updated":"2017-09-22 00:54:53.000000000","message":"OK so we\u0027d start with the 256 instance, then to find the next marker, we get the next one that is after 256+1, which would be the 512 instance, and then that becomes our marker, and so on. Might be worth a comment in here.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dde58a252b849356df8664b04718c1ee2f0858d4","unresolved":false,"context_lines":[{"line_number":10803,"context_line":"                [\u0027memory_mb\u0027],"},{"line_number":10804,"context_line":"                [\u0027asc\u0027],"},{"line_number":10805,"context_line":"                [marker_inst[\u0027memory_mb\u0027] + 1,"},{"line_number":10806,"context_line":"                 marker_inst[\u0027key_name\u0027] + \u0027z\u0027])"},{"line_number":10807,"context_line":"            if not marker:"},{"line_number":10808,"context_line":"                break"},{"line_number":10809,"context_line":"            values_found.append(marker)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_309da559","line":10806,"range":{"start_line":10806,"start_character":17,"end_line":10806,"end_character":47},"updated":"2017-09-22 00:54:53.000000000","message":"Kind of confused why this is here, just to show it\u0027s not used or?","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"89209d72e2bf9817c782f07e6a499826c2736611","unresolved":false,"context_lines":[{"line_number":10815,"context_line":"    def test_no_match(self):"},{"line_number":10816,"context_line":"        marker \u003d db.instance_get_by_sort_filters(self.context,"},{"line_number":10817,"context_line":"                                                 [\u0027memory_mb\u0027], [\u0027asc\u0027],"},{"line_number":10818,"context_line":"                                                 [4096])"},{"line_number":10819,"context_line":"        self.assertIsNone(marker)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_2d5b0e2f","line":10818,"range":{"start_line":10818,"start_character":49,"end_line":10818,"end_character":55},"updated":"2017-09-21 23:38:47.000000000","message":"OK no match because there are no instances with memory_mb of 4096.","commit_id":"10afb31402f6c14f0c58d6e44e5ae7692c037c00"}]}
