You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Jason Gerlowski (Jira)" <ji...@apache.org> on 2023/03/17 15:59:00 UTC

[jira] [Comment Edited] (SOLR-16396) Cosmetic improvements and migration to JAX-RS (config, configset APIs)

    [ https://issues.apache.org/jira/browse/SOLR-16396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623281#comment-17623281 ] 

Jason Gerlowski edited comment on SOLR-16396 at 3/17/23 3:58 PM:
-----------------------------------------------------------------

To be a little more explicit about the APIs we want this ticket to cover, I found 32 APIs that need work related to config CRUD:

(*EDIT*: List moved to table in issue description)

This is a huge list, though in practice I expect many of these to copy/paste exercises.  If anyone wants to help chip away at this, just call out which APIs from this list you intend to work on and we can parallelize them.

In terms of the steps required, the JIRA comments [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617806&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617806] and [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617923&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617923] give some good background and step-by-step instructions for switching APIs over to the new JAX-RS framework, which is usually helpful or even required as the traditional v2 framework doesn't lend itself very readily to RESTful APIs.  (Those comments describe creating a new API "from scratch", but the steps are still applicable to modifying an existing API.)  The PR [here|https://github.com/apache/solr/pull/1053] also serves as a helpful example to work from.

Not all API modifications require the new JAX-RS framework, though it is preferred going forward.  Instructions for updating APIs using the older, traditional v2 framework can be found [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17565076&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17565076], and an example PR can be found [here|https://github.com/apache/solr/pull/1061].


was (Author: gerlowskija):
To be a little more explicit about the APIs we want this ticket to cover, I found 32 APIs that need work related to config CRUD:

* List paramsets
** Current Form: GET /api/collections/collName/config/params
** Desired Form: GET /api/collections/collName/config/paramsets
** Spreadsheet Ref: Tab 3, Line 20
* Fetch Single Paramset
** Current Form: GET /api/collections/collName/config/params/paramSetName
** Desired Form: GET /api/collections/collName/config/paramsets/paramSetName
** Spreadsheet Ref: Tab 3, Line 22
* List Request Handlers
** Current Form: GET /api/collections/collName/config/requestHandler
** Desired Form: GET /api/collections/collName/config/requestHandlers
** Spreadsheet Ref: Tab 3, Line 26
* Add/Update Request Handler
** Current Form: POST /api/collections/collName/config \{"add-requesthandler": \{...\}\} and POST /api/collections/collName/config \{"update-requesthandler": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/requestHandlers/rhPath \{...\}
** Spreadsheet Ref: Tab 3, Line 27
* Delete Overlay Request Handler
** Current Form: POST /api/collections/collName/config \{"delete-requesthandler": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/requestHandlers/rhPath
** Spreadsheet Ref: Tab 3, Line 29
* List Seach Components
** Current Form: GET /api/collections/collName/config/searchComponent
** Desired Form: GET /api/collections/collName/config/searchComponents
** Spreadsheet Ref: Tab 3, Line 31
* Add/Update Search Component
** Current Form: POST /api/collections/collName/config \{"add-searchcomponent": \{...\}\} and POST /api/collections/collName/config \{"update-searchcomponent": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/searchComponents/scName \{...\}
** Spreadsheet Ref: Tab 3, Line 32
* Delete Overlay Search Component
** Current Form: POST /api/collections/collName/config \{"delete-searchcomponent": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/searchComponents/scName
** Spreadsheet Ref: Tab 3, Line 34
* List Query Response Writers
** Current Form: GET /api/collections/collName/config/queryResponseWriter
** Desired Form: GET /api/collections/collName/config/queryResponseWriters
** Spreadsheet Ref: Tab 3, Line 36
* Add/Update Query Response Writers
** Current Form: POST /api/collections/collName/config \{"add-queryresponsewriter": \{...\}\} and POST /api/collections/collName/config \{"update-queryresponsewriter": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryResponseWriters/responseWriterName \{...\}
** Spreadsheet Ref: Tab 3, Line 37
* Delete Overlay Query Response Writers
** Current Form: POST /api/collections/collName/config \{"delete-queryresponsewriter": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryResponseWriters/responseWriterName
** Spreadsheet Ref: Tab 3, Line 39
* Add/Update Init Params
** Current Form: POST /api/collections/collName/config \{"add-initparams": \{...\}\} and POST /api/collections/collName/config \{"update-initparams": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/initParams/initParamName \{...\}
** Spreadsheet Ref: Tab 3, Line 42
* Delete Overlay Init Params
** Current Form: POST /api/collections/collName/config \{"delete-initparams": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/initParams/initParamName
** Spreadsheet Ref: Tab 3, Line 44
* List Listeners
** Current Form: GET /api/collections/collName/config/listener
** Desired Form: GET /api/collections/collName/config/listeners
** Spreadsheet Ref: Tab 3, Line 46
* Add/Update Listener
** Current Form: POST /api/collections/collName/config \{"add-listener": \{...\}\} and POST /api/collections/collName/config \{"update-listener": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/listeners/listenerName \{...\}
** Spreadsheet Ref: Tab 3, Line 47
* Delete Overlay Listener
** Current Form: POST /api/collections/collName/config \{"delete-listener": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/listeners/listenerName
** Spreadsheet Ref: Tab 3, Line 49
* Add/Update Query Parser
** Current Form: POST /api/collections/collName/config \{"add-queryparser": \{...\}\} and POST /api/collections/collName/config \{"update-queryparser": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryparsers/queryParserName \{...\}
** Spreadsheet Ref: Tab 3, Line 51
* Delete Overlay Query Parser
** Current Form: POST /api/collections/collName/config \{"delete-queryparser": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryparsers/queryParserName
** Spreadsheet Ref: Tab 3, Line 53
* Set Common Property
** Current Form: POST /api/collections/collName/config \{"set-property": \{"propName": "propValue"\}\}
** Desired Form: PUT /api/collections/collName/config/properties/propertyName \{"value": "propVal"\}
** Spreadsheet Ref: Tab 3, Line 55
* Delete Common Property
** Current Form: POST /api/collections/collName/config \{"unset-property": "propName"\}
** Desired Form: DELETE /api/collections/collName/config/properties/propertyName
** Spreadsheet Ref: Tab 3, Line 56
* Set User Property
** Current Form: POST /api/collections/collName/config \{"set-user-property": \{"propName": "val"\}\}
** Desired Form: PUT /api/collections/collName/config/userproperties/propertyName \{"value": "propVal"\}
** Spreadsheet Ref: Tab 3, Line 57
* Delete User Property
** Current Form: POST /api/collections/collName/config \{"unset-user-property": "propName"\}
** Desired Form: DELETE /api/collections/collName/config/userproperties/propertyName
** Spreadsheet Ref: Tab 3, Line 58
* Add/Update Value Source Parser
** Current Form: POST /api/collections/collName/config \{"add-valuesourceparser": \{...\}\} and POST /api/collections/collName/config \{"update-valuesourceparser": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/valueSourceParser/vspName \{...\}
** Spreadsheet Ref: Tab 3, Line 60
* Delete Value Source Parser
** Current Form: POST /api/collections/collName/config \{"delete-valuesourceparser": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/valueSourceParser/vspName
** Spreadsheet Ref: Tab 3, Line 62
* Add/Update Transformer
** Current Form: POST /api/collections/collName/config \{"add-transformer": \{...\}\} and POST /api/collections/collName/config \{"update-transformer": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/transformers/transformerName \{...\}
** Spreadsheet Ref: Tab 3, Line 64
* Delete Transformer
** Current Form: POST /api/collections/collName/config \{"delete-transformer": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/transformers/transformerName
** Spreadsheet Ref: Tab 3, Line 66
* Add/Update "Update Processor"
** Current Form: POST /api/collections/collName/config \{"add-updateprocessor": \{...\}\} and POST /api/collections/collName/config \{"update-updateprocessor": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/updateProcessors/updateProcessorName \{...\}
** Spreadsheet Ref: Tab 3, Line 68
* Delete Update Processor
** Current Form: POST /api/collections/collName/config \{"delete-updateprocessor": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/updateProcessors/updateProcessorName
** Spreadsheet Ref: Tab 3, Line 70
* Add/Update Query Converter
** Current Form: POST /api/collections/collName/config \{"add-queryconverter": \{...\}\} and POST /api/collections/collName/config \{"update-queryconverter": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/queryConverters/queryConverterName \{...\}
** Spreadsheet Ref: Tab 3, Line 72
* Delete Query Converter
** Current Form: POST /api/collections/collName/config \{"delete-queryconverter": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/queryConverters/queryConverterName
** Spreadsheet Ref: Tab 3, Line 74
* Add/Update Expressible
** Current Form: POST /api/collections/collName/config \{"add-expressible": \{...\}\} and POST /api/collections/collName/config \{"update-expressible": \{...\}\}
** Desired Form: PUT /api/collections/collName/config/expressibles/expressibleName \{...\}
** Spreadsheet Ref: Tab 3, Line 76
* Delete Expressible
** Current Form: POST /api/collections/collName/config \{"delete-expressible": \{...\}\}
** Desired Form: DELETE /api/collections/collName/config/expressibles/expressibleName
** Spreadsheet Ref: Tab 3, Line 78

This is a huge list, though in practice I expect many of these to copy/paste exercises.  If anyone wants to help chip away at this, just call out which APIs from this list you intend to work on and we can parallelize them.

In terms of the steps required, the JIRA comments [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617806&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617806] and [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617923&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617923] give some good background and step-by-step instructions for switching APIs over to the new JAX-RS framework, which is usually helpful or even required as the traditional v2 framework doesn't lend itself very readily to RESTful APIs.  (Those comments describe creating a new API "from scratch", but the steps are still applicable to modifying an existing API.)  The PR [here|https://github.com/apache/solr/pull/1053] also serves as a helpful example to work from.

Not all API modifications require the new JAX-RS framework, though it is preferred going forward.  Instructions for updating APIs using the older, traditional v2 framework can be found [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17565076&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17565076], and an example PR can be found [here|https://github.com/apache/solr/pull/1061].

> Cosmetic improvements and migration to JAX-RS (config, configset APIs)
> ----------------------------------------------------------------------
>
>                 Key: SOLR-16396
>                 URL: https://issues.apache.org/jira/browse/SOLR-16396
>             Project: Solr
>          Issue Type: Sub-task
>          Components: v2 API
>    Affects Versions: main (10.0)
>            Reporter: Jason Gerlowski
>            Priority: Major
>              Labels: newdev
>
> As mentioned on SOLR-15781, the v2 API currently has an experimental designation, and the community has expressed an interest in using this period to update our v2 endpoints to be more REST-ful and consistent.  The current plan is to follow the specific changes laid out in [this spreadsheet|https://docs.google.com/spreadsheets/d/1HAoBBFPpSiT8mJmgNZKkZAPwfCfPvlc08m5jz3fQBpA/edit?usp=sharing], though of course nothing there is set in stone and there are still warts to be worked out.
> While we're touching the code for these endpoints, we should also convert them to JAX-RS framework definitions.  (This was initially tracked as a separate effort - see SOLR-16370 - but the edit that were required ended up overlapping so significantly with the "cosmetic" improvements here that in practice it almost always makes sense to do the two together.) 
> This ticket plans to tackle making the changes required for Solr's config (read and write/overlay) and configset CRUD APIs, as described in the spreadsheet above.  For convenience and easier tracking, the APIs are also summarized in the table below:
> *Cosmetic Changes and JAX-RS Conversion*
> ||API Name||Original Form||Desired Form||Status||Volunteer||
> |List Paramsets|GET /api/collections/collName/config/params|GET /api/collections/collName/config/paramsets|Open|N/A|
> |Get Single Paramset|GET /api/collections/collName/config/params/paramSetName|GET /api/collections/collName/config/paramsets/paramSetName|Open|N/A|
> |List Request Handlers|GET /api/collections/collName/config/requesthandler|GET /api/collections/collName/config/requesthandlers|Open|N/A|
> |Create Request Handler|POST /api/collections/collName/config \{"add-requesthandler": \{...\}\}|PUT /api/collections/collName/config/requestHandlers/rhPath \{...\}|Open|N/A|
> |Update Request Handler|POST /api/collections/collName/config \{"update-requesthandler": \{...\}\}|PUT /api/collections/collName/config/requestHandlers/rhPath \{...\}|Open|N/A|
> |Delete Request Handler|POST /api/collections/collName/config \{"delete-requesthandler": \{...\}\}|DELETE /api/collections/collName/config/requestHandlers/rhPath|Open|N/A|
> |List Search Components|GET /api/collections/collName/config/searchcomponent|GET /api/collections/collName/config/searchcomponents|Open|N/A|
> |Create Search Component|POST /api/collections/collName/config \{"add-searchcomponent": \{...\}\}|PUT /api/collections/collName/config/searchcomponents/scName \{...\}|Open|N/A|
> |Update Search Component|POST /api/collections/collName/config \{"update-searchcomponent": \{...\}\}|PUT /api/collections/collName/config/searchcomponents/scName \{...\}|Open|N/A|
> |Delete Request Handler|POST /api/collections/collName/config \{"delete-searchcomponent": \{...\}\}|DELETE /api/collections/collName/config/searchcomponents/scName|Open|N/A|
> |List Query Response Writers|GET /api/collections/collName/config/queryresponsewriter|GET /api/collections/collName/config/queryresponsewriters|Open|N/A|
> |Create Query Response Writer|POST /api/collections/collName/config \{"add-queryresponsewriter": \{...\}\}|PUT /api/collections/collName/config/queryresponsewriters/responseWriterName \{...\}|Open|N/A|
> |Delete Query Response Writer|POST /api/collections/collName/config \{"delete-queryresponsewriter": \{...\}\}|DELETE /api/collections/collName/config/queryresponsewriters/responseWriterName|Open|N/A|
> |Create Init Params|POST /api/collections/collName/config \{"add-initparams": \{...\}\}|PUT /api/collections/collName/config/initParams/initParamName \{...\}|Open|N/A|
> |Update Init Params|POST /api/collections/collName/config \{"update-initparams": \{...\}\}|PUT /api/collections/collName/config/initParams/initParamName \{...\}|Open|N/A|
> |Delete Init Params|POST /api/collections/collName/config \{"delete-initparams": \{...\}\}|DELETE /api/collections/collName/config/initParams/initParamName|Open|N/A|
> |List Listeners|GET /api/collections/collName/config/listener|GET /api/collections/collName/config/listeners|Open|N/A|
> |Create Listener|POST /api/collections/collName/config \{"add-listener": \{...\}\}|PUT /api/collections/collName/config/listeners/listenerName \{...\}|Open|N/A|
> |Update Listener|POST /api/collections/collName/config \{"update-listener": \{...\}\}|PUT /api/collections/collName/config/listeners/listenerName \{...\}|Open|N/A|
> |Delete Listener|POST /api/collections/collName/config \{"delete-listener": \{...\}\}|DELETE /api/collections/collName/config/listeners/listenerName|Open|N/A|
> |Create Query Parser|POST /api/collections/collName/config \{"add-queryparser": \{...\}\}|PUT /api/collections/collName/config/queryparsers/queryParserName \{...\}|Open|N/A|
> |Update Query Parser|POST /api/collections/collName/config \{"update-queryparser": \{...\}\}|PUT /api/collections/collName/config/queryparsers/queryParserName \{...\}|Open|N/A|
> |Delete Query Parser|POST /api/collections/collName/config \{"delete-queryparser": \{...\}\}|DELETE /api/collections/collName/config/queryparsers/queryParserName|Open|N/A|
> |Create Common Property|POST /api/collections/collName/config \{"set-property": \{"propName": "propValue"\}\}|PUT /api/collections/collName/config/properties/propertyName \{"value": "propVal"\}|Open|N/A|
> |Delete Common Property|POST /api/collections/collName/config \{"unset-property": "propName"\}|DELETE /api/collections/collName/config/properties/propertyName|Open|N/A|
> |Set User Property|POST /api/collections/collName/config \{"set-user-property": \{"propName": "val"\}\}|PUT /api/collections/collName/config/userproperties/propertyName \{"value": "propVal"\}|Open|N/A|
> |Delete User Property|POST /api/collections/collName/config \{"unset-user-property": "propName"\}|DELETE /api/collections/collName/config/userproperties/propertyName|Open|N/A|
> |Create Value Source Parser|POST /api/collections/collName/config \{"add-valuesourceparser": \{...\}\}|PUT /api/collections/collName/config/valueSourceParser/vspName \{...\}|Open|N/A|
> |Update Value Source Parser|POST /api/collections/collName/config \{"update-valuesourceparser": \{...\}\}|PUT /api/collections/collName/config/valueSourceParser/vspName \{...\}|Open|N/A|
> |Delete Value Source Parser|POST /api/collections/collName/config \{"delete-valuesourceparser": \{...\}\}|DELETE /api/collections/collName/config/valueSourceParser/vspName|Open|N/A|
> |Create Transformer|POST /api/collections/collName/config \{"add-transformer": \{...\}\}|PUT /api/collections/collName/config/transformers/transformerName \{...\}|Open|N/A|
> |Update Transformer|POST /api/collections/collName/config \{"update-transformer": \{...\}\}|PUT /api/collections/collName/config/transformers/transformerName \{...\}|Open|N/A|
> |Delete Transformer|POST /api/collections/collName/config \{"delete-transformer": \{...\}\}|DELETE /api/collections/collName/config/transformers/transformerName|Open|N/A|
> |Create Update-Processor|POST /api/collections/collName/config \{"add-updateprocessor": \{...\}\}|PUT /api/collections/collName/config/updateProcessors/updateProcessorName \{...\}|Open|N/A|
> |Update Update-Processor|POST /api/collections/collName/config \{"update-updateprocessor": \{...\}\}|PUT /api/collections/collName/config/updateProcessors/updateProcessorName \{...\}|Open|N/A|
> |Delete Update-Processor|POST /api/collections/collName/config \{"delete-updateprocessor": \{...\}\}|DELETE /api/collections/collName/config/updateProcessors/updateProcessorName|Open|N/A|
> |Create Query Converter|POST /api/collections/collName/config \{"add-queryconverter": \{...\}\}|PUT /api/collections/collName/config/queryconverters/queryConverterName \{...\}|Open|N/A|
> |Update Query Converter|POST /api/collections/collName/config \{"update-queryconverter": \{...\}\}|PUT /api/collections/collName/config/queryconverters/queryConverterName \{...\}|Open|N/A|
> |Delete Query Converter|POST /api/collections/collName/config \{"delete-queryconverter": \{...\}\}|DELETE /api/collections/collName/config/queryconverters/queryConverterName|Open|N/A|
> |Create Expressible|POST /api/collections/collName/config \{"add-expressible": \{...\}\}|PUT /api/collections/collName/config/expressibles/expressibleName \{...\}|Open|N/A|
> |Update Expressible|POST /api/collections/collName/config \{"update-expressible": \{...\}\}|PUT /api/collections/collName/config/expressibles/expressibleName \{...\}|Open|N/A|
> |Delete Expressible|POST /api/collections/collName/config \{"delete-expressible": \{...\}\}|DELETE /api/collections/collName/config/expressibles/expressibleName|Open|N/A|



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org