From 7cb5378f829f6a7cb06844c21189a867b2c4af8d Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Tue, 20 Mar 2018 12:35:56 -0600 Subject: [PATCH] Fix compilation after merging XContent changes A backport missed these usages that had been removed. Original commit: elastic/x-pack-elasticsearch@9e47562dd1520f884c291f8c3abf5187742c9e6f --- .../xpack/core/watcher/actions/ActionWrapper.java | 2 +- .../xpack/core/watcher/client/WatchSourceBuilder.java | 4 ++-- .../org/elasticsearch/xpack/core/watcher/watch/Watch.java | 2 +- .../xpack/watcher/actions/index/IndexAction.java | 2 +- .../elasticsearch/xpack/watcher/common/http/HttpRequest.java | 4 ++-- .../xpack/watcher/common/http/HttpRequestTemplate.java | 4 ++-- .../elasticsearch/xpack/watcher/input/search/SearchInput.java | 2 +- .../xpack/watcher/transform/search/SearchTransform.java | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java b/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java index 0d7880674f8..47d3500f2e9 100644 --- a/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java +++ b/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java @@ -173,7 +173,7 @@ public class ActionWrapper implements ToXContentObject { builder.startObject(); TimeValue throttlePeriod = throttler.throttlePeriod(); if (throttlePeriod != null) { - builder.timeValueField(ThrottlerField.THROTTLE_PERIOD.getPreferredName(), + builder.humanReadableField(ThrottlerField.THROTTLE_PERIOD.getPreferredName(), ThrottlerField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod); } if (condition != null) { diff --git a/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/client/WatchSourceBuilder.java b/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/client/WatchSourceBuilder.java index 6c6f3ec24c1..b82e9b64109 100644 --- a/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/client/WatchSourceBuilder.java +++ b/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/client/WatchSourceBuilder.java @@ -152,7 +152,7 @@ public class WatchSourceBuilder implements ToXContentObject { } if (defaultThrottlePeriod != null) { - builder.timeValueField(WatchField.THROTTLE_PERIOD.getPreferredName(), + builder.humanReadableField(WatchField.THROTTLE_PERIOD.getPreferredName(), WatchField.THROTTLE_PERIOD_HUMAN.getPreferredName(), defaultThrottlePeriod); } @@ -204,7 +204,7 @@ public class WatchSourceBuilder implements ToXContentObject { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); if (throttlePeriod != null) { - builder.timeValueField(ThrottlerField.THROTTLE_PERIOD.getPreferredName(), + builder.humanReadableField(ThrottlerField.THROTTLE_PERIOD.getPreferredName(), ThrottlerField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod); } if (condition != null) { diff --git a/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Watch.java b/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Watch.java index 56cbba5cc16..75034752c3c 100644 --- a/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Watch.java +++ b/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Watch.java @@ -143,7 +143,7 @@ public class Watch implements ToXContentObject { builder.field(WatchField.TRANSFORM.getPreferredName()).startObject().field(transform.type(), transform, params).endObject(); } if (throttlePeriod != null) { - builder.timeValueField(WatchField.THROTTLE_PERIOD.getPreferredName(), + builder.humanReadableField(WatchField.THROTTLE_PERIOD.getPreferredName(), WatchField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod); } builder.startObject(WatchField.ACTIONS.getPreferredName()); diff --git a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java index 28dea801be6..ca36487f032 100644 --- a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java +++ b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java @@ -110,7 +110,7 @@ public class IndexAction implements Action { builder.field(Field.EXECUTION_TIME_FIELD.getPreferredName(), executionTimeField); } if (timeout != null) { - builder.timeValueField(Field.TIMEOUT.getPreferredName(), Field.TIMEOUT_HUMAN.getPreferredName(), timeout); + builder.humanReadableField(Field.TIMEOUT.getPreferredName(), Field.TIMEOUT_HUMAN.getPreferredName(), timeout); } if (dynamicNameTimeZone != null) { builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone); diff --git a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java index f10dd8ec3d4..b2ef351181c 100644 --- a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java +++ b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java @@ -160,11 +160,11 @@ public class HttpRequest implements ToXContentObject { builder.field(Field.BODY.getPreferredName(), body); } if (connectionTimeout != null) { - builder.timeValueField(HttpRequest.Field.CONNECTION_TIMEOUT.getPreferredName(), + builder.humanReadableField(HttpRequest.Field.CONNECTION_TIMEOUT.getPreferredName(), HttpRequest.Field.CONNECTION_TIMEOUT_HUMAN.getPreferredName(), connectionTimeout); } if (readTimeout != null) { - builder.timeValueField(HttpRequest.Field.READ_TIMEOUT.getPreferredName(), + builder.humanReadableField(HttpRequest.Field.READ_TIMEOUT.getPreferredName(), HttpRequest.Field.READ_TIMEOUT_HUMAN.getPreferredName(), readTimeout); } if (proxy != null) { diff --git a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplate.java b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplate.java index c345fe87693..e511b30ef59 100644 --- a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplate.java +++ b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplate.java @@ -192,11 +192,11 @@ public class HttpRequestTemplate implements ToXContentObject { builder.field(HttpRequest.Field.BODY.getPreferredName(), body, params); } if (connectionTimeout != null) { - builder.timeValueField(HttpRequest.Field.CONNECTION_TIMEOUT.getPreferredName(), + builder.humanReadableField(HttpRequest.Field.CONNECTION_TIMEOUT.getPreferredName(), HttpRequest.Field.CONNECTION_TIMEOUT_HUMAN.getPreferredName(), connectionTimeout); } if (readTimeout != null) { - builder.timeValueField(HttpRequest.Field.READ_TIMEOUT.getPreferredName(), + builder.humanReadableField(HttpRequest.Field.READ_TIMEOUT.getPreferredName(), HttpRequest.Field.READ_TIMEOUT_HUMAN.getPreferredName(), readTimeout); } if (proxy != null) { diff --git a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java index 47ca9abfa6e..e8acf1eae08 100644 --- a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java +++ b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java @@ -96,7 +96,7 @@ public class SearchInput implements Input { builder.field(Field.EXTRACT.getPreferredName(), extractKeys); } if (timeout != null) { - builder.timeValueField(Field.TIMEOUT.getPreferredName(), Field.TIMEOUT_HUMAN.getPreferredName(), timeout); + builder.humanReadableField(Field.TIMEOUT.getPreferredName(), Field.TIMEOUT_HUMAN.getPreferredName(), timeout); } if (dynamicNameTimeZone != null) { builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone); diff --git a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java index cebfa33ec28..0d3eed3325d 100644 --- a/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java +++ b/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java @@ -79,7 +79,7 @@ public class SearchTransform implements Transform { builder.field(Field.REQUEST.getPreferredName(), request); } if (timeout != null) { - builder.timeValueField(Field.TIMEOUT.getPreferredName(), Field.TIMEOUT_HUMAN.getPreferredName(), timeout); + builder.humanReadableField(Field.TIMEOUT.getPreferredName(), Field.TIMEOUT_HUMAN.getPreferredName(), timeout); } if (dynamicNameTimeZone != null) { builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone);