opensearch-sdk-java icon indicating copy to clipboard operation
opensearch-sdk-java copied to clipboard

[META] Update Hello World Extension to demonstrate custom settings

Open dbwiddis opened this issue 3 years ago • 2 comments

Is your feature request related to a problem?

There is a sample plugin for custom settings. We should make that plugin an extension in the sample extensions project.

This will require adding capability to send lists, communicate parsers and validators, group settings, get settings to an extension from OpenSearch, and other more advanced Setting manipulation than is needed for the AD plugin, but this should be one of the first things worked on during the "preview" period.

What solution would you like?

Demonstrate custom setting registration similarly to https://github.com/opensearch-project/OpenSearch/tree/main/plugins/examples/custom-settings

Requirements:

  • [x] Create writeable implementations for parser that implement both Function<String, T> and Writeable interfaces #349
  • [x] Demonstrate custom validators in HelloWorld Extension #350
  • [ ] Create writeable implementations for default value that implement both Function<Settings, String> and Writeable interfaces #351
  • [ ] Add the ability to pass a list: https://github.com/opensearch-project/opensearch-sdk-java/issues/155
  • [ ] Implement Group Settings: https://github.com/opensearch-project/opensearch-sdk-java/issues/156
  • [ ] Retrieve Settings from OpenSearch: https://github.com/opensearch-project/opensearch-sdk-java/issues/157 (NOTE: This may be implemented via CreateComponent (settings) and settings update consumers.)

What alternatives have you considered?

Doing it earlier: not needed for AD plugin. Doing it later: key functionality needed for the near future.

Do you have any additional context?

Probably also dependent on Integration Test capability.

dbwiddis avatar Sep 19 '22 01:09 dbwiddis

max/min for numerics - send min and max values.
string regex (handles contains, startswith, endswith, all sorts of strings stuff) send the regex string default to other setting (send the other setting name as a string)

dbwiddis avatar Jan 06 '23 20:01 dbwiddis

We decide to separate the issue #154 to three issues (Create writeable implementations for parser that implement both Function<String, T> and Writeable interfaces #349, Demonstrate custom validators in HelloWorld Extension #350 and Create writeable implementations for default value that implement both Function<Settings, String> and Writeable interfaces #351)

mloufra avatar Jan 23 '23 21:01 mloufra