-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] move find file structure to a new API endpoint #67123
[ML] move find file structure to a new API endpoint #67123
Conversation
6c64954
to
8288cb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes for reviewer:
- I have verified that Kibana file upload still works fine. I think the deprecation headers are simply being dropped by the kibana server
- The VAST majority of the changes are simple file moves + formatting updates (formatting is enforced in the new
text-structure
plugin). - I am planning on high level client changes in an other PR as those could be considered "breaking" (didn't want to mark this PR as breaking, and the churn is big enough already).
- Doc changes will also come later
@@ -2895,8 +2895,17 @@ public void testFindFileStructure() throws IOException { | |||
FindFileStructureRequest request = new FindFileStructureRequest(); | |||
request.setSample(sample.getBytes(StandardCharsets.UTF_8)); | |||
|
|||
FindFileStructureResponse response = | |||
execute(request, machineLearningClient::findFileStructure, machineLearningClient::findFileStructureAsync); | |||
FindFileStructureResponse response = execute( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably be removed once the high level client is updated
@@ -1870,8 +1870,17 @@ public void testFindFileStructure() throws Exception { | |||
// end::find-file-structure-request-options | |||
|
|||
// tag::find-file-structure-execute | |||
FindFileStructureResponse findFileStructureResponse = | |||
client.machineLearning().findFileStructure(findFileStructureRequest, RequestOptions.DEFAULT); | |||
FindFileStructureResponse findFileStructureResponse = client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably be removed once the high level client is updated
@@ -1,89 +0,0 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this shows only a delete, it is effectively a file move (it is added later in the diff). The issue is, I think, that the formatting changes (enforced by our spotless settings), caused github to not recognize it as a simple file rename.
@@ -1,5 +1,5 @@ | |||
{ | |||
"ml.find_file_structure":{ | |||
"text_structure.find_structure":{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opted to not keep the old yaml definition (with deprecation) as the API was experimental.
ScalingExecutorBuilder utility = new ScalingExecutorBuilder( | ||
UTILITY_THREAD_POOL_NAME, | ||
1, | ||
256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This number has no significance. I am willing to reduce as it does seem rather high. I am not sure how many of these calls we expect to run in parallel on the same node. Maybe 16?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe this plugin shouldn't have its own thread pool at all, but reuse the "generic" one from core. Several other plugins do this, for example monitoring, ilm, slm, and parts of security. Since we expect this API to be pretty infrequently called I think it's reasonable to do the same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@droberts195 reusing generic seems OK with me. Will take a look.
8288cb2
to
168f930
Compare
Pinging @elastic/ml-core (:ml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you pointed out, the main outstanding decision is which thread pool to get the threads from.
The REST spec still says it's experimental, but this can be changed at the same time as the docs.
ScalingExecutorBuilder utility = new ScalingExecutorBuilder( | ||
UTILITY_THREAD_POOL_NAME, | ||
1, | ||
256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe this plugin shouldn't have its own thread pool at all, but reuse the "generic" one from core. Several other plugins do this, for example monitoring, ilm, slm, and parts of security. Since we expect this API to be pretty infrequently called I think it's reasonable to do the same here.
@elasticmachine update branch |
run elasticsearch-ci/default-distro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This introduces a new `text-structure` plugin. This is the new home of the find file structure API. The old REST URL is still available but is deprecated. The new URL is: `_text_structure/find_structure`. All parameters and behavior are unchanged. Changes to the high-level REST client and docs will be in separate commit. related to: elastic#67001
…67251) * [ML] move find file structure to a new API endpoint (#67123) This introduces a new `text-structure` plugin. This is the new home of the find file structure API. The old REST URL is still available but is deprecated. The new URL is: `_text_structure/find_structure`. All parameters and behavior are unchanged. Changes to the high-level REST client and docs will be in separate commit. related to: #67001
This introduces a new
text-structure
plugin. This is the new home of the find file structure API.The old REST URL is still available but is deprecated.
The new URL is:
_text_structure/find_structure
. All parameters and behavior are unchanged.Changes to the high-level REST client and docs will be in separate commit.
related to: #67001