)]}'
{"doc/source/indexingservice.rst":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"f997449044fa47f355b9a8d2ccbccde2b987fe82","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    $ searchlight-manage index sync --type OS::Designate::Zone"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    Resource types (and indices) matching selection:"},{"line_number":100,"context_line":"      OS::Designate::Zone (designate)  --\u003e  OS::Designate::RecordSet"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"Incremental Updates"},{"line_number":103,"context_line":"-------------------"}],"source_content_type":"text/x-rst","patch_set":5,"id":"5a5ae5dd_f6c82524","line":100,"updated":"2016-02-05 22:47:15.000000000","message":"This is somewhat confusing and won\u0027t scale if there are multiple children and multiple nested children. Maybe indent would work.\n\n OS::Designate::Zone (designate)\n    --\u003e  OS::Designate::RecordSet\n    --\u003e  OS::Designate::Child1\n       --\u003e  OS::Designate::Grandchild\n    --\u003e  OS::Designate::Foo","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"800e411aae9b1805ba86dee30fe08de7f71be881","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    $ searchlight-manage index sync --type OS::Designate::Zone"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    Resource types (and indices) matching selection:"},{"line_number":100,"context_line":"      OS::Designate::Zone (designate)  --\u003e  OS::Designate::RecordSet"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"Incremental Updates"},{"line_number":103,"context_line":"-------------------"}],"source_content_type":"text/x-rst","patch_set":5,"id":"5a5ae5dd_a781c7c4","line":100,"in_reply_to":"5a5ae5dd_f6c82524","updated":"2016-02-08 23:30:43.000000000","message":"I would be inclined to try to avoid grandchildren, but point taken, will correct it","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"}],"searchlight/common/utils.py":[{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"5db18eaf0e6ca06e747c4a2d7d46aaa647b64275","unresolved":false,"context_lines":[{"line_number":435,"context_line":"    plugins \u003d {plugin.obj.get_document_type(): plugin"},{"line_number":436,"context_line":"               for plugin in ext_manager.extensions if plugin.obj.enabled}"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    # Set up any parent/child relationships"},{"line_number":439,"context_line":"    for plugin_type, loaded_plugin in six.iteritems(plugins):"},{"line_number":440,"context_line":"        if loaded_plugin.obj.parent_plugin_name():"},{"line_number":441,"context_line":"            LOG.debug(\"Setting up link between parent (%s) and child (%s)\""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_e4aca4a0","line":438,"updated":"2016-02-02 02:34:03.000000000","message":"I think this should be done somewhere initialize the plugins, otherwise the setup will be called every time when calling get_search_plugins","commit_id":"ba5b8175a1df3df34b4c0c53261eecc76f752505"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"a8f32f298b944f524fb0c28d39e16a7e78906038","unresolved":false,"context_lines":[{"line_number":435,"context_line":"    plugins \u003d {plugin.obj.get_document_type(): plugin"},{"line_number":436,"context_line":"               for plugin in ext_manager.extensions if plugin.obj.enabled}"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    # Set up any parent/child relationships"},{"line_number":439,"context_line":"    for plugin_type, loaded_plugin in six.iteritems(plugins):"},{"line_number":440,"context_line":"        if loaded_plugin.obj.parent_plugin_name():"},{"line_number":441,"context_line":"            LOG.debug(\"Setting up link between parent (%s) and child (%s)\""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_04bf8061","line":438,"in_reply_to":"7a5de9d1_e4aca4a0","updated":"2016-02-02 02:45:59.000000000","message":"I\u0027ll have a look. Although this is called infrequently, you are correct that register_parent can potentially be called twice. I think though that if register_parent was idempotent (could be called multiple times without bad effect) that would be enough?","commit_id":"ba5b8175a1df3df34b4c0c53261eecc76f752505"},{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"a77fe3d156c6489f244b69f8b004b0c40d430a95","unresolved":false,"context_lines":[{"line_number":439,"context_line":"    # multiple times, in practice get_search_plugins is rarely called."},{"line_number":440,"context_line":"    # Unfortunately there\u0027s nowhere better to put this; stevedore instantiates"},{"line_number":441,"context_line":"    # the plugins before we get to them"},{"line_number":442,"context_line":"    for plugin_type, loaded_plugin in six.iteritems(plugins):"},{"line_number":443,"context_line":"        parent_type \u003d loaded_plugin.obj.parent_plugin_type()"},{"line_number":444,"context_line":"        if parent_type:"},{"line_number":445,"context_line":"            LOG.debug(\"Setting up link between parent (%s) and child (%s)\""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a57f1b5_65236006","line":442,"updated":"2016-02-11 10:13:29.000000000","message":"Initialization of plugins can be done only once by moving this logic to searchlight/__init__.py \n\nI tried to play a little bit and it loaded only once except for some issue with logging not working so early in the startup cycle but otherwise it seems to load the plugins correctly\n\nOne issue is with stevedore not loading the plugins in order like loading all parents before loading child. I tried using NamedExtensionManager to load individual plugins in order, like below and it loads in that order.\n\nos_designate_zone_plugin \u003d stevedore.named.NamedExtensionManager(\n                namespace, \u0027os_designate_zone\u0027, invoke_on_load\u003dTrue)\n\tos_designate_recordset_plugin \u003d stevedore.named.NamedExtensionManager(\n                namespace, \u0027os_designate_recordset\u0027, invoke_on_load\u003dTrue)\n\nWith individual plugin loading, we can pass the parent plugin obj directly as an arg to the child plugin in the above calland the base.IndexBase.__init__ method can recieve the arg.","commit_id":"c025f817ee89439e2efa150b108475785be5f5aa"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"7e6fe35f7916a4f2ae2396e8bbdf96dd6bb3eca3","unresolved":false,"context_lines":[{"line_number":439,"context_line":"    # multiple times, in practice get_search_plugins is rarely called."},{"line_number":440,"context_line":"    # Unfortunately there\u0027s nowhere better to put this; stevedore instantiates"},{"line_number":441,"context_line":"    # the plugins before we get to them"},{"line_number":442,"context_line":"    for plugin_type, loaded_plugin in six.iteritems(plugins):"},{"line_number":443,"context_line":"        parent_type \u003d loaded_plugin.obj.parent_plugin_type()"},{"line_number":444,"context_line":"        if parent_type:"},{"line_number":445,"context_line":"            LOG.debug(\"Setting up link between parent (%s) and child (%s)\""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a57f1b5_1fb186e1","line":442,"in_reply_to":"3a57f1b5_65236006","updated":"2016-02-11 15:10:57.000000000","message":"Hmmm. I don\u0027t want to have to hardcode anything about plugins in the base code, or we start to lose the benefit of using stevedore. Is it a problem if this code runs more than once? I don\u0027t know (but hope) that stevedore doesn\u0027t create multiple copies of things, and the parent/child linking code should now not matter if it\u0027s run more than once.","commit_id":"c025f817ee89439e2efa150b108475785be5f5aa"}],"searchlight/elasticsearch/plugins/base.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"f997449044fa47f355b9a8d2ccbccde2b987fe82","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        if self.parent_plugin_name():"},{"line_number":75,"context_line":"            if not self.parent_plugin:"},{"line_number":76,"context_line":"                raise exception.IndexingException("},{"line_number":77,"context_line":"                    _(\"Parent plugin for %(doc_type)s is not initialized\") %"},{"line_number":78,"context_line":"                    {\"doc_type\": self.document_type})"},{"line_number":79,"context_line":"            LOG.debug(_LI("},{"line_number":80,"context_line":"                \"Skipping initialization for %(doc_type)s; will be handled by\""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_51182375","line":77,"updated":"2016-02-05 22:47:15.000000000","message":"Maybe we should say, \"Make sure it is enabled in the configuration\". Also, the error message doesn\u0027t tell you the name of the plugin that isn\u0027t initialized. That could make it harder to troubleshoot.","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7b19dea3e47054c21940b1f20c9289e33a5dbe7b","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        if self.parent_plugin_name():"},{"line_number":75,"context_line":"            if not self.parent_plugin:"},{"line_number":76,"context_line":"                raise exception.IndexingException("},{"line_number":77,"context_line":"                    _(\"Parent plugin for %(doc_type)s is not initialized\") %"},{"line_number":78,"context_line":"                    {\"doc_type\": self.document_type})"},{"line_number":79,"context_line":"            LOG.debug(_LI("},{"line_number":80,"context_line":"                \"Skipping initialization for %(doc_type)s; will be handled by\""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_ca79b5c9","line":77,"in_reply_to":"5a5ae5dd_51182375","updated":"2016-02-06 00:06:14.000000000","message":"Ok, above comment is partially invalid, because if the parent plugin isn\u0027t enabled (initialized), it raises an error much sooner. \n\nI\u0027m not sure it is very friendly and would be confusing for a new user on what to do (comment inline there) but even if the exception handling doesn\u0027t change it still wouldn\u0027t hurt to add the parent name into the message..  \n\nIf I don\u0027\u0027t enable the parent, the error is generated much sooner:\n\nhttp://paste.openstack.org/show/486165/","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"800e411aae9b1805ba86dee30fe08de7f71be881","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        if self.parent_plugin_name():"},{"line_number":75,"context_line":"            if not self.parent_plugin:"},{"line_number":76,"context_line":"                raise exception.IndexingException("},{"line_number":77,"context_line":"                    _(\"Parent plugin for %(doc_type)s is not initialized\") %"},{"line_number":78,"context_line":"                    {\"doc_type\": self.document_type})"},{"line_number":79,"context_line":"            LOG.debug(_LI("},{"line_number":80,"context_line":"                \"Skipping initialization for %(doc_type)s; will be handled by\""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_67de6fde","line":77,"in_reply_to":"5a5ae5dd_ca79b5c9","updated":"2016-02-08 23:30:43.000000000","message":"I\u0027ll move this to where it gets generated, thanks","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7b19dea3e47054c21940b1f20c9289e33a5dbe7b","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        plugin_mappings \u003d [(self.document_type, type_mapping)]"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        # Assemble the children!"},{"line_number":142,"context_line":"        for child_plugin in self.child_plugins:"},{"line_number":143,"context_line":"            child_mapping \u003d child_plugin.get_mapping()"},{"line_number":144,"context_line":"            mapping_parent \u003d child_mapping.get(\u0027_parent\u0027, None)"},{"line_number":145,"context_line":"            if mapping_parent:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_ed3e0b27","line":142,"updated":"2016-02-06 00:06:14.000000000","message":"Ok, maybe I\u0027m not reading this right, but this only handles one level of children, right? However, parent child relationships really are a tree and this should do a tree traversal. You can have Grandpa \u003c-- Mom \u003c-- Kid\n\nAt lin ES 1.7.4, I know that this is possible. Just manually tested it in senseui to verify multi-level works.  Here is copy paste of my commands as FYI:\n\nhttp://paste.openstack.org/show/486168/","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"800e411aae9b1805ba86dee30fe08de7f71be881","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        plugin_mappings \u003d [(self.document_type, type_mapping)]"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        # Assemble the children!"},{"line_number":142,"context_line":"        for child_plugin in self.child_plugins:"},{"line_number":143,"context_line":"            child_mapping \u003d child_plugin.get_mapping()"},{"line_number":144,"context_line":"            mapping_parent \u003d child_mapping.get(\u0027_parent\u0027, None)"},{"line_number":145,"context_line":"            if mapping_parent:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_a224555f","line":142,"in_reply_to":"5a5ae5dd_ed3e0b27","updated":"2016-02-08 23:30:43.000000000","message":"It is; I was hesitant to write code that wasn\u0027t going to be tested, but i\u0027m ok adding support for it on the proviso that we don\u0027t currently have a real test case to use with it.","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7b19dea3e47054c21940b1f20c9289e33a5dbe7b","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            mapping_parent \u003d child_mapping.get(\u0027_parent\u0027, None)"},{"line_number":145,"context_line":"            if mapping_parent:"},{"line_number":146,"context_line":"                if mapping_parent[\u0027type\u0027] !\u003d self.document_type:"},{"line_number":147,"context_line":"                    raise exception.IndexingException("},{"line_number":148,"context_line":"                        _(\"Child mapping for %(child_name)s contains a \""},{"line_number":149,"context_line":"                          \"_parent that doesn\u0027t match %(doc_type)s\") %"},{"line_number":150,"context_line":"                        {\"child_name\": child_plugin.get_document_type(),"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_cdcc6f6c","line":147,"updated":"2016-02-06 00:06:14.000000000","message":"Just caught that this checks programmatically. Very nice...","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7b19dea3e47054c21940b1f20c9289e33a5dbe7b","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        self.index_helper.save_documents(documents)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        for child_plugin in self.child_plugins:"},{"line_number":176,"context_line":"            child_plugin.setup_data()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def get_facets(self, request_context, all_projects\u003dFalse, limit_terms\u003d0):"},{"line_number":179,"context_line":"        \"\"\"Get facets available for searching, in the form of a list of"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_2da2e34b","line":176,"updated":"2016-02-06 00:06:14.000000000","message":"This all only allows one level deep, right?","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"800e411aae9b1805ba86dee30fe08de7f71be881","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        self.index_helper.save_documents(documents)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        for child_plugin in self.child_plugins:"},{"line_number":176,"context_line":"            child_plugin.setup_data()"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def get_facets(self, request_context, all_projects\u003dFalse, limit_terms\u003d0):"},{"line_number":179,"context_line":"        \"\"\"Get facets available for searching, in the form of a list of"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_8510425b","line":176,"in_reply_to":"5a5ae5dd_2da2e34b","updated":"2016-02-08 23:30:43.000000000","message":"In theory it will allow multiple levels; the child\u0027s setup_data would index any children","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"f997449044fa47f355b9a8d2ccbccde2b987fe82","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        raise NotImplemented()"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    @classmethod"},{"line_number":338,"context_line":"    def parent_plugin_name(cls):"},{"line_number":339,"context_line":"        return None"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"    def register_parent(self, parent):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_874738bb","line":338,"updated":"2016-02-05 22:47:15.000000000","message":"I think this needs documentation that states that the parent plugin name must match the parent plugin\u0027s document type.","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"800e411aae9b1805ba86dee30fe08de7f71be881","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        raise NotImplemented()"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    @classmethod"},{"line_number":338,"context_line":"    def parent_plugin_name(cls):"},{"line_number":339,"context_line":"        return None"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"    def register_parent(self, parent):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_c25951fe","line":338,"in_reply_to":"5a5ae5dd_874738bb","updated":"2016-02-08 23:30:43.000000000","message":"Done, and renaming to parent_type","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"}],"searchlight/elasticsearch/plugins/designate/recordsets.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"f997449044fa47f355b9a8d2ccbccde2b987fe82","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                },"},{"line_number":68,"context_line":"            },"},{"line_number":69,"context_line":"            \"_parent\": {"},{"line_number":70,"context_line":"                \"type\": self.parent_plugin_name()"},{"line_number":71,"context_line":"            }"},{"line_number":72,"context_line":"        }"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_a7711446","line":70,"updated":"2016-02-05 22:47:15.000000000","message":"This bothers me slightly because it has to be the document_type of the parent. parent_plugin_name is a little misleading.  It is really parent plugin document type...  Given the context of use in the rest of the code, I didn\u0027t come up with any better name, but I do think the base.py function needs documentation.","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"800e411aae9b1805ba86dee30fe08de7f71be881","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                },"},{"line_number":68,"context_line":"            },"},{"line_number":69,"context_line":"            \"_parent\": {"},{"line_number":70,"context_line":"                \"type\": self.parent_plugin_name()"},{"line_number":71,"context_line":"            }"},{"line_number":72,"context_line":"        }"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_678c2fda","line":70,"in_reply_to":"5a5ae5dd_a7711446","updated":"2016-02-08 23:30:43.000000000","message":"I can change it to parent_plugin_type","commit_id":"6e8688ac8e693c9a7165dca1afb6c3879ab39fdb"}]}
