Skip to content

Commit

Permalink
Merge remote-tracking branch 'elastic/master' into java-11-collection…
Browse files Browse the repository at this point in the history
…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
jasontedor committed Apr 26, 2019
2 parents 2d4ab87 + 29701b0 commit 62d7b7f
Show file tree
Hide file tree
Showing 728 changed files with 19,972 additions and 11,637 deletions.
2 changes: 1 addition & 1 deletion TESTING.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ password: `elastic-password`.
==== Other useful arguments

In order to start a node with a different max heap space add: `-Dtests.heap.size=4G`
In order to disable annotations add: `-Dtests.asserts=false`
In order to disable assertions add: `-Dtests.asserts=false`
In order to set an Elasticsearch setting, provide a setting with the following prefix: `-Dtests.es.`

=== Test case filtering.
Expand Down
6 changes: 2 additions & 4 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ sourceSets {
}
}
compileMinimumRuntimeGroovy {
// We can't use BuildPlugin here, so read from file
String minimumRuntimeVersion = file('src/main/resources/minimumRuntimeVersion').text.trim()
targetCompatibility = minimumRuntimeVersion
sourceCompatibility = minimumRuntimeVersion
targetCompatibility = 8
sourceCompatibility = 8
}
dependencies {
if (project.ext.has("isEclipse") == false || project.ext.isEclipse == false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,6 @@ class ClusterFormationTasks {
}
doLast {
project.delete(node.pidFile)
// Large tests can exhaust disk space, clean up on stop, but leave the data dir as some tests reuse it
project.delete(project.fileTree(node.baseDir).minus(project.fileTree(node.dataDir)))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ httpcore = 4.4.11
httpasyncclient = 4.1.4
commonslogging = 1.1.3
commonscodec = 1.11
hamcrest = 1.3
hamcrest = 2.1
securemock = 1.2
mocksocket = 1.2

Expand Down
1 change: 0 additions & 1 deletion client/rest-high-level/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ dependencies {
testCompile "org.elasticsearch.test:framework:${version}"
testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
testCompile "junit:junit:${versions.junit}"
testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
//this is needed to make RestHighLevelClientTests#testApiNamingConventions work from IDEs
testCompile "org.elasticsearch:rest-api-spec:${version}"
// Needed for serialization tests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public final class DataFrameClient {
* Creates a new Data Frame Transform
* <p>
* For additional info
* see <a href="https://www.TODO.com">Data Frame PUT transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html">
* Create data frame transform documentation</a>
*
* @param request The PutDataFrameTransformRequest containing the
* {@link org.elasticsearch.client.dataframe.transforms.DataFrameTransformConfig}.
Expand All @@ -69,7 +70,8 @@ public AcknowledgedResponse putDataFrameTransform(PutDataFrameTransformRequest r
* Creates a new Data Frame Transform asynchronously and notifies listener on completion
* <p>
* For additional info
* see <a href="https://www.TODO.com">Data Frame PUT transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html">
* Create data frame transform documentation</a>
*
* @param request The PutDataFrameTransformRequest containing the
* {@link org.elasticsearch.client.dataframe.transforms.DataFrameTransformConfig}.
Expand All @@ -90,7 +92,8 @@ public void putDataFrameTransformAsync(PutDataFrameTransformRequest request, Req
* Get the running statistics of a Data Frame Transform
* <p>
* For additional info
* see <a href="https://www.TODO.com">Get Data Frame transform stats documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html">
* Get data frame transform stats documentation</a>
*
* @param request Specifies the which transforms to get the stats for
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -110,7 +113,8 @@ public GetDataFrameTransformStatsResponse getDataFrameTransformStats(GetDataFram
* Get the running statistics of a Data Frame Transform asynchronously and notifies listener on completion
* <p>
* For additional info
* see <a href="https://www.TODO.com">Get Data Frame transform stats documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html">
* Get data frame transform stats documentation</a>
*
* @param request Specifies the which transforms to get the stats for
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -130,7 +134,8 @@ public void getDataFrameTransformStatsAsync(GetDataFrameTransformStatsRequest re
* Delete a data frame transform
* <p>
* For additional info
* see <a href="https://www.TODO.com">Data Frame delete transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html">
* Delete data frame transform documentation</a>
*
* @param request The delete data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -150,7 +155,8 @@ public AcknowledgedResponse deleteDataFrameTransform(DeleteDataFrameTransformReq
* Delete a data frame transform asynchronously and notifies listener on completion
* <p>
* For additional info
* see <a href="https://www.TODO.com">Data Frame delete transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html">
* Delete data frame transform documentation</a>
*
* @param request The delete data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -170,7 +176,8 @@ public void deleteDataFrameTransformAsync(DeleteDataFrameTransformRequest reques
* Preview the result of a data frame transform
* <p>
* For additional info
* see <a href="https://www.TODO.com">Preview Data Frame transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html">
* Preview data frame transform documentation</a>
*
* @param request The preview data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -189,8 +196,8 @@ public PreviewDataFrameTransformResponse previewDataFrameTransform(PreviewDataFr
/**
* Preview the result of a data frame transform asynchronously and notifies listener on completion
* <p>
* For additional info
* see <a href="https://www.TODO.com">Preview Data Frame transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html">
* Preview data frame transform documentation</a>
*
* @param request The preview data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -210,7 +217,8 @@ public void previewDataFrameTransformAsync(PreviewDataFrameTransformRequest requ
* Start a data frame transform
* <p>
* For additional info
* see <a href="https://www.TODO.com">Start Data Frame transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html">
* Start data frame transform documentation</a>
*
* @param request The start data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -230,7 +238,8 @@ public StartDataFrameTransformResponse startDataFrameTransform(StartDataFrameTra
* Start a data frame transform asynchronously and notifies listener on completion
* <p>
* For additional info
* see <a href="https://www.TODO.com">Start Data Frame transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html">
* Start data frame transform documentation</a>
*
* @param request The start data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -250,7 +259,8 @@ public void startDataFrameTransformAsync(StartDataFrameTransformRequest request,
* Stop a data frame transform
* <p>
* For additional info
* see <a href="https://www.TODO.com">Stop Data Frame transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html">
* Stop data frame transform documentation</a>
*
* @param request The stop data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -270,7 +280,8 @@ public StopDataFrameTransformResponse stopDataFrameTransform(StopDataFrameTransf
* Stop a data frame transform asynchronously and notifies listener on completion
* <p>
* For additional info
* see <a href="https://www.TODO.com">Stop Data Frame transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html">
* Stop data frame transform documentation</a>
*
* @param request The stop data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -290,7 +301,8 @@ public void stopDataFrameTransformAsync(StopDataFrameTransformRequest request, R
* Get one or more data frame transform configurations
* <p>
* For additional info
* see <a href="https://www.TODO.com">Get Data Frame transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html">
* Get data frame transform documentation</a>
*
* @param request The get data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand All @@ -310,7 +322,8 @@ public GetDataFrameTransformResponse getDataFrameTransform(GetDataFrameTransform
* Get one or more data frame transform configurations asynchronously and notifies listener on completion
* <p>
* For additional info
* see <a href="https://www.TODO.com">Get Data Frame transform documentation</a>
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html">
* Get data frame transform documentation</a>
*
* @param request The get data frame transform request
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ public SecurityClient security() {
* are shipped with the Elastic Stack distribution of Elasticsearch. All of
* these APIs will 404 if run against the OSS distribution of Elasticsearch.
* <p>
* See the <a href="TODO">Data Frame APIs on elastic.co</a> for more information.
* See the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/data-frame-apis.html">
* Data Frame APIs on elastic.co</a> for more information.
*
* @return the client wrapper for making Data Frame API calls
*/
Expand Down
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);
}
}
Loading

0 comments on commit 62d7b7f

Please sign in to comment.