Fix compilation after merging XContent changes

A backport missed these usages that had been removed.

Original commit: elastic/x-pack-elasticsearch@9e47562dd1
This commit is contained in:
Lee Hinman 2018-03-20 12:35:56 -06:00
parent 9cfc759cfc
commit 7cb5378f82
8 changed files with 11 additions and 11 deletions

View File

@ -173,7 +173,7 @@ public class ActionWrapper implements ToXContentObject {
builder.startObject(); builder.startObject();
TimeValue throttlePeriod = throttler.throttlePeriod(); TimeValue throttlePeriod = throttler.throttlePeriod();
if (throttlePeriod != null) { if (throttlePeriod != null) {
builder.timeValueField(ThrottlerField.THROTTLE_PERIOD.getPreferredName(), builder.humanReadableField(ThrottlerField.THROTTLE_PERIOD.getPreferredName(),
ThrottlerField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod); ThrottlerField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod);
} }
if (condition != null) { if (condition != null) {

View File

@ -152,7 +152,7 @@ public class WatchSourceBuilder implements ToXContentObject {
} }
if (defaultThrottlePeriod != null) { if (defaultThrottlePeriod != null) {
builder.timeValueField(WatchField.THROTTLE_PERIOD.getPreferredName(), builder.humanReadableField(WatchField.THROTTLE_PERIOD.getPreferredName(),
WatchField.THROTTLE_PERIOD_HUMAN.getPreferredName(), defaultThrottlePeriod); WatchField.THROTTLE_PERIOD_HUMAN.getPreferredName(), defaultThrottlePeriod);
} }
@ -204,7 +204,7 @@ public class WatchSourceBuilder implements ToXContentObject {
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject(); builder.startObject();
if (throttlePeriod != null) { if (throttlePeriod != null) {
builder.timeValueField(ThrottlerField.THROTTLE_PERIOD.getPreferredName(), builder.humanReadableField(ThrottlerField.THROTTLE_PERIOD.getPreferredName(),
ThrottlerField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod); ThrottlerField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod);
} }
if (condition != null) { if (condition != null) {

View File

@ -143,7 +143,7 @@ public class Watch implements ToXContentObject {
builder.field(WatchField.TRANSFORM.getPreferredName()).startObject().field(transform.type(), transform, params).endObject(); builder.field(WatchField.TRANSFORM.getPreferredName()).startObject().field(transform.type(), transform, params).endObject();
} }
if (throttlePeriod != null) { if (throttlePeriod != null) {
builder.timeValueField(WatchField.THROTTLE_PERIOD.getPreferredName(), builder.humanReadableField(WatchField.THROTTLE_PERIOD.getPreferredName(),
WatchField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod); WatchField.THROTTLE_PERIOD_HUMAN.getPreferredName(), throttlePeriod);
} }
builder.startObject(WatchField.ACTIONS.getPreferredName()); builder.startObject(WatchField.ACTIONS.getPreferredName());

View File

@ -110,7 +110,7 @@ public class IndexAction implements Action {
builder.field(Field.EXECUTION_TIME_FIELD.getPreferredName(), executionTimeField); builder.field(Field.EXECUTION_TIME_FIELD.getPreferredName(), executionTimeField);
} }
if (timeout != null) { 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) { if (dynamicNameTimeZone != null) {
builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone); builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone);

View File

@ -160,11 +160,11 @@ public class HttpRequest implements ToXContentObject {
builder.field(Field.BODY.getPreferredName(), body); builder.field(Field.BODY.getPreferredName(), body);
} }
if (connectionTimeout != null) { if (connectionTimeout != null) {
builder.timeValueField(HttpRequest.Field.CONNECTION_TIMEOUT.getPreferredName(), builder.humanReadableField(HttpRequest.Field.CONNECTION_TIMEOUT.getPreferredName(),
HttpRequest.Field.CONNECTION_TIMEOUT_HUMAN.getPreferredName(), connectionTimeout); HttpRequest.Field.CONNECTION_TIMEOUT_HUMAN.getPreferredName(), connectionTimeout);
} }
if (readTimeout != null) { if (readTimeout != null) {
builder.timeValueField(HttpRequest.Field.READ_TIMEOUT.getPreferredName(), builder.humanReadableField(HttpRequest.Field.READ_TIMEOUT.getPreferredName(),
HttpRequest.Field.READ_TIMEOUT_HUMAN.getPreferredName(), readTimeout); HttpRequest.Field.READ_TIMEOUT_HUMAN.getPreferredName(), readTimeout);
} }
if (proxy != null) { if (proxy != null) {

View File

@ -192,11 +192,11 @@ public class HttpRequestTemplate implements ToXContentObject {
builder.field(HttpRequest.Field.BODY.getPreferredName(), body, params); builder.field(HttpRequest.Field.BODY.getPreferredName(), body, params);
} }
if (connectionTimeout != null) { if (connectionTimeout != null) {
builder.timeValueField(HttpRequest.Field.CONNECTION_TIMEOUT.getPreferredName(), builder.humanReadableField(HttpRequest.Field.CONNECTION_TIMEOUT.getPreferredName(),
HttpRequest.Field.CONNECTION_TIMEOUT_HUMAN.getPreferredName(), connectionTimeout); HttpRequest.Field.CONNECTION_TIMEOUT_HUMAN.getPreferredName(), connectionTimeout);
} }
if (readTimeout != null) { if (readTimeout != null) {
builder.timeValueField(HttpRequest.Field.READ_TIMEOUT.getPreferredName(), builder.humanReadableField(HttpRequest.Field.READ_TIMEOUT.getPreferredName(),
HttpRequest.Field.READ_TIMEOUT_HUMAN.getPreferredName(), readTimeout); HttpRequest.Field.READ_TIMEOUT_HUMAN.getPreferredName(), readTimeout);
} }
if (proxy != null) { if (proxy != null) {

View File

@ -96,7 +96,7 @@ public class SearchInput implements Input {
builder.field(Field.EXTRACT.getPreferredName(), extractKeys); builder.field(Field.EXTRACT.getPreferredName(), extractKeys);
} }
if (timeout != null) { 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) { if (dynamicNameTimeZone != null) {
builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone); builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone);

View File

@ -79,7 +79,7 @@ public class SearchTransform implements Transform {
builder.field(Field.REQUEST.getPreferredName(), request); builder.field(Field.REQUEST.getPreferredName(), request);
} }
if (timeout != null) { 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) { if (dynamicNameTimeZone != null) {
builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone); builder.field(Field.DYNAMIC_NAME_TIMEZONE.getPreferredName(), dynamicNameTimeZone);