-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[FEATURE][ML] Client-side API methods for DataFrame analytics config. #41530
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
Merged
przemekwitek
merged 36 commits into
elastic:feature-ml-data-frame-analytics
from
przemekwitek:df-analyticsconfig-methods
Apr 26, 2019
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
174acb0
Draft of HLRC for DataFrame analytics (data format).
f70b0c3
Implement data model for HLRC.
2dfb33c
* Fix typo: analysed -> analyzed
2cb5971
* Fix spelling: analysed -> analyzed
245879a
Revert unintentional changes.
c6edb06
Small fixes.
14c5a74
Apply fixes resulting from code review.
fd3ad66
* Add MlDataFrameAnalysisNamedXContentProvider.java so that the outli…
6083b8a
Fixed unit tests.
42b2cbb
Implementation of Get/Put/Delete methods on client side together with…
ec81640
Fix licence.
f641a0c
Merge branch 'df-analyticsconfig' into df-analyticsconfig-methods
87d3b3f
Fix style issues.
fbcef50
Draft of HLRC for DataFrame analytics (data format).
c51834a
Implement data model for HLRC.
7f62052
* Fix typo: analysed -> analyzed
73ed02e
* Fix spelling: analysed -> analyzed
649baab
Revert unintentional changes.
5e06f47
Small fixes.
76e5004
Apply fixes resulting from code review.
73c570e
* Add MlDataFrameAnalysisNamedXContentProvider.java so that the outli…
4c24f1f
Fixed unit tests.
29f222d
Fix licence.
9fa1a08
Merge branch 'df-analyticsconfig' into df-analyticsconfig-methods
dd1b0b6
Implement more integration tests.
b4c3653
* Add constructors with less parameters where applicable
2b5d9c3
Merge branch 'df-analyticsconfig' into df-analyticsconfig-methods
6bd4e4a
* Implement Request converter tests for DataFrameAnalytics requests.
987f1e9
Merge branch 'feature-ml-data-frame-analytics' into df-analyticsconfi…
fd586b1
Use PageParams in GetDataFrameAnalyticsRequest.
a888876
Make static field access unqualified.
ad52eb6
Resolve issues resulting from code review.
988d5e7
Fix style.
a0f0c7e
Fix RestHighLevelClientTests.testProvidedNamedXContents test
4197fd2
Add test snippet for GET pagination
f164c23
Fix style
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...high-level/src/main/java/org/elasticsearch/client/ml/DeleteDataFrameAnalyticsRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| /* | ||
| * Licensed to Elasticsearch under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.elasticsearch.client.ml; | ||
|
|
||
| import org.elasticsearch.client.Validatable; | ||
| import org.elasticsearch.client.ValidationException; | ||
|
|
||
| import java.util.Objects; | ||
| import java.util.Optional; | ||
|
|
||
| /** | ||
| * Request to delete a data frame analytics config | ||
| */ | ||
| public class DeleteDataFrameAnalyticsRequest implements Validatable { | ||
|
|
||
| private final String id; | ||
|
|
||
| public DeleteDataFrameAnalyticsRequest(String id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
||
| @Override | ||
| public Optional<ValidationException> validate() { | ||
| if (id == null) { | ||
| return Optional.of(ValidationException.withError("data frame analytics id must not be null")); | ||
| } | ||
| return Optional.empty(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) return true; | ||
| if (o == null || getClass() != o.getClass()) return false; | ||
|
|
||
| DeleteDataFrameAnalyticsRequest other = (DeleteDataFrameAnalyticsRequest) o; | ||
| return Objects.equals(id, other.id); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(id); | ||
| } | ||
| } |
83 changes: 83 additions & 0 deletions
83
...st-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| /* | ||
| * Licensed to Elasticsearch under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.elasticsearch.client.ml; | ||
|
|
||
| import org.elasticsearch.client.Validatable; | ||
| import org.elasticsearch.client.ValidationException; | ||
| import org.elasticsearch.client.ml.job.util.PageParams; | ||
| import org.elasticsearch.common.Nullable; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
| import java.util.Optional; | ||
|
|
||
| public class GetDataFrameAnalyticsRequest implements Validatable { | ||
|
|
||
| private final List<String> ids; | ||
| private PageParams pageParams; | ||
|
|
||
| /** | ||
| * Helper method to create a request that will get ALL Data Frame Analytics | ||
| * @return new {@link GetDataFrameAnalyticsRequest} object for the id "_all" | ||
| */ | ||
| public static GetDataFrameAnalyticsRequest getAllDataFrameAnalyticsRequest() { | ||
| return new GetDataFrameAnalyticsRequest("_all"); | ||
| } | ||
|
|
||
| public GetDataFrameAnalyticsRequest(String... ids) { | ||
| this.ids = Arrays.asList(ids); | ||
| } | ||
|
|
||
| public List<String> getIds() { | ||
| return ids; | ||
| } | ||
|
|
||
| public PageParams getPageParams() { | ||
| return pageParams; | ||
| } | ||
|
|
||
| public void setPageParams(@Nullable PageParams pageParams) { | ||
| this.pageParams = pageParams; | ||
| } | ||
|
|
||
| @Override | ||
| public Optional<ValidationException> validate() { | ||
| if (ids == null || ids.isEmpty()) { | ||
| return Optional.of(ValidationException.withError("data frame analytics id must not be null")); | ||
| } | ||
| return Optional.empty(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) return true; | ||
| if (o == null || getClass() != o.getClass()) return false; | ||
|
|
||
| GetDataFrameAnalyticsRequest other = (GetDataFrameAnalyticsRequest) o; | ||
| return Objects.equals(ids, other.ids) | ||
| && Objects.equals(pageParams, other.pageParams); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(ids, pageParams); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.