Skip to content

chore(deps): Revert - Upgrade jol-core to latest#148

Open
mblanco-denodo wants to merge 1 commit intoprestodb:masterfrom
mblanco-denodo:revert_jol_core
Open

chore(deps): Revert - Upgrade jol-core to latest#148
mblanco-denodo wants to merge 1 commit intoprestodb:masterfrom
mblanco-denodo:revert_jol_core

Conversation

@mblanco-denodo
Copy link
Copy Markdown

This reverts the jol-core update that broke old jdk compatibility: prestodb/presto#27382

This reverts the jol-core update that broke old jdk compatibility
@mblanco-denodo mblanco-denodo requested a review from a team as a code owner April 9, 2026 13:11
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 9, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Reverts the previous jol-core upgrade and associated dependency and API changes to restore compatibility with older JDKs, including switching memory-size calculations back to int-based APIs and aligning parent/plugin versions.

Class diagram for reverted HLL memory size API (class diagram)

classDiagram
    class HllInstance {
        <<interface>>
        +int getIndexBitLength()
        +int estimatedInMemorySize()
        +int estimatedSerializedSize()
        +void insertHash(long hash)
        +long cardinality()
    }

    class DenseHll {
        -static int DENSE_INSTANCE_SIZE
        -static int OVERFLOW_GROW_INCREMENT
        -byte indexBitLength
        -byte[] deltas
        -int[] overflowBuckets
        -byte[] overflowValues
        +DenseHll(byte indexBitLength)
        +void insertHash(long hash)
        +long cardinality()
        +int getIndexBitLength()
        +int estimatedInMemorySize()
        +int estimatedSerializedSize()
    }

    class SparseHll {
        -static int SPARSE_INSTANCE_SIZE
        -byte indexBitLength
        -int maxHash
        -int[] entries
        +SparseHll(byte indexBitLength)
        +void insertHash(long hash)
        +long cardinality()
        +int getIndexBitLength()
        +int estimatedInMemorySize()
        +int estimatedSerializedSize()
    }

    class HyperLogLog {
        -static int INSTANCE_SIZE
        -static int MAX_NUMBER_OF_BUCKETS
        -HllInstance instance
        +HyperLogLog(int indexBitLength)
        +void insertHash(long hash)
        +long cardinality()
        +void eachBucket(BucketListener listener)
        +int estimatedInMemorySize()
    }

    class QuantileDigest {
        -static int MAX_BITS
        -static int QUANTILE_DIGEST_SIZE
    }

    HllInstance <|.. DenseHll
    HllInstance <|.. SparseHll
    HyperLogLog o--> HllInstance
Loading

File-Level Changes

Change Details Files
Revert jol-core library and related build/dependency versions to older, JDK-compatible ones.
  • Downgrade org.openjdk.jol:jol-core from 0.17 to 0.2 in stats module POM
  • Restore parent airbase version from 109 to 108 in root POM
  • Downgrade maven-plugin-plugin and maven-shade-plugin to previously used versions in drift module POM
stats/pom.xml
pom.xml
drift/pom.xml
Align HyperLogLog-related APIs and implementations with older jol-core and JDK expectations by switching size accounting to int.
  • Change instance size constants from long to int in DenseHll, HyperLogLog, SparseHll, QuantileDigest, and corresponding test
  • Change estimatedInMemorySize signature in HllInstance and its implementations from long to int, adding explicit cast in DenseHll
  • Propagate return type change to HyperLogLog.estimatedInMemorySize to return int instead of long
stats/src/main/java/com/facebook/airlift/stats/cardinality/DenseHll.java
stats/src/main/java/com/facebook/airlift/stats/cardinality/HyperLogLog.java
stats/src/main/java/com/facebook/airlift/stats/cardinality/SparseHll.java
stats/src/main/java/com/facebook/airlift/stats/QuantileDigest.java
stats/src/main/java/com/facebook/airlift/stats/cardinality/HllInstance.java
stats/src/test/java/com/facebook/airlift/stats/cardinality/TestSparseHll.java
Minor test compatibility/tidiness adjustment for HTTPS client tests.
  • Wrap expectedExceptions value in braces in TestJettyHttpsClient to use array form annotation
http-client/src/test/java/com/facebook/airlift/http/client/jetty/TestJettyHttpsClient.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The change from long to int for estimatedInMemorySize() (and related constants) introduces a narrowing conversion and explicit cast in DenseHll; consider whether these size values could realistically exceed Integer.MAX_VALUE and, if so, keep the method/fields as long to avoid silent truncation.
  • Reverting jol-core and airbase versions may affect other code relying on APIs or behaviors from the newer versions; it may be safer to scope the revert only to the affected module or add a brief note in the commit message explaining why a full parent/dependency downgrade is necessary.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The change from `long` to `int` for `estimatedInMemorySize()` (and related constants) introduces a narrowing conversion and explicit cast in `DenseHll`; consider whether these size values could realistically exceed `Integer.MAX_VALUE` and, if so, keep the method/fields as `long` to avoid silent truncation.
- Reverting `jol-core` and `airbase` versions may affect other code relying on APIs or behaviors from the newer versions; it may be safer to scope the revert only to the affected module or add a brief note in the commit message explaining why a full parent/dependency downgrade is necessary.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

Copy link
Copy Markdown
Member

@imjalpreet imjalpreet left a comment

Choose a reason for hiding this comment

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

Thanks, @mblanco-denodo.

Reverts 27cd9ab and 8221b65

@imjalpreet imjalpreet requested a review from tdcmeehan April 13, 2026 10:25
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