diff --git a/.github/workflows/pinot_tests.yml b/.github/workflows/pinot_tests.yml index 727280bd2e3d..0417d3f92727 100644 --- a/.github/workflows/pinot_tests.yml +++ b/.github/workflows/pinot_tests.yml @@ -77,12 +77,22 @@ jobs: fail-fast: false matrix: testset: [ 1, 2 ] - java: [ 11, 17, 20 ] + java: [ 11, 21 ] distribution: [ "temurin" ] - name: Pinot Unit Test Set ${{ matrix.testset }} (${{matrix.distribution}}-${{matrix.java}}) + skip_bytebuffer: [false] + include: + - java: 21 + testset: 1 + distribution: "temurin" + skip_bytebuffer: true + - java: 21 + testset: 2 + distribution: "temurin" + skip_bytebuffer: true + name: Pinot Unit Test Set ${{ matrix.testset }} (${{matrix.distribution}}-${{matrix.java}}) with skip bytebuffers:${{matrix.skip_bytebuffer}} steps: - uses: actions/checkout@v3 - - name: Set up JDK ${{ matrix.java }} + - name: Set up JDK ${{ matrix.java }}-${{ matrix.distribution }} uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} @@ -116,6 +126,7 @@ jobs: env: RUN_INTEGRATION_TESTS: false RUN_TEST_SET: ${{ matrix.testset }} + PINOT_OFFHEAP_SKIP_BYTEBUFFER: ${{ matrix.skip_bytebuffer }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} MAVEN_OPTS: > -Xmx2G -DskipShade -DfailIfNoTests=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 @@ -132,7 +143,7 @@ jobs: continue-on-error: true timeout-minutes: 5 with: - flags: unittests,unittests${{ matrix.testset }},${{matrix.distribution}},java-${{matrix.java}} + flags: unittests,unittests${{ matrix.testset }},${{matrix.distribution}},java-${{matrix.java}},skip-bytebuffers-${{matrix.skip_bytebuffer}} name: codecov-unit-tests fail_ci_if_error: false verbose: true @@ -145,12 +156,22 @@ jobs: fail-fast: false matrix: testset: [ 1, 2 ] - java: [ 11, 17, 20 ] + java: [ 11, 21 ] distribution: [ "temurin" ] - name: Pinot Integration Test Set ${{ matrix.testset }} (${{matrix.distribution}}-${{matrix.java}}) + skip_bytebuffer: [false] + include: + - java: 21 + testset: 1 + distribution: "temurin" + skip_bytebuffer: true + - java: 21 + testset: 2 + distribution: "temurin" + skip_bytebuffer: true + name: Pinot Integration Test Set ${{ matrix.testset }} (${{matrix.distribution}}-${{matrix.java}}) with skip bytebuffers:${{matrix.skip_bytebuffer}} steps: - uses: actions/checkout@v3 - - name: Set up JDK ${{ matrix.java }} + - name: Set up JDK ${{ matrix.java }}-${{ matrix.distribution }} uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} @@ -183,6 +204,7 @@ jobs: env: RUN_INTEGRATION_TESTS: true RUN_TEST_SET: ${{ matrix.testset }} + PINOT_OFFHEAP_SKIP_BYTEBUFFER: ${{ matrix.skip_bytebuffer }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} MAVEN_OPTS: > -Xmx2G -DskipShade -DfailIfNoTests=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 @@ -199,7 +221,7 @@ jobs: continue-on-error: true timeout-minutes: 5 with: - flags: integration,integration${{ matrix.testset }},${{matrix.distribution}},java-${{matrix.java}} + flags: integration,integration${{ matrix.testset }},${{matrix.distribution}},java-${{matrix.java}},skip-bytebuffers-${{matrix.skip_bytebuffer}} name: codecov-integration-tests fail_ci_if_error: false verbose: true @@ -292,9 +314,14 @@ jobs: # Changed to false in order to improve coverage using unsafe buffers fail-fast: false matrix: - java: [ 11, 17, 20 ] + java: [ 11, 21 ] distribution: [ "temurin" ] - name: Pinot Quickstart on JDK ${{ matrix.java }} + skip_bytebuffer: [false] + include: + - java: 21 + distribution: "temurin" + skip_bytebuffer: true + name: Pinot Quickstart on JDK ${{ matrix.java }}-${{ matrix.distribution }} with skip bytebuffers:${{matrix.skip_bytebuffer}} steps: - uses: actions/checkout@v3 - name: Set up JDK ${{ matrix.java }} @@ -314,4 +341,6 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Quickstart on JDK ${{ matrix.java }} + env: + PINOT_OFFHEAP_SKIP_BYTEBUFFER: ${{ matrix.skip_bytebuffer }} run: .github/workflows/scripts/.pinot_quickstart.sh diff --git a/pinot-plugins/pinot-batch-ingestion/pinot-batch-ingestion-spark-3/pom.xml b/pinot-plugins/pinot-batch-ingestion/pinot-batch-ingestion-spark-3/pom.xml index 95f3fcdbc2bc..7f0e3c23f436 100644 --- a/pinot-plugins/pinot-batch-ingestion/pinot-batch-ingestion-spark-3/pom.xml +++ b/pinot-plugins/pinot-batch-ingestion/pinot-batch-ingestion-spark-3/pom.xml @@ -36,9 +36,7 @@ ${basedir}/../../.. package - 2.12 3.5.0 - 2.12.15 3.11 @@ -50,7 +48,7 @@ org.apache.spark - spark-core_${scala.major.version} + spark-core_${scala.compat.version} ${spark.version} provided @@ -99,7 +97,7 @@ org.scala-lang scala-library - ${scala.minor.version} + ${scala.version} provided diff --git a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/memory/PinotDataBuffer.java b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/memory/PinotDataBuffer.java index 9bd36aeb38d4..0895a1782bc3 100644 --- a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/memory/PinotDataBuffer.java +++ b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/memory/PinotDataBuffer.java @@ -67,6 +67,13 @@ public abstract class PinotDataBuffer implements Closeable { // With number of bytes less than this threshold, we get/put bytes one by one // With number of bytes more than this threshold, we create a ByteBuffer from the buffer and use bulk get/put method public static final int BULK_BYTES_PROCESSING_THRESHOLD = 10; + private static final String SKIP_BYTEBUFFER_ENV = "PINOT_OFFHEAP_SKIP_BYTEBUFFER"; + private static final boolean DEFAULT_PRIORITIZE_BYTE_BUFFER; + + static { + String skipBbEnvValue = System.getenv(SKIP_BYTEBUFFER_ENV); + DEFAULT_PRIORITIZE_BYTE_BUFFER = !Boolean.parseBoolean(skipBbEnvValue); + } private static class BufferContext { enum Type { @@ -152,17 +159,20 @@ public static PinotBufferFactory getFactory() { } public static PinotBufferFactory createDefaultFactory() { - return createDefaultFactory(true); + return createDefaultFactory(DEFAULT_PRIORITIZE_BYTE_BUFFER); } public static PinotBufferFactory createDefaultFactory(boolean prioritizeByteBuffer) { String factoryClassName; - if (JavaVersion.VERSION < 16) { - LOGGER.info("Using LArray as buffer on JVM version {}", JavaVersion.VERSION); - factoryClassName = LArrayPinotBufferFactory.class.getCanonicalName(); - } else { - LOGGER.info("Using Unsafe as buffer on JVM version {}", JavaVersion.VERSION); - factoryClassName = UnsafePinotBufferFactory.class.getCanonicalName(); + factoryClassName = System.getenv("PINOT_BUFFER_LIBRARY"); + if (factoryClassName == null) { + if (JavaVersion.VERSION < 16) { + LOGGER.info("Using LArray as buffer on JVM version {}", JavaVersion.VERSION); + factoryClassName = LArrayPinotBufferFactory.class.getCanonicalName(); + } else { + LOGGER.info("Using Unsafe as buffer on JVM version {}", JavaVersion.VERSION); + factoryClassName = UnsafePinotBufferFactory.class.getCanonicalName(); + } } return createFactory(factoryClassName, prioritizeByteBuffer); } diff --git a/pom.xml b/pom.xml index 4ab348ab1367..1fd92be11047 100644 --- a/pom.xml +++ b/pom.xml @@ -184,6 +184,10 @@ 2.12.18 2.12 + + 2.12.18 + 2.12 + 1.12.0 2.9.0 @@ -1138,13 +1142,13 @@ org.mockito mockito-core - 5.3.1 + 5.5.0 test org.mockito mockito-inline - 4.7.0 + 5.2.0 test @@ -1495,6 +1499,7 @@ --add-opens=java.base/java.util=ALL-UNNAMED --add-exports=java.base/jdk.internal.util.random=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED + -Dnet.bytebuddy.experimental=true