diff --git a/.github/changes-filter.yaml b/.github/changes-filter.yaml
index 82f5b22a8aad9..72da09398ebaf 100644
--- a/.github/changes-filter.yaml
+++ b/.github/changes-filter.yaml
@@ -10,8 +10,6 @@ docs:
- '**/*.md'
tests:
- added|modified: '**/src/test/java/**/*.java'
-cpp:
- - 'pulsar-client-cpp/**'
need_owasp:
- 'pom.xml'
- '**/pom.xml'
diff --git a/.github/workflows/ci-cpp-build.yaml b/.github/workflows/ci-cpp-build.yaml
deleted file mode 100644
index 7a450efe9725d..0000000000000
--- a/.github/workflows/ci-cpp-build.yaml
+++ /dev/null
@@ -1,259 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-name: CI - CPP build
-on:
- pull_request:
- branches:
- - master
- paths:
- - '.github/workflows/**'
- - 'pulsar-client-cpp/**'
- workflow_dispatch:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- changed_files_job:
- name: Preconditions
- runs-on: ubuntu-20.04
- outputs:
- docs_only: ${{ needs.changed_files_job.outputs.docs_only }}
- cpp_only: ${{ needs.changed_files_job.outputs.cpp_only }}
- steps:
- - name: checkout
- uses: actions/checkout@v2
-
- - name: Detect changed files
- id: changes
- uses: apache/pulsar-test-infra/paths-filter@master
- with:
- filters: .github/changes-filter.yaml
- list-files: csv
-
- - name: Check changed files
- id: check_changes
- run: |
- echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
-
- - name: Check if the PR has been approved for testing
- if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
- env:
- GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
- GITHUB_TOKEN: ${{ github.token }}
- run: |
- build/pulsar_ci_tool.sh check_ready_to_test
-
- cpp-build-centos7:
- needs: changed_files_job
- name: Build CPP Client on CentOS7
- runs-on: ubuntu-20.04
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- timeout-minutes: 120
-
- steps:
- - name: checkout
- uses: actions/checkout@v2
-
- - name: Tune Runner VM
- uses: ./.github/actions/tune-runner-vm
-
- - name: build cpp client on centos 7
- run: |
- echo "Build C++ client library on CentOS 7"
- pulsar-client-cpp/docker-build-centos7.sh
-
- cpp-build-windows:
- needs: changed_files_job
- timeout-minutes: 120
- name: Build CPP Client on ${{ matrix.name }}
- runs-on: ${{ matrix.os }}
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- env:
- VCPKG_ROOT: '${{ github.workspace }}/vcpkg'
- strategy:
- fail-fast: false
- matrix:
- include:
- - name: 'Windows x64'
- os: windows-2022
- triplet: x64-windows
- vcpkg_dir: 'C:\vcpkg'
- suffix: 'windows-win64'
- generator: 'Visual Studio 17 2022'
- arch: '-A x64'
- - name: 'Windows x86'
- os: windows-2022
- triplet: x86-windows
- vcpkg_dir: 'C:\vcpkg'
- suffix: 'windows-win32'
- generator: 'Visual Studio 17 2022'
- arch: '-A Win32'
-
- steps:
- - name: checkout
- uses: actions/checkout@v2
-
- - name: Restore vcpkg and its artifacts.
- uses: actions/cache@v2
- id: vcpkg-cache
- with:
- path: |
- ${{ env.VCPKG_ROOT }}
- pulsar-client-cpp/vcpkg_installed
- !${{ env.VCPKG_ROOT }}/.git
- !${{ env.VCPKG_ROOT }}/buildtrees
- !${{ env.VCPKG_ROOT }}/packages
- !${{ env.VCPKG_ROOT }}/downloads
- key: |
- ${{ runner.os }}-${{ matrix.triplet}}-${{ hashFiles( 'pulsar-client-cpp/vcpkg.json' ) }}
-
- - name: Get vcpkg(windows)
- if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
- run: |
- cd ${{ github.workspace }}
- mkdir build -force
- git clone https://github.com/Microsoft/vcpkg.git
- cd vcpkg
- .\bootstrap-vcpkg.bat
-
- - name: remove system vcpkg(windows)
- if: runner.os == 'Windows'
- run: rm -rf "$VCPKG_INSTALLATION_ROOT"
- shell: bash
-
- - name: Install vcpkg packages
- run: |
- cd pulsar-client-cpp && ${{ env.VCPKG_ROOT }}\vcpkg.exe install --triplet ${{ matrix.triplet }}
-
- - name: Configure (default)
-
- shell: bash
- run: |
- if [ "$RUNNER_OS" == "Windows" ]; then
- cd pulsar-client-cpp && \
- cmake \
- -B ./build-0 \
- -G "${{ matrix.generator }}" ${{ matrix.arch }} \
- -DBUILD_PYTHON_WRAPPER=OFF -DBUILD_TESTS=OFF \
- -DVCPKG_TRIPLET=${{ matrix.triplet }} \
- -DCMAKE_BUILD_TYPE=Release \
- -S .
- fi
-
- - name: Compile
- shell: bash
- run: |
- if [ "$RUNNER_OS" == "Windows" ]; then
- cd pulsar-client-cpp && \
- cmake --build ./build-0 --parallel --config Release
- fi
-
- - name: Configure (dynamic library only)
- shell: bash
- run: |
- if [ "$RUNNER_OS" == "Windows" ]; then
- cd pulsar-client-cpp && \
- cmake \
- -B ./build-1 \
- -G "${{ matrix.generator }}" ${{ matrix.arch }} \
- -DBUILD_PYTHON_WRAPPER=OFF -DBUILD_TESTS=OFF \
- -DVCPKG_TRIPLET=${{ matrix.triplet }} \
- -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_STATIC_LIB=OFF \
- -S .
- fi
-
- - name: Compile
- shell: bash
- run: |
- if [ "$RUNNER_OS" == "Windows" ]; then
- cd pulsar-client-cpp && \
- cmake --build ./build-1 --parallel --config Release
- fi
- cpp-deb-rpm-packaging:
- needs: changed_files_job
- name: Build CPP Client on RPM
- runs-on: ubuntu-20.04
- timeout-minutes: 120
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
-
- steps:
- - name: checkout
- uses: actions/checkout@v2
-
- - name: Tune Runner VM
- uses: ./.github/actions/tune-runner-vm
-
- - name: Cache local Maven repository
- uses: actions/cache@v2
- with:
- path: |
- ~/.m2/repository/*/*/*
- !~/.m2/repository/org/apache/pulsar
- key: ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-m2-dependencies-core-modules-
-
- - name: Set up JDK 17
- uses: actions/setup-java@v2
- with:
- distribution: 'temurin'
- java-version: 17
-
- - name: clean disk
- run: |
- sudo apt clean
- docker rmi $(docker images -q) -f
- df -h
-
- - name: Package Pulsar source
- run: mvn -B -ntp -q clean package -pl pulsar-client-api -am -DskipTests
-
- - name: Build Debian packages
- run: |
- echo "Build Debian packages"
- BUILD_IMAGE=1 pulsar-client-cpp/pkg/deb/docker-build-deb.sh
-
- - name: Build RPM packages
- run: |
- echo "Build RPM packages"
- BUILD_IMAGE=1 pulsar-client-cpp/pkg/rpm/docker-build-rpm.sh
-
- build-python-wheel:
- needs: changed_files_job
- name: Build Python Client
- runs-on: ubuntu-20.04
- timeout-minutes: 120
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
-
- steps:
- - name: checkout
- uses: actions/checkout@v2
-
- - name: Tune Runner VM
- uses: ./.github/actions/tune-runner-vm
-
- - name: build python3.9 client
-
- run: |
- echo "Build Python3.9 client library"
- pulsar-client-cpp/docker-build-python3.9.sh
\ No newline at end of file
diff --git a/.github/workflows/ci-go-functions.yaml b/.github/workflows/ci-go-functions.yaml
index 266bfd57723f1..834451c1c70dd 100644
--- a/.github/workflows/ci-go-functions.yaml
+++ b/.github/workflows/ci-go-functions.yaml
@@ -40,7 +40,6 @@ jobs:
runs-on: ubuntu-20.04
outputs:
docs_only: ${{ steps.check_changes.outputs.docs_only }}
- cpp_only: ${{ steps.check_changes.outputs.cpp_only }}
steps:
- name: checkout
uses: actions/checkout@v2
@@ -56,7 +55,6 @@ jobs:
id: check_changes
run: |
echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
- echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
- name: Check if the PR has been approved for testing
if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -68,7 +66,7 @@ jobs:
check-style:
needs: changed_files_job
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
+ if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
name: Go ${{ matrix.go-version }} Functions style check
runs-on: ubuntu-20.04
strategy:
diff --git a/.github/workflows/pulsar-ci-flaky.yaml b/.github/workflows/pulsar-ci-flaky.yaml
index 03e3adff33a9d..3e8a3eb46ba0c 100644
--- a/.github/workflows/pulsar-ci-flaky.yaml
+++ b/.github/workflows/pulsar-ci-flaky.yaml
@@ -41,7 +41,6 @@ jobs:
runs-on: ubuntu-20.04
outputs:
docs_only: ${{ steps.check_changes.outputs.docs_only }}
- cpp_only: ${{ steps.check_changes.outputs.cpp_only }}
changed_tests: ${{ steps.changes.outputs.tests_files }}
steps:
- name: checkout
@@ -58,7 +57,6 @@ jobs:
id: check_changes
run: |
echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
- echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
- name: Check if the PR has been approved for testing
if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -73,7 +71,7 @@ jobs:
name: Flaky tests suite
runs-on: ubuntu-20.04
timeout-minutes: 100
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
+ if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
steps:
- name: checkout
uses: actions/checkout@v2
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index e9418ee963a53..ef641feec1523 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -41,7 +41,6 @@ jobs:
runs-on: ubuntu-20.04
outputs:
docs_only: ${{ steps.check_changes.outputs.docs_only }}
- cpp_only: ${{ steps.check_changes.outputs.cpp_only }}
changed_tests: ${{ steps.changes.outputs.tests_files }}
steps:
- name: checkout
@@ -58,7 +57,7 @@ jobs:
id: check_changes
run: |
echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
- echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
+
- name: Check if the PR has been approved for testing
if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -141,7 +140,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: ${{ matrix.timeout || 60 }}
needs: ['changed_files_job', 'build-and-license-check']
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
+ if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
strategy:
fail-fast: false
matrix:
@@ -255,7 +254,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 60
needs: ['changed_files_job', 'build-and-license-check']
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
+ if: ${{ needs.changed_files_job.outputs.docs_only != 'true'}}
env:
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/
steps:
@@ -320,7 +319,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: ${{ matrix.timeout || 60 }}
needs: ['changed_files_job', 'pulsar-java-test-image']
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
+ if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
env:
PULSAR_TEST_IMAGE_NAME: apachepulsar/java-test-image:latest
strategy:
@@ -462,7 +461,7 @@ jobs:
'changed_files_job',
'integration-tests'
]
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
+ if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
steps:
- name: checkout
uses: actions/checkout@v2
@@ -477,94 +476,6 @@ jobs:
run: |
gh-actions-artifact-client.js delete pulsar-java-test-image.zst
- cpp-tests:
- name: CI - CPP, Python Tests
- runs-on: ubuntu-20.04
- timeout-minutes: 120
- needs: [
- 'changed_files_job',
- 'integration-tests'
- ]
- if: always()
- steps:
- - name: check condition
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- run: |
- if [[ ! ( ( \
- "${{needs.changed_files_job.outputs.cpp_only}}" == "false" \
- && "${{ needs.integration-tests.result }}" == "success" \
- ) || ( \
- "${{needs.changed_files_job.outputs.cpp_only}}" == "true" \
- ) ) ]]; then
- echo "Required jobs haven't been completed successfully."
- exit 1
- fi
-
- - name: checkout
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- uses: actions/checkout@v2
-
- - name: Tune Runner VM
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- uses: ./.github/actions/tune-runner-vm
-
- - name: Cache local Maven repository
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- uses: actions/cache@v2
- with:
- path: |
- ~/.m2/repository/*/*/*
- !~/.m2/repository/org/apache/pulsar
- key: ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-m2-dependencies-core-modules-
-
- - name: Set up JDK 17
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- uses: actions/setup-java@v2
- with:
- distribution: 'temurin'
- java-version: 17
-
- - name: Clean Disk
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- uses: ./.github/actions/clean-disk
-
- - name: Install gh-actions-artifact-client.js
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
-
- - name: Restore maven build results from Github artifact cache
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- run: |
- cd $HOME
- $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh restore_tar_from_github_actions_artifacts pulsar-maven-repository-binaries
- cd $GITHUB_WORKSPACE
- $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh restore_tar_from_github_actions_artifacts pulsar-server-distribution
-
- - name: copy python tests
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- run: |
- mvn -B -Pskip-all -ntp -pl pulsar-functions/instance package
-
- - name: build cpp artifacts
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- run: |
- echo "Build C++ client library"
- pulsar-client-cpp/docker-build.sh
-
- - name: run c++ tests
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
- run: pulsar-client-cpp/docker-tests.sh
-
- - name: Upload test-logs
- if: ${{ failure() && needs.changed_files_job.outputs.docs_only != 'true' }}
- uses: actions/upload-artifact@v3
- continue-on-error: true
- with:
- name: cpp-tests-logs
- path: test-logs
-
pulsar-test-latest-version-image:
name: Build Pulsar docker image
runs-on: ubuntu-20.04
@@ -927,7 +838,7 @@ jobs:
runs-on: macos-11
timeout-minutes: 120
needs: ['changed_files_job', 'integration-tests']
- if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
+ if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
steps:
- name: checkout
uses: actions/checkout@v2
@@ -1033,24 +944,19 @@ jobs:
'integration-tests',
'system-tests',
'flaky-system-tests',
- 'macos-build',
- 'cpp-tests'
+ 'macos-build'
]
steps:
- name: Check that all required jobs were completed successfully
if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
run: |
if [[ ! ( ( \
- "${{needs.changed_files_job.outputs.cpp_only}}" == "false" \
- && "${{ needs.unit-tests.result }}" == "success" \
+ "${{ needs.unit-tests.result }}" == "success" \
&& "${{ needs.integration-tests.result }}" == "success" \
&& "${{ needs.system-tests.result }}" == "success" \
&& "${{ needs.macos-build.result }}" == "success" \
- && "${{ needs.cpp-tests.result }}" == "success" \
) || ( \
- "${{needs.changed_files_job.outputs.cpp_only}}" == "true" \
- && "${{ needs.system-tests.result }}" == "success" \
- && "${{ needs.cpp-tests.result }}" == "success" \
+ "${{ needs.system-tests.result }}" == "success" \
) ) ]]; then
echo "Required jobs haven't been completed successfully."
exit 1
diff --git a/README.md b/README.md
index 37e73f95ac194..f858e1065723e 100644
--- a/README.md
+++ b/README.md
@@ -123,7 +123,7 @@ components in the Pulsar ecosystem, including connectors, adapters, and other la
## Build Pulsar
-Requirements:
+### Requirements
- JDK
@@ -139,6 +139,7 @@ Requirements:
> Note: this project includes a [Maven Wrapper](https://maven.apache.org/wrapper/) that can be used instead of a system installed Maven.
> Use it by replacing `mvn` by `./mvnw` on Linux and `mvnw.cmd` on Windows in the commands below.
+### Build
Compile and install:
```bash
@@ -151,7 +152,7 @@ Compile and install individual module
$ mvn -pl module-name (e.g: pulsar-broker) install -DskipTests
```
-## Minimal build (This skips most of external connectors and tiered storage handlers)
+### Minimal build (This skips most of external connectors and tiered storage handlers)
```
mvn install -Pcore-modules,-main -DskipTests
diff --git a/bin/pulsar b/bin/pulsar
index 30fe596f60bc9..28738d84d5d86 100755
--- a/bin/pulsar
+++ b/bin/pulsar
@@ -348,9 +348,13 @@ ZK_OPTS=" -Dzookeeper.4lw.commands.whitelist=* -Dzookeeper.snapshot.trust.empty=
LOG4J2_SHUTDOWN_HOOK_DISABLED="-Dlog4j.shutdownHookEnabled=false"
-# Adding pulsar metadata as a recognized provider
-BK_METADATA_OPTIONS="-Dbookkeeper.metadata.bookie.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataBookieDriver -Dbookkeeper.metadata.client.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataClientDriver"
-OPTS="$OPTS $BK_METADATA_OPTIONS"
+# By default, Pulsar Metadata driver will be used for Bookkeeper client and server metadata operations
+# This can be disabled by setting BK_METADATA_OPTIONS=none
+if [[ "$BK_METADATA_OPTIONS" != "none" ]]; then
+ # Adding pulsar metadata as a recognized provider
+ BK_METADATA_OPTIONS="${BK_METADATA_OPTIONS:-"-Dbookkeeper.metadata.bookie.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataBookieDriver -Dbookkeeper.metadata.client.drivers=org.apache.pulsar.metadata.bookkeeper.PulsarMetadataClientDriver"}"
+ OPTS="$OPTS $BK_METADATA_OPTIONS"
+fi
#Change to PULSAR_HOME to support relative paths
cd "$PULSAR_HOME"
diff --git a/build/run_integration_group.sh b/build/run_integration_group.sh
index 71a816a9b2b73..ab69544308ff3 100755
--- a/build/run_integration_group.sh
+++ b/build/run_integration_group.sh
@@ -120,8 +120,8 @@ test_group_messaging() {
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-messaging.xml -DintegrationTests
# run integration proxy tests
mvn_run_integration_test --skip-build-deps "$@" -DintegrationTestSuiteFile=pulsar-proxy.xml -DintegrationTests
- # run integration proxy with WebSocket tests
- mvn_run_integration_test --skip-build-deps "$@" -DintegrationTestSuiteFile=pulsar-proxy-websocket.xml -DintegrationTests
+ # run integration WebSocket tests
+ mvn_run_integration_test --skip-build-deps "$@" -DintegrationTestSuiteFile=pulsar-websocket.xml -DintegrationTests
}
test_group_plugin() {
diff --git a/buildtools/src/main/java/org/apache/pulsar/tests/MockitoCleanupListener.java b/buildtools/src/main/java/org/apache/pulsar/tests/MockitoCleanupListener.java
index 73fff1bb7e269..ff590c05bbcf7 100644
--- a/buildtools/src/main/java/org/apache/pulsar/tests/MockitoCleanupListener.java
+++ b/buildtools/src/main/java/org/apache/pulsar/tests/MockitoCleanupListener.java
@@ -38,11 +38,15 @@ public class MockitoCleanupListener extends BetweenTestClassesListenerAdapter {
@Override
protected void onBetweenTestClasses(Class> endedTestClass, Class> startedTestClass) {
if (MOCKITO_CLEANUP_ENABLED) {
- if (MockitoThreadLocalStateCleaner.INSTANCE.isEnabled()) {
- LOG.info("Cleaning up Mockito's ThreadSafeMockingProgress.MOCKING_PROGRESS_PROVIDER thread local state.");
- MockitoThreadLocalStateCleaner.INSTANCE.cleanup();
+ try {
+ if (MockitoThreadLocalStateCleaner.INSTANCE.isEnabled()) {
+ LOG.info(
+ "Cleaning up Mockito's ThreadSafeMockingProgress.MOCKING_PROGRESS_PROVIDER thread local state.");
+ MockitoThreadLocalStateCleaner.INSTANCE.cleanup();
+ }
+ } finally {
+ cleanupMockitoInline();
}
- cleanupMockitoInline();
}
}
@@ -54,5 +58,4 @@ protected void onBetweenTestClasses(Class> endedTestClass, Class> startedTes
private void cleanupMockitoInline() {
Mockito.framework().clearInlineMocks();
}
-
}
diff --git a/buildtools/src/main/java/org/apache/pulsar/tests/MockitoThreadLocalStateCleaner.java b/buildtools/src/main/java/org/apache/pulsar/tests/MockitoThreadLocalStateCleaner.java
index 3c383fb1d92fd..4fe4ea7e0e2d3 100644
--- a/buildtools/src/main/java/org/apache/pulsar/tests/MockitoThreadLocalStateCleaner.java
+++ b/buildtools/src/main/java/org/apache/pulsar/tests/MockitoThreadLocalStateCleaner.java
@@ -23,6 +23,8 @@
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.commons.lang3.reflect.MethodUtils;
+import org.mockito.internal.stubbing.InvocationContainerImpl;
+import org.mockito.internal.util.MockUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -72,16 +74,33 @@ public void cleanup() {
LOG.warn("Invalid usage of Mockito detected on thread {}."
+ " There is ongoing stubbing on mock of class={} instance={}",
thread, mock.getClass().getName(), mock);
+ try {
+ clearInvocations(thread, mock);
+ } catch (Exception e) {
+ LOG.warn("Clearing invocations failed", e);
+ }
}
}
} catch (NoSuchMethodException | IllegalAccessException e) {
LOG.debug("Cannot call validateState on existing Mockito ProgressProvider");
} catch (InvocationTargetException e) {
LOG.warn("Invalid usage of Mockito detected on thread {}", thread, e.getCause());
+ } catch (Exception e) {
+ LOG.warn("Removing {} instance from thread {} failed", mockingProgress.getClass().getName(), thread, e);
}
});
}
+ private static void clearInvocations(Thread thread, Object mock) {
+ InvocationContainerImpl invocationContainer = MockUtil.getInvocationContainer(mock);
+ if (invocationContainer.hasInvocationForPotentialStubbing()) {
+ LOG.warn("Mock contains registered invocations that should be cleared. thread {} class={} "
+ + "instance={}",
+ thread, mock.getClass().getName(), mock);
+ invocationContainer.clearInvocations();
+ }
+ }
+
public boolean isEnabled() {
return MOCKING_PROGRESS_PROVIDER != null;
}
diff --git a/conf/broker.conf b/conf/broker.conf
index 30e79ebc9f090..e6b3aef8811b5 100644
--- a/conf/broker.conf
+++ b/conf/broker.conf
@@ -453,6 +453,12 @@ entryFilterNames=
# The directory for all the entry filter implementations
entryFiltersDirectory=
+# Whether the broker should count filtered entries in dispatch rate limit calculations. When disabled,
+# only messages sent to a consumer count towards a dispatch rate limit at the broker, topic, and
+# subscription level. When enabled, messages filtered out due to entry filter logic are counted towards
+# each relevant rate limit.
+dispatchThrottlingForFilteredEntriesEnabled=false
+
# Whether allow topic level entry filters policies overrides broker configuration.
allowOverrideEntryFilters=false
@@ -570,6 +576,12 @@ delayedDeliveryMaxNumBuckets=50
# Enable share the delayed message index across subscriptions
delayedDeliverySharedIndexEnabled=false
+# Size of the lookahead window to use when detecting if all the messages in the topic
+# have a fixed delay.
+# Default is 50,000. Setting the lookahead window to 0 will disable the logic to handle
+# fixed delays in messages in a different way.
+delayedDeliveryFixedDelayDetectionLookahead=50000
+
# Whether to enable acknowledge of batch local index.
acknowledgmentAtBatchIndexLevelEnabled=false
diff --git a/conf/client.conf b/conf/client.conf
index ea1d339a09c5b..8a485e5676c7b 100644
--- a/conf/client.conf
+++ b/conf/client.conf
@@ -88,7 +88,11 @@ tlsKeyStorePassword=
# When TLS authentication with KeyStore is used, available options can be SunJSSE, Conscrypt and so on.
webserviceTlsProvider=
+#Proxy-server URL to which to connect
+proxyServiceUrl=
+#Proxy protocol to select type of routing at proxy
+proxyProtocol=
# Pulsar Admin Custom Commands
#customCommandFactoriesDirectory=commandFactories
diff --git a/docker/pulsar/Dockerfile b/docker/pulsar/Dockerfile
index 3746fe1c26c2e..7ec8788b89c60 100644
--- a/docker/pulsar/Dockerfile
+++ b/docker/pulsar/Dockerfile
@@ -89,13 +89,14 @@ RUN pip3 install pyyaml==5.4.1
# 4. /pulsar - hadoop writes to this directory
RUN mkdir /pulsar && chmod g+w /pulsar
-ADD target/python-client/ /pulsar/pulsar-client
-
ENV PULSAR_ROOT_LOGGER=INFO,CONSOLE
COPY --from=pulsar /pulsar /pulsar
WORKDIR /pulsar
+ARG PULSAR_CLIENT_PYTHON_VERSION
+ENV PULSAR_CLIENT_PYTHON_VERSION ${PULSAR_CLIENT_PYTHON_VERSION}
+
# This script is intentionally run as the root user to make the dependencies available for all UIDs.
RUN /pulsar/bin/install-pulsar-client.sh
diff --git a/docker/pulsar/pom.xml b/docker/pulsar/pom.xml
index a458cea39763a..f7d91b2120841 100644
--- a/docker/pulsar/pom.xml
+++ b/docker/pulsar/pom.xml
@@ -30,12 +30,6 @@
Apache Pulsar :: Docker Images :: Pulsar Latest Version
pom
-
- x86_64
- false
- false
-
-
${project.groupId}
@@ -58,55 +52,11 @@
docker
target/pulsar-server-distribution-${project.version}-bin.tar.gz
+ ${pulsar.client.python.version}
${env.UBUNTU_MIRROR}
-
-
- org.codehaus.mojo
- exec-maven-plugin
- ${exec-maven-plugin.version}
-
-
- build-pulsar-clients-python-35
- compile
-
- exec
-
-
- ${skipBuildPythonClient}
- ${project.basedir}/target
- ${project.basedir}/../../pulsar-client-cpp/docker/build-wheels.sh
-
-
- 3.8 cp38-cp38 manylinux2014 ${pythonClientBuildArch}
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
-
-
- copy-pulsar-clients-python
- compile
-
- run
-
-
- ${skipCopyPythonClients}
-
- copy python wheel file
-
-
-
-
-
-
-
io.fabric8
docker-maven-plugin
diff --git a/docker/pulsar/scripts/install-pulsar-client.sh b/docker/pulsar/scripts/install-pulsar-client.sh
index 355f5f6524a3a..0951b2aec1b60 100755
--- a/docker/pulsar/scripts/install-pulsar-client.sh
+++ b/docker/pulsar/scripts/install-pulsar-client.sh
@@ -27,6 +27,4 @@ if [ "${ARCH}" == "arm64" ]; then
apt -y install build-essential python3-dev
fi
-PYTHON_MAJOR_MINOR=$(python3 -V | sed -E 's/.* ([[:digit:]]+)\.([[:digit:]]+).*/\1\2/')
-WHEEL_FILE=$(ls /pulsar/pulsar-client | grep "cp${PYTHON_MAJOR_MINOR}")
-pip3 install /pulsar/pulsar-client/${WHEEL_FILE}[all]
+pip3 install pulsar-client[all]==${PULSAR_CLIENT_PYTHON_VERSION}
diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedCursor.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedCursor.java
index 17dbac09a2292..cf022d3552e64 100644
--- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedCursor.java
+++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedCursor.java
@@ -18,13 +18,13 @@
*/
package org.apache.bookkeeper.mledger;
-import com.google.common.base.Predicate;
import com.google.common.collect.Range;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
+import java.util.function.Predicate;
import org.apache.bookkeeper.common.annotation.InterfaceAudience;
import org.apache.bookkeeper.common.annotation.InterfaceStability;
import org.apache.bookkeeper.mledger.AsyncCallbacks.ClearBacklogCallback;
diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java
index a71cf38afb855..c5de804b1379d 100644
--- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java
+++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java
@@ -20,6 +20,7 @@
import io.netty.buffer.ByteBuf;
import java.util.Map;
+import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Predicate;
import org.apache.bookkeeper.common.annotation.InterfaceAudience;
@@ -649,6 +650,12 @@ void asyncSetProperties(Map properties, AsyncCallbacks.UpdatePro
*/
CompletableFuture getLedgerInfo(long ledgerId);
+ /**
+ * Get basic ledger summary.
+ * will get {@link Optional#empty()} if corresponding ledger not exists.
+ */
+ Optional getOptionalLedgerInfo(long ledgerId);
+
/**
* Truncate ledgers
* The truncate operation will move all cursors to the end of the topic and delete all inactive ledgers.
diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java
index 92c9c91198134..0efd1ca2a823c 100644
--- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java
+++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java
@@ -32,6 +32,7 @@
import org.apache.bookkeeper.common.annotation.InterfaceStability;
import org.apache.bookkeeper.mledger.impl.NullLedgerOffloader;
import org.apache.bookkeeper.mledger.intercept.ManagedLedgerInterceptor;
+import org.apache.commons.collections4.MapUtils;
import org.apache.pulsar.common.util.collections.ConcurrentOpenLongPairRangeSet;
/**
@@ -742,4 +743,10 @@ public int getMaxBacklogBetweenCursorsForCaching() {
public void setMaxBacklogBetweenCursorsForCaching(int maxBacklogBetweenCursorsForCaching) {
this.maxBacklogBetweenCursorsForCaching = maxBacklogBetweenCursorsForCaching;
}
+
+ public String getShadowSource() {
+ return MapUtils.getString(properties, PROPERTY_SOURCE_TOPIC_KEY);
+ }
+
+ public static final String PROPERTY_SOURCE_TOPIC_KEY = "PULSAR.SHADOW_SOURCE";
}
diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerException.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerException.java
index 0dc820ec46d72..fa6dc59d14753 100644
--- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerException.java
+++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerException.java
@@ -147,6 +147,12 @@ public NonRecoverableLedgerException(String msg) {
}
}
+ public static class LedgerNotExistException extends NonRecoverableLedgerException {
+ public LedgerNotExistException(String msg) {
+ super(msg);
+ }
+ }
+
public static class InvalidReplayPositionException extends ManagedLedgerException {
public InvalidReplayPositionException(String msg) {
super(msg);
diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerFactory.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerFactory.java
index e42c2581ba101..667d641ac9ae0 100644
--- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerFactory.java
+++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerFactory.java
@@ -18,6 +18,7 @@
*/
package org.apache.bookkeeper.mledger;
+import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
import org.apache.bookkeeper.common.annotation.InterfaceAudience;
@@ -197,4 +198,8 @@ void asyncOpenReadOnlyCursor(String managedLedgerName, Position startPosition, M
* */
long getCacheEvictionTimeThreshold();
+ /**
+ * @return properties of this managedLedger.
+ */
+ CompletableFuture