Skip to content

NMS-17743: Add support for Elasticsearch 8.x #59

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Mohammad-Junid
Copy link

@Mohammad-Junid Mohammad-Junid commented Apr 14, 2025

Adds support for Elasticsearch 8.15.2 version

JIRA: NMS-17743

Here some notable changes while migrating from ES7 to ES 8.15.2

Time API Changes

  • ES7: Used Joda Time (org.joda.time.DateTime)
  • ES8: Uses Java Time API (java.time)

Rounding Changes

  • ES7: Used org.elasticsearch.common.rounding.Rounding
  • ES8: Simplified to org.elasticsearch.common.Rounding

Reduce Operation Changes

  • ES7: Used ReduceContext
  • ES8: Uses AggregationReduceContext

Reduce Method Structure

  • ES7: Direct reduce() implementation
  • ES8: Uses AggregatorReducer pattern

Bucket Reduction Changes

  • ES7: Used readList()/writeList()
  • ES8: Uses readCollectionAsList()/writeCollection()

Order Stream Handling
ES7: Required additional boolean parameter
i.e

order = InternalOrder.Streams.readHistogramOrder(in, false);
InternalOrder.Streams.writeHistogramOrder(order, out, false);

ES8: Simplified signature

order = InternalOrder.Streams.readHistogramOrder(in);
InternalOrder.Streams.writeHistogramOrder(order, out);

Aggregation Execution Context

  • ES7: Used LeafReaderContext directly

public LeafBucketCollector getLeafCollector(LeafReaderContext ctx, LeafBucketCollector sub)

  • ES8: Uses AggregationExecutionContext wrapper
    public LeafBucketCollector getLeafCollector(AggregationExecutionContext ctx, LeafBucketCollector sub)

Sub-aggregation Building

  • ES7: Used array of InternalAggregations
    nternalAggregations[] subAggregationResults = buildSubAggsForBuckets(bucketOrdsToCollect);

  • ES8: Uses IntFunction<InternalAggregations>
    IntFunction<InternalAggregations> subAggregationResults = buildSubAggsForBuckets(bucketOrdsToCollect);

@cgorantla cgorantla changed the title NMS-17743 implementation for ES8 NMS-17743: Add support for Elasticsearch 8.x Apr 14, 2025
Copy link

@cgorantla cgorantla left a comment

Choose a reason for hiding this comment

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

It would be good to know what has been updated in these files.

If you can add comments on the PR itself what are the changes needed for this to work will be helpful in reviewing this.

@mershad-manesh
Copy link
Contributor

I have pushed changes to CircleCI config file on master branch, you might want to grab those changes

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