-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor due to core updates: Replace and modify classes and methods. #974
Conversation
Replacements: org.opensearch.common.io.stream.StreamInput => org.opensearch.core.common.io.stream.StreamInput org.opensearch.common.io.stream.StreamOutput => org.opensearch.core.common.io.stream.StreamOutput org.opensearch.common.io.stream.NamedWriteableRegistry => org.opensearch.core.common.io.stream.NamedWriteableRegistry org.opensearch.common.xcontent.XContentParserUtils => org.opensearch.core.xcontent.XContentParserUtils org.opensearch.rest.RestStatus => org.opensearch.core.rest.RestStatus org.opensearch.common.bytes.BytesReference => org.opensearch.core.common.bytes.BytesReference org.opensearch.common.io.stream.InputStreamStreamInput => org.opensearch.core.common.io.stream.InputStreamStreamInput org.opensearch.common.io.stream.OutputStreamStreamOutput => org.opensearch.core.common.io.stream.OutputStreamStreamOutput org.opensearch.common.component.LifecycleListener => org.opensearch.common.lifecycle.LifecycleListener org.opensearch.common.io.stream.Writeable => org.opensearch.core.common.io.stream.Writeable org.opensearch.common.io.stream.NotSerializableExceptionWrapper => org.opensearch.core.common.io.stream.NotSerializableExceptionWrapper org.opensearch.common.bytes.BytesArray => org.opensearch.core.common.bytes.BytesArray XContentType => MediaType org.opensearch.common.ParsingException => org.opensearch.core.common.ParsingException org.opensearch.core.common.Strings.EMPTY_ARRAY=> org.opensearch.core.common.Strings.EMPTY_ARRAY org.opensearch.common.transport.TransportAddress => org.opensearch.core.common.transport.TransportAddress org.opensearch.common.io.stream.NamedWriteableAwareStreamInput => org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput org.opensearch.common.unit.ByteSizeValue => org.opensearch.core.common.unit.ByteSizeValue org.opensearch.index.Index => org.opensearch.core.index.Index org.opensearch.index.shard.ShardId => org.opensearch.core.index.shard.ShardId org.opensearch.core.index.IndexNotFoundException => org.opensearch.index.IndexNotFoundException org.opensearch.core.index.IndexingPressure => org.opensearch.index.IndexingPressure com.carrotsearch.hppc.BitMixer => org.opensearch.common.util.BitMixer Strings.toString(XContentBuilder) => XContentBuilder.toString org.apache.http.entity.ContentType.APPLICATION_JSON => org.apache.hc.core5.http.ContentType.APPLICATION_JSON org.opensearch.action.support.nodes.BaseNodeRequest => org.opensearch.transport.TransportRequest org.opensearch.transport.TransportResponse => org.opensearch.core.transport.TransportResponse org.opensearch.core.transport.TransportResponseHandler => org.opensearch.transport.TransportResponseHandler org.opensearch.indices.breaker.NoneCircuitBreakerService => org.opensearch.core.indices.breaker.NoneCircuitBreakerService MediaType.fromMediaType => XContentType.fromMediaType org.opensearch.common.transport.BoundTransportAddress => org.opensearch.core.common.transport.BoundTransportAddress Modifications: - Updated `StringTerms` constructor. Removed `requiredSize` and `minDocCount`, added `TermsAggregator.BucketCountThresholds`. See details [here](opensearch-project/OpenSearch@15b7de0). Tests: - Completed successful `gradle build`. Signed-off-by: Kaituo Li <[email protected]>
Local build passes. CI failed due to Can't get https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-job-scheduler-2.10.0.0.zip to /Users/runner/work/anomaly-detection/anomaly-detection/src/test/resources/job-scheduler/opensearch-job-scheduler-2.10.0.0.zip |
@@ -608,10 +608,10 @@ protected void validateCategoricalField(String detectorId, boolean indexingDryRu | |||
ActionListener<GetFieldMappingsResponse> mappingsListener = ActionListener.wrap(getMappingsResponse -> { | |||
// example getMappingsResponse: | |||
// GetFieldMappingsResponse{mappings={server-metrics={_doc={service=FieldMappingMetadata{fullName='service', | |||
// source=org.opensearch.common.bytes.BytesArray@7ba87dbd}}}}} | |||
// source=org.opensearch.core.common.bytes.BytesArray@7ba87dbd}}}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is commented out. Is this for future use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a comment. The change is updating the comment.
Collections.emptyMap(), | ||
DocValueFormat.RAW, | ||
1, | ||
false, | ||
0, | ||
stringBuckets, | ||
0 | ||
0, | ||
new TermsAggregator.BucketCountThresholds(1, 0, 1, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An extra field for extra tests? I see (1,0,0) being deleted -- and the addition is (1,0,1,0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is due to changes in the core. Related wording in the PR description:
Updated StringTerms constructor. Removed requiredSize and minDocCount, added TermsAggregator.BucketCountThresholds. See details here
Collections.emptyMap(), | ||
DocValueFormat.RAW, | ||
1, | ||
false, | ||
0, | ||
ImmutableList.of(), | ||
0 | ||
0, | ||
new TermsAggregator.BucketCountThresholds(1, 0, 1, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, extra tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is due to core changes. Please see my above reply.
Description
Replacements:
org.opensearch.common.io.stream.StreamInput
→org.opensearch.core.common.io.stream.StreamInput
org.opensearch.common.io.stream.StreamOutput
→org.opensearch.core.common.io.stream.StreamOutput
org.opensearch.common.io.stream.NamedWriteableRegistry
→org.opensearch.core.common.io.stream.NamedWriteableRegistry
org.opensearch.common.xcontent.XContentParserUtils
→org.opensearch.core.xcontent.XContentParserUtils
org.opensearch.rest.RestStatus
→org.opensearch.core.rest.RestStatus
org.opensearch.common.bytes.BytesReference
→org.opensearch.core.common.bytes.BytesReference
org.opensearch.common.io.stream.InputStreamStreamInput
→org.opensearch.core.common.io.stream.InputStreamStreamInput
org.opensearch.common.io.stream.OutputStreamStreamOutput
→org.opensearch.core.common.io.stream.OutputStreamStreamOutput
org.opensearch.common.component.LifecycleListener
→org.opensearch.common.lifecycle.LifecycleListener
org.opensearch.common.io.stream.Writeable
→org.opensearch.core.common.io.stream.Writeable
org.opensearch.common.io.stream.NotSerializableExceptionWrapper
→org.opensearch.core.common.io.stream.NotSerializableExceptionWrapper
org.opensearch.common.bytes.BytesArray
→org.opensearch.core.common.bytes.BytesArray
XContentType
→MediaType
org.opensearch.common.ParsingException
→org.opensearch.core.common.ParsingException
org.opensearch.core.common.Strings.EMPTY_ARRAY
→org.opensearch.core.common.Strings.EMPTY_ARRAY
org.opensearch.common.transport.TransportAddress
→org.opensearch.core.common.transport.TransportAddress
org.opensearch.common.io.stream.NamedWriteableAwareStreamInput
→org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput
org.opensearch.common.unit.ByteSizeValue
→org.opensearch.core.common.unit.ByteSizeValue
org.opensearch.index.Index
→org.opensearch.core.index.Index
org.opensearch.index.shard.ShardId
→org.opensearch.core.index.shard.ShardId
org.opensearch.core.index.IndexNotFoundException
→org.opensearch.index.IndexNotFoundException
org.opensearch.core.index.IndexingPressure
→org.opensearch.index.IndexingPressure
com.carrotsearch.hppc.BitMixer
→org.opensearch.common.util.BitMixer
Strings.toString(XContentBuilder)
→XContentBuilder.toString
org.apache.http.entity.ContentType.APPLICATION_JSON
→org.apache.hc.core5.http.ContentType.APPLICATION_JSON
org.opensearch.action.support.nodes.BaseNodeRequest
→org.opensearch.transport.TransportRequest
org.opensearch.transport.TransportResponse
→org.opensearch.core.transport.TransportResponse
org.opensearch.core.transport.TransportResponseHandler
→org.opensearch.transport.TransportResponseHandler
org.opensearch.indices.breaker.NoneCircuitBreakerService
→org.opensearch.core.indices.breaker.NoneCircuitBreakerService
MediaType.fromMediaType
→XContentType.fromMediaType
org.opensearch.common.transport.BoundTransportAddress
→org.opensearch.core.common.transport.BoundTransportAddress
Modifications:
StringTerms
constructor. RemovedrequiredSize
andminDocCount
, addedTermsAggregator.BucketCountThresholds
. See details here.Tests:
gradle build
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.