Merge "Remove resource_group_name as a per-plugin option"

This commit is contained in:
Jenkins 2016-03-16 22:37:58 +00:00 committed by Gerrit Code Review
commit e4b64c00d7
6 changed files with 33 additions and 23 deletions

View File

@ -70,10 +70,9 @@ or default configuration values. They are intended for exemplary purposes only.
Please read the rest of the guide for detailed information.::
[resource_plugin]
index_name = searchlight
resource_group_name = searchlight
[resource_plugin:os_nova_server]
index_name = nova
enabled = True
admin_only_fields = OS-EXT-SRV*,OS-EXT-STS:vm_state
@ -107,20 +106,23 @@ Common Plugin Configuration Options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are common configuration options that all plugins honor. They are split
between *inheritable* options and *non-inheritable* options.
between *global*, *inheritable* and *non-inheritable* options.
**Global** plugin configuration options apply to all plugins and cannot be
overridden by an individual plugin.
**Inheritable** common configuration options may be specified in a default
configuration group of ``[resource_plugin]`` in ``searchlight.conf`` and
optionally overridden in a specific plugin's configuration. For example::
[resource_plugin]
index_name = searchlight
notifications_topic = searchlight_indexer
[resource_plugin:os_nova_server]
index_name = nova
notifications_topic = searchlight_indexer_nova
**Non-Inheritable** common configuration options are honored by all plugins,
but must be specified directly in that plugin's configuration group. They are
but must be specified directly in that plugin's configuration group. They
are not inherited from the ``[resource_plugin]`` configuration group. For
example::
@ -146,16 +148,28 @@ for all service notifications a plugin supports.
See :ref:`individual-plugin-configuration` for more information and examples
on individual plugin configuration.
Global Configuration Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+---------------------+---------------+-------------------------------------+---------------------------+
| Option | Default value | Description | Action(s) Required |
+=====================+===============+=====================================+===========================+
| resource_group_name | searchlight | Determines the ElasticSearch index | |
| | | and alias where documents will be | | Restart services |
| | | stored. Index names will be | Re-index all types |
| | | suffixed with a timestamp. | |
+---------------------+---------------+-------------------------------------+---------------------------+
Inheritable Common Configuration Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+---------------------+---------------+-------------------------------------+---------------------------+
| Option | Default value | Description | Action(s) Required |
+=====================+===============+=====================================+===========================+
| index_name | searchlight | The ElasticSearch index where the | | Restart services |
| | | plugin resource documents will be | | Re-index affected types |
| | | stored in. It is recommended to not | |
| | | change this unless needed. | |
| mapping_use\_ | | Use doc_values to store documents | |
| doc_values | true | rather than fieldata. doc_values | | Full re-index |
| | | has some advantages, particularly | |
| | | around memory usage. | |
+---------------------+---------------+-------------------------------------+---------------------------+
| notifications_topic | searchlight\_ | The oslo.messaging topic on which | | Restart listener |
| | indexer | services send notifications. Each | |

View File

@ -45,7 +45,6 @@ Plugin: OS::Designate::Zone
[resource_plugin:os_designate_zone]
enabled = true
index_name = searchlight
Plugin: OS::Designate::RecordSet
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -53,15 +52,13 @@ Plugin: OS::Designate::RecordSet
[resource_plugin:os_designate_recordset]
enabled = true
index_name = searchlight
.. warning::
*OS::Designate::Zone* documents have a parent relationship to
*OS::Designate::RecordSet* documents. Because of this you must have
both *os_designate_zone* and *os_designate_recordset* plugin
configurations enabled or disabled together and be set to the same
index_name.
configurations enabled or disabled together.
Designate Configuration
=======================

View File

@ -45,7 +45,6 @@ Plugin: OS::Glance::Image
[resource_plugin:os_glance_image]
enabled = true
index_name = searchlight
**Glance Image Property Protections**
@ -68,7 +67,6 @@ Plugin: OS::Glance::Metadef
[resource_plugin:os_glance_metadef]
enabled = true
index_name = searchlight
See also: `Metadata Definitions Catalog <http://docs.openstack.org/developer/glance/metadefs-concepts.html>`_

View File

@ -45,7 +45,6 @@ Plugin: OS::Neutron::Net
[resource_plugin:os_neutron_net]
enabled = true
index_name = searchlight
Plugin: OS::Neutron::Port
^^^^^^^^^^^^^^^^^^^^^^^^^
@ -53,7 +52,6 @@ Plugin: OS::Neutron::Port
[resource_plugin:os_neutron_port]
enabled = true
index_name = searchlight
Neutron Configuration
=====================

View File

@ -45,7 +45,6 @@ Plugin: OS::Nova::Server
[resource_plugin:os_nova_server]
enabled = true
index_name = searchlight
Nova Configuration
==================

View File

@ -85,9 +85,9 @@ class IndexBase(plugin.Plugin):
@property
def resource_group_name(self):
if not getattr(self, '_group_name', None):
if self.options.resource_group_name is not None:
self._group_name = self.options.resource_group_name
elif cfg.CONF.resource_plugin.resource_group_name is not None:
# We no longer allow this to be set per-plugin. See note in
# get_plugin_opts()
if cfg.CONF.resource_plugin.resource_group_name is not None:
self._group_name = cfg.CONF.resource_plugin.resource_group_name
else:
self._group_name = "searchlight"
@ -476,8 +476,12 @@ class IndexBase(plugin.Plugin):
@classmethod
def get_plugin_opts(cls):
"""Options that can be overridden per plugin. Note that
resource_group_name is not present while we determine a fix for
running has_parent/has_child queries across indices with different
sets of types (https://bugs.launchpad.net/searchlight/+bug/1558240)
"""
opts = [
cfg.StrOpt("resource_group_name"),
cfg.BoolOpt("enabled", default=True),
cfg.StrOpt("admin_only_fields"),
cfg.BoolOpt('mapping_use_doc_values')