Adjust to decoupling TimeValue from Writeable (elastic/x-pack-elasticsearch#4338)
This is the x-pack side of https://github.com/elastic/elasticsearch/pull/29454 Original commit: elastic/x-pack-elasticsearch@fab4d511ca
This commit is contained in:
parent
bd834b7357
commit
9eaec0c808
|
@ -149,7 +149,7 @@ public class GraphExploreRequest extends ActionRequest implements IndicesRequest
|
||||||
indicesOptions = IndicesOptions.readIndicesOptions(in);
|
indicesOptions = IndicesOptions.readIndicesOptions(in);
|
||||||
types = in.readStringArray();
|
types = in.readStringArray();
|
||||||
routing = in.readOptionalString();
|
routing = in.readOptionalString();
|
||||||
timeout = in.readOptionalWriteable(TimeValue::new);
|
timeout = in.readOptionalTimeValue();
|
||||||
sampleSize = in.readInt();
|
sampleSize = in.readInt();
|
||||||
sampleDiversityField = in.readOptionalString();
|
sampleDiversityField = in.readOptionalString();
|
||||||
maxDocsPerDiversityValue = in.readInt();
|
maxDocsPerDiversityValue = in.readInt();
|
||||||
|
@ -175,7 +175,7 @@ public class GraphExploreRequest extends ActionRequest implements IndicesRequest
|
||||||
indicesOptions.writeIndicesOptions(out);
|
indicesOptions.writeIndicesOptions(out);
|
||||||
out.writeStringArray(types);
|
out.writeStringArray(types);
|
||||||
out.writeOptionalString(routing);
|
out.writeOptionalString(routing);
|
||||||
out.writeOptionalWriteable(timeout);
|
out.writeOptionalTimeValue(timeout);
|
||||||
|
|
||||||
out.writeInt(sampleSize);
|
out.writeInt(sampleSize);
|
||||||
out.writeOptionalString(sampleDiversityField);
|
out.writeOptionalString(sampleDiversityField);
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class CloseJobAction extends Action<CloseJobAction.Request, CloseJobActio
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
jobId = in.readString();
|
jobId = in.readString();
|
||||||
timeout = new TimeValue(in);
|
timeout = in.readTimeValue();
|
||||||
force = in.readBoolean();
|
force = in.readBoolean();
|
||||||
openJobIds = in.readStringArray();
|
openJobIds = in.readStringArray();
|
||||||
local = in.readBoolean();
|
local = in.readBoolean();
|
||||||
|
@ -150,7 +150,7 @@ public class CloseJobAction extends Action<CloseJobAction.Request, CloseJobActio
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
out.writeString(jobId);
|
out.writeString(jobId);
|
||||||
timeout.writeTo(out);
|
out.writeTimeValue(timeout);
|
||||||
out.writeBoolean(force);
|
out.writeBoolean(force);
|
||||||
out.writeStringArray(openJobIds);
|
out.writeStringArray(openJobIds);
|
||||||
out.writeBoolean(local);
|
out.writeBoolean(local);
|
||||||
|
|
|
@ -117,15 +117,15 @@ public class ForecastJobAction extends Action<ForecastJobAction.Request, Forecas
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
this.duration = in.readOptionalWriteable(TimeValue::new);
|
this.duration = in.readOptionalTimeValue();
|
||||||
this.expiresIn = in.readOptionalWriteable(TimeValue::new);
|
this.expiresIn = in.readOptionalTimeValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
out.writeOptionalWriteable(duration);
|
out.writeOptionalTimeValue(duration);
|
||||||
out.writeOptionalWriteable(expiresIn);
|
out.writeOptionalTimeValue(expiresIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -184,7 +184,7 @@ public class GetJobsStatsAction extends Action<GetJobsStatsAction.Request, GetJo
|
||||||
state = JobState.fromStream(in);
|
state = JobState.fromStream(in);
|
||||||
node = in.readOptionalWriteable(DiscoveryNode::new);
|
node = in.readOptionalWriteable(DiscoveryNode::new);
|
||||||
assignmentExplanation = in.readOptionalString();
|
assignmentExplanation = in.readOptionalString();
|
||||||
openTime = in.readOptionalWriteable(TimeValue::new);
|
openTime = in.readOptionalTimeValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getJobId() {
|
public String getJobId() {
|
||||||
|
@ -263,7 +263,7 @@ public class GetJobsStatsAction extends Action<GetJobsStatsAction.Request, GetJo
|
||||||
state.writeTo(out);
|
state.writeTo(out);
|
||||||
out.writeOptionalWriteable(node);
|
out.writeOptionalWriteable(node);
|
||||||
out.writeOptionalString(assignmentExplanation);
|
out.writeOptionalString(assignmentExplanation);
|
||||||
out.writeOptionalWriteable(openTime);
|
out.writeOptionalTimeValue(openTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -213,7 +213,7 @@ public class GetOverallBucketsAction
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
jobId = in.readString();
|
jobId = in.readString();
|
||||||
topN = in.readVInt();
|
topN = in.readVInt();
|
||||||
bucketSpan = in.readOptionalWriteable(TimeValue::new);
|
bucketSpan = in.readOptionalTimeValue();
|
||||||
overallScore = in.readDouble();
|
overallScore = in.readDouble();
|
||||||
excludeInterim = in.readBoolean();
|
excludeInterim = in.readBoolean();
|
||||||
start = in.readOptionalLong();
|
start = in.readOptionalLong();
|
||||||
|
@ -226,7 +226,7 @@ public class GetOverallBucketsAction
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
out.writeString(jobId);
|
out.writeString(jobId);
|
||||||
out.writeVInt(topN);
|
out.writeVInt(topN);
|
||||||
out.writeOptionalWriteable(bucketSpan);
|
out.writeOptionalTimeValue(bucketSpan);
|
||||||
out.writeDouble(overallScore);
|
out.writeDouble(overallScore);
|
||||||
out.writeBoolean(excludeInterim);
|
out.writeBoolean(excludeInterim);
|
||||||
out.writeOptionalLong(start);
|
out.writeOptionalLong(start);
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class StopDatafeedAction
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
datafeedId = in.readString();
|
datafeedId = in.readString();
|
||||||
resolvedStartedDatafeedIds = in.readStringArray();
|
resolvedStartedDatafeedIds = in.readStringArray();
|
||||||
stopTimeout = new TimeValue(in);
|
stopTimeout = in.readTimeValue();
|
||||||
force = in.readBoolean();
|
force = in.readBoolean();
|
||||||
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
|
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||||
allowNoDatafeeds = in.readBoolean();
|
allowNoDatafeeds = in.readBoolean();
|
||||||
|
@ -161,7 +161,7 @@ public class StopDatafeedAction
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
out.writeString(datafeedId);
|
out.writeString(datafeedId);
|
||||||
out.writeStringArray(resolvedStartedDatafeedIds);
|
out.writeStringArray(resolvedStartedDatafeedIds);
|
||||||
stopTimeout.writeTo(out);
|
out.writeTimeValue(stopTimeout);
|
||||||
out.writeBoolean(force);
|
out.writeBoolean(force);
|
||||||
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
|
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||||
out.writeBoolean(allowNoDatafeeds);
|
out.writeBoolean(allowNoDatafeeds);
|
||||||
|
|
|
@ -67,13 +67,13 @@ public class ChunkingConfig implements ToXContentObject, Writeable {
|
||||||
|
|
||||||
public ChunkingConfig(StreamInput in) throws IOException {
|
public ChunkingConfig(StreamInput in) throws IOException {
|
||||||
mode = Mode.readFromStream(in);
|
mode = Mode.readFromStream(in);
|
||||||
timeSpan = in.readOptionalWriteable(TimeValue::new);
|
timeSpan = in.readOptionalTimeValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
mode.writeTo(out);
|
mode.writeTo(out);
|
||||||
out.writeOptionalWriteable(timeSpan);
|
out.writeOptionalTimeValue(timeSpan);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChunkingConfig(Mode mode, @Nullable TimeValue timeSpan) {
|
ChunkingConfig(Mode mode, @Nullable TimeValue timeSpan) {
|
||||||
|
|
|
@ -169,8 +169,8 @@ public class DatafeedConfig extends AbstractDiffable<DatafeedConfig> implements
|
||||||
public DatafeedConfig(StreamInput in) throws IOException {
|
public DatafeedConfig(StreamInput in) throws IOException {
|
||||||
this.id = in.readString();
|
this.id = in.readString();
|
||||||
this.jobId = in.readString();
|
this.jobId = in.readString();
|
||||||
this.queryDelay = in.readOptionalWriteable(TimeValue::new);
|
this.queryDelay = in.readOptionalTimeValue();
|
||||||
this.frequency = in.readOptionalWriteable(TimeValue::new);
|
this.frequency = in.readOptionalTimeValue();
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
this.indices = in.readList(StreamInput::readString);
|
this.indices = in.readList(StreamInput::readString);
|
||||||
} else {
|
} else {
|
||||||
|
@ -267,8 +267,8 @@ public class DatafeedConfig extends AbstractDiffable<DatafeedConfig> implements
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeString(id);
|
out.writeString(id);
|
||||||
out.writeString(jobId);
|
out.writeString(jobId);
|
||||||
out.writeOptionalWriteable(queryDelay);
|
out.writeOptionalTimeValue(queryDelay);
|
||||||
out.writeOptionalWriteable(frequency);
|
out.writeOptionalTimeValue(frequency);
|
||||||
if (indices != null) {
|
if (indices != null) {
|
||||||
out.writeBoolean(true);
|
out.writeBoolean(true);
|
||||||
out.writeStringList(indices);
|
out.writeStringList(indices);
|
||||||
|
|
|
@ -103,8 +103,8 @@ public class DatafeedUpdate implements Writeable, ToXContentObject {
|
||||||
public DatafeedUpdate(StreamInput in) throws IOException {
|
public DatafeedUpdate(StreamInput in) throws IOException {
|
||||||
this.id = in.readString();
|
this.id = in.readString();
|
||||||
this.jobId = in.readOptionalString();
|
this.jobId = in.readOptionalString();
|
||||||
this.queryDelay = in.readOptionalWriteable(TimeValue::new);
|
this.queryDelay = in.readOptionalTimeValue();
|
||||||
this.frequency = in.readOptionalWriteable(TimeValue::new);
|
this.frequency = in.readOptionalTimeValue();
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
this.indices = in.readList(StreamInput::readString);
|
this.indices = in.readList(StreamInput::readString);
|
||||||
} else {
|
} else {
|
||||||
|
@ -141,8 +141,8 @@ public class DatafeedUpdate implements Writeable, ToXContentObject {
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeString(id);
|
out.writeString(id);
|
||||||
out.writeOptionalString(jobId);
|
out.writeOptionalString(jobId);
|
||||||
out.writeOptionalWriteable(queryDelay);
|
out.writeOptionalTimeValue(queryDelay);
|
||||||
out.writeOptionalWriteable(frequency);
|
out.writeOptionalTimeValue(frequency);
|
||||||
if (indices != null) {
|
if (indices != null) {
|
||||||
out.writeBoolean(true);
|
out.writeBoolean(true);
|
||||||
out.writeStringList(indices);
|
out.writeStringList(indices);
|
||||||
|
|
|
@ -155,7 +155,7 @@ public class AnalysisConfig implements ToXContentObject, Writeable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public AnalysisConfig(StreamInput in) throws IOException {
|
public AnalysisConfig(StreamInput in) throws IOException {
|
||||||
bucketSpan = new TimeValue(in);
|
bucketSpan = in.readTimeValue();
|
||||||
categorizationFieldName = in.readOptionalString();
|
categorizationFieldName = in.readOptionalString();
|
||||||
categorizationFilters = in.readBoolean() ? in.readList(StreamInput::readString) : null;
|
categorizationFilters = in.readBoolean() ? in.readList(StreamInput::readString) : null;
|
||||||
if (in.getVersion().onOrAfter(Version.V_6_2_0)) {
|
if (in.getVersion().onOrAfter(Version.V_6_2_0)) {
|
||||||
|
@ -163,20 +163,29 @@ public class AnalysisConfig implements ToXContentObject, Writeable {
|
||||||
} else {
|
} else {
|
||||||
categorizationAnalyzerConfig = null;
|
categorizationAnalyzerConfig = null;
|
||||||
}
|
}
|
||||||
latency = in.readOptionalWriteable(TimeValue::new);
|
latency = in.readOptionalTimeValue();
|
||||||
summaryCountFieldName = in.readOptionalString();
|
summaryCountFieldName = in.readOptionalString();
|
||||||
detectors = in.readList(Detector::new);
|
detectors = in.readList(Detector::new);
|
||||||
influencers = in.readList(StreamInput::readString);
|
influencers = in.readList(StreamInput::readString);
|
||||||
overlappingBuckets = in.readOptionalBoolean();
|
overlappingBuckets = in.readOptionalBoolean();
|
||||||
resultFinalizationWindow = in.readOptionalLong();
|
resultFinalizationWindow = in.readOptionalLong();
|
||||||
multivariateByFields = in.readOptionalBoolean();
|
multivariateByFields = in.readOptionalBoolean();
|
||||||
multipleBucketSpans = in.readBoolean() ? in.readList(TimeValue::new) : null;
|
if (in.readBoolean()) {
|
||||||
|
final int arraySize = in.readVInt();
|
||||||
|
final List<TimeValue> spans = new ArrayList<>(arraySize);
|
||||||
|
for (int i = 0; i < arraySize; i++) {
|
||||||
|
spans.add(in.readTimeValue());
|
||||||
|
}
|
||||||
|
multipleBucketSpans = spans;
|
||||||
|
} else {
|
||||||
|
multipleBucketSpans = null;
|
||||||
|
}
|
||||||
usePerPartitionNormalization = in.readBoolean();
|
usePerPartitionNormalization = in.readBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
bucketSpan.writeTo(out);
|
out.writeTimeValue(bucketSpan);
|
||||||
out.writeOptionalString(categorizationFieldName);
|
out.writeOptionalString(categorizationFieldName);
|
||||||
if (categorizationFilters != null) {
|
if (categorizationFilters != null) {
|
||||||
out.writeBoolean(true);
|
out.writeBoolean(true);
|
||||||
|
@ -187,7 +196,7 @@ public class AnalysisConfig implements ToXContentObject, Writeable {
|
||||||
if (out.getVersion().onOrAfter(Version.V_6_2_0)) {
|
if (out.getVersion().onOrAfter(Version.V_6_2_0)) {
|
||||||
out.writeOptionalWriteable(categorizationAnalyzerConfig);
|
out.writeOptionalWriteable(categorizationAnalyzerConfig);
|
||||||
}
|
}
|
||||||
out.writeOptionalWriteable(latency);
|
out.writeOptionalTimeValue(latency);
|
||||||
out.writeOptionalString(summaryCountFieldName);
|
out.writeOptionalString(summaryCountFieldName);
|
||||||
out.writeList(detectors);
|
out.writeList(detectors);
|
||||||
out.writeStringList(influencers);
|
out.writeStringList(influencers);
|
||||||
|
@ -196,7 +205,10 @@ public class AnalysisConfig implements ToXContentObject, Writeable {
|
||||||
out.writeOptionalBoolean(multivariateByFields);
|
out.writeOptionalBoolean(multivariateByFields);
|
||||||
if (multipleBucketSpans != null) {
|
if (multipleBucketSpans != null) {
|
||||||
out.writeBoolean(true);
|
out.writeBoolean(true);
|
||||||
out.writeList(multipleBucketSpans);
|
out.writeVInt(multipleBucketSpans.size());
|
||||||
|
for (TimeValue span : multipleBucketSpans) {
|
||||||
|
out.writeTimeValue(span);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
out.writeBoolean(false);
|
out.writeBoolean(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,7 +241,7 @@ public class Job extends AbstractDiffable<Job> implements Writeable, ToXContentO
|
||||||
dataDescription = in.readOptionalWriteable(DataDescription::new);
|
dataDescription = in.readOptionalWriteable(DataDescription::new);
|
||||||
modelPlotConfig = in.readOptionalWriteable(ModelPlotConfig::new);
|
modelPlotConfig = in.readOptionalWriteable(ModelPlotConfig::new);
|
||||||
renormalizationWindowDays = in.readOptionalLong();
|
renormalizationWindowDays = in.readOptionalLong();
|
||||||
backgroundPersistInterval = in.readOptionalWriteable(TimeValue::new);
|
backgroundPersistInterval = in.readOptionalTimeValue();
|
||||||
modelSnapshotRetentionDays = in.readOptionalLong();
|
modelSnapshotRetentionDays = in.readOptionalLong();
|
||||||
resultsRetentionDays = in.readOptionalLong();
|
resultsRetentionDays = in.readOptionalLong();
|
||||||
customSettings = in.readMap();
|
customSettings = in.readMap();
|
||||||
|
@ -517,7 +517,7 @@ public class Job extends AbstractDiffable<Job> implements Writeable, ToXContentO
|
||||||
out.writeOptionalWriteable(dataDescription);
|
out.writeOptionalWriteable(dataDescription);
|
||||||
out.writeOptionalWriteable(modelPlotConfig);
|
out.writeOptionalWriteable(modelPlotConfig);
|
||||||
out.writeOptionalLong(renormalizationWindowDays);
|
out.writeOptionalLong(renormalizationWindowDays);
|
||||||
out.writeOptionalWriteable(backgroundPersistInterval);
|
out.writeOptionalTimeValue(backgroundPersistInterval);
|
||||||
out.writeOptionalLong(modelSnapshotRetentionDays);
|
out.writeOptionalLong(modelSnapshotRetentionDays);
|
||||||
out.writeOptionalLong(resultsRetentionDays);
|
out.writeOptionalLong(resultsRetentionDays);
|
||||||
out.writeMap(customSettings);
|
out.writeMap(customSettings);
|
||||||
|
@ -753,7 +753,7 @@ public class Job extends AbstractDiffable<Job> implements Writeable, ToXContentO
|
||||||
dataDescription = in.readOptionalWriteable(DataDescription::new);
|
dataDescription = in.readOptionalWriteable(DataDescription::new);
|
||||||
modelPlotConfig = in.readOptionalWriteable(ModelPlotConfig::new);
|
modelPlotConfig = in.readOptionalWriteable(ModelPlotConfig::new);
|
||||||
renormalizationWindowDays = in.readOptionalLong();
|
renormalizationWindowDays = in.readOptionalLong();
|
||||||
backgroundPersistInterval = in.readOptionalWriteable(TimeValue::new);
|
backgroundPersistInterval = in.readOptionalTimeValue();
|
||||||
modelSnapshotRetentionDays = in.readOptionalLong();
|
modelSnapshotRetentionDays = in.readOptionalLong();
|
||||||
resultsRetentionDays = in.readOptionalLong();
|
resultsRetentionDays = in.readOptionalLong();
|
||||||
customSettings = in.readMap();
|
customSettings = in.readMap();
|
||||||
|
@ -960,7 +960,7 @@ public class Job extends AbstractDiffable<Job> implements Writeable, ToXContentO
|
||||||
out.writeOptionalWriteable(dataDescription);
|
out.writeOptionalWriteable(dataDescription);
|
||||||
out.writeOptionalWriteable(modelPlotConfig);
|
out.writeOptionalWriteable(modelPlotConfig);
|
||||||
out.writeOptionalLong(renormalizationWindowDays);
|
out.writeOptionalLong(renormalizationWindowDays);
|
||||||
out.writeOptionalWriteable(backgroundPersistInterval);
|
out.writeOptionalTimeValue(backgroundPersistInterval);
|
||||||
out.writeOptionalLong(modelSnapshotRetentionDays);
|
out.writeOptionalLong(modelSnapshotRetentionDays);
|
||||||
out.writeOptionalLong(resultsRetentionDays);
|
out.writeOptionalLong(resultsRetentionDays);
|
||||||
out.writeMap(customSettings);
|
out.writeMap(customSettings);
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class JobUpdate implements Writeable, ToXContentObject {
|
||||||
modelPlotConfig = in.readOptionalWriteable(ModelPlotConfig::new);
|
modelPlotConfig = in.readOptionalWriteable(ModelPlotConfig::new);
|
||||||
analysisLimits = in.readOptionalWriteable(AnalysisLimits::new);
|
analysisLimits = in.readOptionalWriteable(AnalysisLimits::new);
|
||||||
renormalizationWindowDays = in.readOptionalLong();
|
renormalizationWindowDays = in.readOptionalLong();
|
||||||
backgroundPersistInterval = in.readOptionalWriteable(TimeValue::new);
|
backgroundPersistInterval = in.readOptionalTimeValue();
|
||||||
modelSnapshotRetentionDays = in.readOptionalLong();
|
modelSnapshotRetentionDays = in.readOptionalLong();
|
||||||
resultsRetentionDays = in.readOptionalLong();
|
resultsRetentionDays = in.readOptionalLong();
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
|
@ -146,7 +146,7 @@ public class JobUpdate implements Writeable, ToXContentObject {
|
||||||
out.writeOptionalWriteable(modelPlotConfig);
|
out.writeOptionalWriteable(modelPlotConfig);
|
||||||
out.writeOptionalWriteable(analysisLimits);
|
out.writeOptionalWriteable(analysisLimits);
|
||||||
out.writeOptionalLong(renormalizationWindowDays);
|
out.writeOptionalLong(renormalizationWindowDays);
|
||||||
out.writeOptionalWriteable(backgroundPersistInterval);
|
out.writeOptionalTimeValue(backgroundPersistInterval);
|
||||||
out.writeOptionalLong(modelSnapshotRetentionDays);
|
out.writeOptionalLong(modelSnapshotRetentionDays);
|
||||||
out.writeOptionalLong(resultsRetentionDays);
|
out.writeOptionalLong(resultsRetentionDays);
|
||||||
out.writeBoolean(categorizationFilters != null);
|
out.writeBoolean(categorizationFilters != null);
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class RollupJobConfig implements NamedWriteable, ToXContentObject {
|
||||||
cron = in.readString();
|
cron = in.readString();
|
||||||
groupConfig = in.readOptionalWriteable(GroupConfig::new);
|
groupConfig = in.readOptionalWriteable(GroupConfig::new);
|
||||||
metricsConfig = in.readList(MetricConfig::new);
|
metricsConfig = in.readList(MetricConfig::new);
|
||||||
timeout = new TimeValue(in);
|
timeout = in.readTimeValue();
|
||||||
pageSize = in.readInt();
|
pageSize = in.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ public class RollupJobConfig implements NamedWriteable, ToXContentObject {
|
||||||
out.writeString(cron);
|
out.writeString(cron);
|
||||||
out.writeOptionalWriteable(groupConfig);
|
out.writeOptionalWriteable(groupConfig);
|
||||||
out.writeList(metricsConfig);
|
out.writeList(metricsConfig);
|
||||||
timeout.writeTo(out);
|
out.writeTimeValue(timeout);
|
||||||
out.writeInt(pageSize);
|
out.writeInt(pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ public class RollupJobConfig implements NamedWriteable, ToXContentObject {
|
||||||
out.writeOptionalString(cron);
|
out.writeOptionalString(cron);
|
||||||
out.writeOptionalWriteable(groupConfig);
|
out.writeOptionalWriteable(groupConfig);
|
||||||
out.writeList(metricsConfig);
|
out.writeList(metricsConfig);
|
||||||
timeout.writeTo(out);
|
out.writeTimeValue(timeout);
|
||||||
out.writeInt(pageSize);
|
out.writeInt(pageSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ public final class SamlAuthenticateResponse extends ActionResponse {
|
||||||
out.writeString(principal);
|
out.writeString(principal);
|
||||||
out.writeString(tokenString);
|
out.writeString(tokenString);
|
||||||
out.writeString(refreshToken);
|
out.writeString(refreshToken);
|
||||||
expiresIn.writeTo(out);
|
out.writeTimeValue(expiresIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -65,6 +65,6 @@ public final class SamlAuthenticateResponse extends ActionResponse {
|
||||||
principal = in.readString();
|
principal = in.readString();
|
||||||
tokenString = in.readString();
|
tokenString = in.readString();
|
||||||
refreshToken = in.readString();
|
refreshToken = in.readString();
|
||||||
expiresIn = new TimeValue(in);
|
expiresIn = in.readTimeValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public final class CreateTokenResponse extends ActionResponse implements ToXCont
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
out.writeString(tokenString);
|
out.writeString(tokenString);
|
||||||
expiresIn.writeTo(out);
|
out.writeTimeValue(expiresIn);
|
||||||
out.writeOptionalString(scope);
|
out.writeOptionalString(scope);
|
||||||
if (out.getVersion().onOrAfter(Version.V_6_2_0)) {
|
if (out.getVersion().onOrAfter(Version.V_6_2_0)) {
|
||||||
out.writeString(refreshToken);
|
out.writeString(refreshToken);
|
||||||
|
@ -68,7 +68,7 @@ public final class CreateTokenResponse extends ActionResponse implements ToXCont
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
tokenString = in.readString();
|
tokenString = in.readString();
|
||||||
expiresIn = new TimeValue(in);
|
expiresIn = in.readTimeValue();
|
||||||
scope = in.readOptionalString();
|
scope = in.readOptionalString();
|
||||||
if (in.getVersion().onOrAfter(Version.V_6_2_0)) {
|
if (in.getVersion().onOrAfter(Version.V_6_2_0)) {
|
||||||
refreshToken = in.readString();
|
refreshToken = in.readString();
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class RestMonitoringBulkActionTests extends ESTestCase {
|
||||||
public void testWrongInterval() {
|
public void testWrongInterval() {
|
||||||
final RestRequest restRequest = createRestRequest(randomSystem().getSystem(), TEMPLATE_VERSION, "null");
|
final RestRequest restRequest = createRestRequest(randomSystem().getSystem(), TEMPLATE_VERSION, "null");
|
||||||
|
|
||||||
final ElasticsearchParseException exception = expectThrows(ElasticsearchParseException.class, () -> prepareRequest(restRequest));
|
final IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, () -> prepareRequest(restRequest));
|
||||||
assertThat(exception.getMessage(), containsString("failed to parse setting [interval] with value [null]"));
|
assertThat(exception.getMessage(), containsString("failed to parse setting [interval] with value [null]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,8 +192,8 @@ public abstract class AbstractSqlQueryRequest extends AbstractSqlRequest impleme
|
||||||
params = in.readList(SqlTypedParamValue::new);
|
params = in.readList(SqlTypedParamValue::new);
|
||||||
timeZone = DateTimeZone.forID(in.readString());
|
timeZone = DateTimeZone.forID(in.readString());
|
||||||
fetchSize = in.readVInt();
|
fetchSize = in.readVInt();
|
||||||
requestTimeout = new TimeValue(in);
|
requestTimeout = in.readTimeValue();
|
||||||
pageTimeout = new TimeValue(in);
|
pageTimeout = in.readTimeValue();
|
||||||
filter = in.readOptionalNamedWriteable(QueryBuilder.class);
|
filter = in.readOptionalNamedWriteable(QueryBuilder.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,8 +204,8 @@ public abstract class AbstractSqlQueryRequest extends AbstractSqlRequest impleme
|
||||||
out.writeList(params);
|
out.writeList(params);
|
||||||
out.writeString(timeZone.getID());
|
out.writeString(timeZone.getID());
|
||||||
out.writeVInt(fetchSize);
|
out.writeVInt(fetchSize);
|
||||||
requestTimeout.writeTo(out);
|
out.writeTimeValue(requestTimeout);
|
||||||
pageTimeout.writeTo(out);
|
out.writeTimeValue(pageTimeout);
|
||||||
out.writeOptionalNamedWriteable(filter);
|
out.writeOptionalNamedWriteable(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ public class AccountTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAccountTimeoutsConfiguredAsNumberAreRejected() {
|
public void testAccountTimeoutsConfiguredAsNumberAreRejected() {
|
||||||
expectThrows(ElasticsearchException.class, () -> {
|
expectThrows(IllegalArgumentException.class, () -> {
|
||||||
new Account(new Account.Config("default", Settings.builder()
|
new Account(new Account.Config("default", Settings.builder()
|
||||||
.put("smtp.host", "localhost")
|
.put("smtp.host", "localhost")
|
||||||
.put("smtp.port", server.port())
|
.put("smtp.port", server.port())
|
||||||
|
|
Loading…
Reference in New Issue