Skip to content
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

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

kaituo
Copy link
Collaborator

@kaituo kaituo commented Aug 11, 2023

Description

Replacements:

  • org.opensearch.common.io.stream.StreamInputorg.opensearch.core.common.io.stream.StreamInput
  • org.opensearch.common.io.stream.StreamOutputorg.opensearch.core.common.io.stream.StreamOutput
  • org.opensearch.common.io.stream.NamedWriteableRegistryorg.opensearch.core.common.io.stream.NamedWriteableRegistry
  • org.opensearch.common.xcontent.XContentParserUtilsorg.opensearch.core.xcontent.XContentParserUtils
  • org.opensearch.rest.RestStatusorg.opensearch.core.rest.RestStatus
  • org.opensearch.common.bytes.BytesReferenceorg.opensearch.core.common.bytes.BytesReference
  • org.opensearch.common.io.stream.InputStreamStreamInputorg.opensearch.core.common.io.stream.InputStreamStreamInput
  • org.opensearch.common.io.stream.OutputStreamStreamOutputorg.opensearch.core.common.io.stream.OutputStreamStreamOutput
  • org.opensearch.common.component.LifecycleListenerorg.opensearch.common.lifecycle.LifecycleListener
  • org.opensearch.common.io.stream.Writeableorg.opensearch.core.common.io.stream.Writeable
  • org.opensearch.common.io.stream.NotSerializableExceptionWrapperorg.opensearch.core.common.io.stream.NotSerializableExceptionWrapper
  • org.opensearch.common.bytes.BytesArrayorg.opensearch.core.common.bytes.BytesArray
  • XContentTypeMediaType
  • org.opensearch.common.ParsingExceptionorg.opensearch.core.common.ParsingException
  • org.opensearch.core.common.Strings.EMPTY_ARRAYorg.opensearch.core.common.Strings.EMPTY_ARRAY
  • org.opensearch.common.transport.TransportAddressorg.opensearch.core.common.transport.TransportAddress
  • org.opensearch.common.io.stream.NamedWriteableAwareStreamInputorg.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput
  • org.opensearch.common.unit.ByteSizeValueorg.opensearch.core.common.unit.ByteSizeValue
  • org.opensearch.index.Indexorg.opensearch.core.index.Index
  • org.opensearch.index.shard.ShardIdorg.opensearch.core.index.shard.ShardId
  • org.opensearch.core.index.IndexNotFoundExceptionorg.opensearch.index.IndexNotFoundException
  • org.opensearch.core.index.IndexingPressureorg.opensearch.index.IndexingPressure
  • com.carrotsearch.hppc.BitMixerorg.opensearch.common.util.BitMixer
  • Strings.toString(XContentBuilder)XContentBuilder.toString
  • org.apache.http.entity.ContentType.APPLICATION_JSONorg.apache.hc.core5.http.ContentType.APPLICATION_JSON
  • org.opensearch.action.support.nodes.BaseNodeRequestorg.opensearch.transport.TransportRequest
  • org.opensearch.transport.TransportResponseorg.opensearch.core.transport.TransportResponse
  • org.opensearch.core.transport.TransportResponseHandlerorg.opensearch.transport.TransportResponseHandler
  • org.opensearch.indices.breaker.NoneCircuitBreakerServiceorg.opensearch.core.indices.breaker.NoneCircuitBreakerService
  • MediaType.fromMediaTypeXContentType.fromMediaType
  • org.opensearch.common.transport.BoundTransportAddressorg.opensearch.core.common.transport.BoundTransportAddress

Modifications:

  • Updated StringTerms constructor. Removed requiredSize and minDocCount, added TermsAggregator.BucketCountThresholds. See details here.

Tests:

  • Completed successful 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.

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]>
@kaituo kaituo requested review from jackiehanyang, joshpalis and sudiptoguha and removed request for jackiehanyang August 11, 2023 15:49
@kaituo
Copy link
Collaborator Author

kaituo commented Aug 11, 2023

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}}}}}

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?

Copy link
Collaborator Author

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)

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).

Copy link
Collaborator Author

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, extra tests?

Copy link
Collaborator Author

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.

@kaituo kaituo merged commit bc6b8e6 into opensearch-project:2.x Aug 11, 2023
2 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants