forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'elastic/master' into java-11-collection…
…s-in-all-the-places * elastic/master: (70 commits) Remove experimental label froms script_score query (elastic#41572) [Ml-Dataframe] Update URLs in Data frame client java doc (elastic#41539) Reenable bwc Tests in master (elastic#41540) Fix search_as_you_type's sub-fields to pick their names from the full path of the root field (elastic#41541) Remove search analyzers from DocumentFieldMappers (elastic#41484) Update community client and integration docs (elastic#41513) Remove Version.V_6_x_x constants use in security (elastic#41185) Mute testDriverConfigurationWithSSLInURL Remove dedicated SSL network write buffer (elastic#41283) Disable max score optimization for queries with unbounded max scores (elastic#41361) [DOCS] Explicitly set section IDs for Asciidoctor migration (elastic#41547) [ML] add multi node integ tests for data frames (elastic#41508) [Docs] Fix common word repetitions (elastic#39703) [DOCS] Note TESTRESPONSE can't be used immediately after TESTSETUP (elastic#41542) Update configuring-ldap-realm.asciidoc (elastic#40427) Fixed very small typo in date (elastic#41398) Refactor GeoHashUtils (elastic#40869) Make 0 as invalid value for `min_children` in `has_child` query (elastic#41347) field_caps: adapt bwc version after backport (elastic#41427) Remove Exists Check from S3 Repository Deletes (elastic#40931) ...
- Loading branch information
Showing
728 changed files
with
19,972 additions
and
11,637 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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
94 changes: 94 additions & 0 deletions
94
...c/main/java/org/elasticsearch/client/dataframe/transforms/DataFrameTransformProgress.java
This file contains 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,94 @@ | ||
/* | ||
* 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.dataframe.transforms; | ||
|
||
import org.elasticsearch.common.ParseField; | ||
import org.elasticsearch.common.xcontent.ConstructingObjectParser; | ||
import org.elasticsearch.common.xcontent.XContentParser; | ||
|
||
import java.util.Objects; | ||
|
||
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; | ||
import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; | ||
|
||
public class DataFrameTransformProgress { | ||
|
||
public static final ParseField TOTAL_DOCS = new ParseField("total_docs"); | ||
public static final ParseField DOCS_REMAINING = new ParseField("docs_remaining"); | ||
public static final ParseField PERCENT_COMPLETE = new ParseField("percent_complete"); | ||
|
||
public static final ConstructingObjectParser<DataFrameTransformProgress, Void> PARSER = new ConstructingObjectParser<>( | ||
"data_frame_transform_progress", | ||
true, | ||
a -> new DataFrameTransformProgress((Long) a[0], (Long)a[1], (Double)a[2])); | ||
|
||
static { | ||
PARSER.declareLong(constructorArg(), TOTAL_DOCS); | ||
PARSER.declareLong(optionalConstructorArg(), DOCS_REMAINING); | ||
PARSER.declareDouble(optionalConstructorArg(), PERCENT_COMPLETE); | ||
} | ||
|
||
public static DataFrameTransformProgress fromXContent(XContentParser parser) { | ||
return PARSER.apply(parser, null); | ||
} | ||
|
||
private final long totalDocs; | ||
private final long remainingDocs; | ||
private final double percentComplete; | ||
|
||
public DataFrameTransformProgress(long totalDocs, Long remainingDocs, double percentComplete) { | ||
this.totalDocs = totalDocs; | ||
this.remainingDocs = remainingDocs == null ? totalDocs : remainingDocs; | ||
this.percentComplete = percentComplete; | ||
} | ||
|
||
public double getPercentComplete() { | ||
return percentComplete; | ||
} | ||
|
||
public long getTotalDocs() { | ||
return totalDocs; | ||
} | ||
|
||
public long getRemainingDocs() { | ||
return remainingDocs; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
if (other == this) { | ||
return true; | ||
} | ||
|
||
if (other == null || other.getClass() != getClass()) { | ||
return false; | ||
} | ||
|
||
DataFrameTransformProgress that = (DataFrameTransformProgress) other; | ||
return Objects.equals(this.remainingDocs, that.remainingDocs) | ||
&& Objects.equals(this.totalDocs, that.totalDocs) | ||
&& Objects.equals(this.percentComplete, that.percentComplete); | ||
} | ||
|
||
@Override | ||
public int hashCode(){ | ||
return Objects.hash(remainingDocs, totalDocs, percentComplete); | ||
} | ||
} |
Oops, something went wrong.