HLRC: Add ML get categories API#33465
Conversation
|
Pinging @elastic/es-core-infra |
|
Pinging @elastic/ml-core |
| * ML GET categories documentation</a> | ||
| * | ||
| * @param request The request | ||
| * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
There was a problem hiding this comment.
I know some methods add the @throws and others don't. I think we should still add the @throws entry even if it is a checked exception.
I have not been consistent about this myself either :(.
There was a problem hiding this comment.
@dimitris-athanasiou may have a different opinion around this ^, So I will defer to him.
There was a problem hiding this comment.
You're right @benwtrent, we've been dropping the @throws clause in some of the methods in the client. We'll need to revisit and add them. I'll make a note to do that.
|
|
||
| public static final ParseField CATEGORY_ID = new ParseField("category_id"); | ||
|
|
||
| public static final ObjectParser<GetCategoriesRequest, Void> PARSER = |
There was a problem hiding this comment.
This should be ConstructingObjectParser
| PARSER.declareObject(GetCategoriesRequest::setPageParams, PageParams.PARSER, PageParams.PAGE); | ||
| } | ||
|
|
||
| private String jobId; |
| private Long categoryId; | ||
| private PageParams pageParams; | ||
|
|
||
| private GetCategoriesRequest() {} |
There was a problem hiding this comment.
We should not have this ctr, and just use the ConstructingObjectParser to pass the jobId as it is required.
Further fixes to style in test cases
| addRecordIndexRequest(time, true, bulkRequest); | ||
|
|
||
| // index some category results | ||
| addCategoriesIndexRequests(bulkRequest); |
There was a problem hiding this comment.
I think we could perform this just in the get categories test. However, I suppose it doesn't really add to the execution time. Note that this setup is run once per test. Might be fun trying to see if there's a noticeable difference. :-)
There was a problem hiding this comment.
Good point! That call is only indexing 3 category results so I suspect the impact on execution time is low but I'll make the change regardless. Anything we can do to speed up the tests has to be a good thing...
* master: Preserve cluster settings on full restart tests (elastic#33590) Use IndexWriter.getFlushingBytes() rather than tracking it ourselves (elastic#33582) Fix upgrading of list settings (elastic#33589) Add read-only Engine (elastic#33563) HLRC: Add ML get categories API (elastic#33465) SQL: Adds MONTHNAME, DAYNAME and QUARTER functions (elastic#33411) Add predicate_token_filter (elastic#33431) Fix Replace function. Adds more tests to all string functions. (elastic#33478) [ML] Rename input_fields to column_names in file structure (elastic#33568)
* master: (91 commits) Preserve cluster settings on full restart tests (elastic#33590) Use IndexWriter.getFlushingBytes() rather than tracking it ourselves (elastic#33582) Fix upgrading of list settings (elastic#33589) Add read-only Engine (elastic#33563) HLRC: Add ML get categories API (elastic#33465) SQL: Adds MONTHNAME, DAYNAME and QUARTER functions (elastic#33411) Add predicate_token_filter (elastic#33431) Fix Replace function. Adds more tests to all string functions. (elastic#33478) [ML] Rename input_fields to column_names in file structure (elastic#33568) Add full cluster restart base class (elastic#33577) Validate list values for settings (elastic#33503) Copy and validatie soft-deletes setting on resize (elastic#33517) Test: Fix package name SQL: Fix result column names for arithmetic functions (elastic#33500) Upgrade to latest Lucene snapshot (elastic#33505) Enable not wiping cluster settings after REST test (elastic#33575) MINOR: Remove Dead Code in SearchScript (elastic#33569) [Test] Remove duplicate method in TestShardRouting (elastic#32815) mute test on windows Update beats template to include apm-server metrics (elastic#33286) ...
HLRC: Adding the ML 'get categories' API
Relates #29827