You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2020/11/26 09:35:50 UTC

[pulsar] branch branch-2.7 updated (35ca55c -> b0c4595)

This is an automated email from the ASF dual-hosted git repository.

penghui pushed a change to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git.


    from 35ca55c  Release 2.7.0
     new 62fde99  Fix PrometheusMetricsTest on source tarball (#8702)
     new caede24  [Tiered Storage] Fix Jclouds Azure credential error (#8693)
     new b0c4595  include failureaccess in shaded JAR (#8697)

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 jclouds-shaded/pom.xml                             |  1 +
 .../pulsar/broker/stats/PrometheusMetricsTest.java |  2 +-
 pulsar-client-shaded/pom.xml                       |  1 +
 .../org/apache/pulsar/PulsarVersion.java           |  5 ++++
 .../impl/BlobStoreManagedLedgerOffloader.java      |  1 +
 .../jcloud/provider/JCloudBlobStoreProvider.java   | 27 +++++++++++++++++-----
 6 files changed, 30 insertions(+), 7 deletions(-)


[pulsar] 03/03: include failureaccess in shaded JAR (#8697)

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit b0c45952d063b754e387b3f9cbff279b9885b107
Author: Kimura, T <35...@users.noreply.github.com>
AuthorDate: Thu Nov 26 16:24:22 2020 +0900

    include failureaccess in shaded JAR (#8697)
    
    * include failureaccess in shaded
    
    * fix other packages too
    
    Co-authored-by: Takesi Kimura <ta...@yahoo-corp.jp>
    (cherry picked from commit 538b70ed4fd8953decf4d96038624fd754696551)
---
 jclouds-shaded/pom.xml       | 1 +
 pulsar-client-shaded/pom.xml | 1 +
 2 files changed, 2 insertions(+)

diff --git a/jclouds-shaded/pom.xml b/jclouds-shaded/pom.xml
index 62b759f..90239c2 100644
--- a/jclouds-shaded/pom.xml
+++ b/jclouds-shaded/pom.xml
@@ -71,6 +71,7 @@
               <artifactSet>
                 <includes>
                   <include>com.google.guava:guava</include>
+                  <include>com.google.guava:failureaccess</include>
                   <include>org.apache.jclouds:*</include>
                   <include>org.apache.jclouds.api:*</include>
                   <include>org.apache.jclouds.common:*</include>
diff --git a/pulsar-client-shaded/pom.xml b/pulsar-client-shaded/pom.xml
index 24405b1..3b2716e 100644
--- a/pulsar-client-shaded/pom.xml
+++ b/pulsar-client-shaded/pom.xml
@@ -115,6 +115,7 @@
                   <include>com.typesafe.netty:netty-reactive-streams</include>
                   <include>org.javassist:javassist</include>
                   <include>com.google.guava:guava</include>
+                  <include>com.google.guava:failureaccess</include>
                   <include>com.google.code.gson:gson</include>
                   <include>com.fasterxml.jackson.core</include>
                   <include>com.fasterxml.jackson.module</include>


[pulsar] 01/03: Fix PrometheusMetricsTest on source tarball (#8702)

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 62fde99cb6338f4cd784c8681a0a8a6c46252298
Author: Enrico Olivelli <eo...@gmail.com>
AuthorDate: Thu Nov 26 06:11:37 2020 +0100

    Fix PrometheusMetricsTest on source tarball (#8702)
    
    When you run the tests from the sources in the source release tarball there is no git reference and we are publishing on the metrics a placeholder.
    
    `pulsar_version_info{cluster="test",version="2.7.0",commit="${git.commit.id}"} `
    
    I noticed the problem because PrometheusMetricsTest.java is failing on 2.7.0 sources
    
    The fix is to detect this fact an publish only an empty string.
    The change affects PulsarVersion, that in turn is used in Prometheus metrics endpoint
    
    (cherry picked from commit 55e40feeb04eeee075784736ffc9e826e132c455)
---
 .../java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java   | 2 +-
 .../src/main/java-templates/org/apache/pulsar/PulsarVersion.java     | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
index a47a680..96e396f 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
@@ -565,7 +565,7 @@ public class PrometheusMetricsTest extends BrokerTestBase {
             }
 
             Matcher matcher = pattern.matcher(line);
-            assertTrue(matcher.matches());
+            assertTrue(matcher.matches(), "line " + line + " does not match pattern " + pattern);
             String name = matcher.group(1);
 
             Metric m = new Metric();
diff --git a/pulsar-common/src/main/java-templates/org/apache/pulsar/PulsarVersion.java b/pulsar-common/src/main/java-templates/org/apache/pulsar/PulsarVersion.java
index 6bc9c17..07f97cd 100644
--- a/pulsar-common/src/main/java-templates/org/apache/pulsar/PulsarVersion.java
+++ b/pulsar-common/src/main/java-templates/org/apache/pulsar/PulsarVersion.java
@@ -70,6 +70,11 @@ public class PulsarVersion {
     public static String getGitSha() {
         String commit = "${git.commit.id}";
         String dirtyString = "${git.dirty}";
+        if (commit.contains("git.commit.id")){
+            // this case may happen if you are building the sources
+            // out of the git repository
+            commit = "";
+        }
         if (dirtyString == null || Boolean.valueOf(dirtyString)) {
             return commit + "(dirty)";
         } else {


[pulsar] 02/03: [Tiered Storage] Fix Jclouds Azure credential error (#8693)

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit caede241027a82bb04759f9e331560ca0293d8b1
Author: ran <ga...@126.com>
AuthorDate: Thu Nov 26 13:13:49 2020 +0800

    [Tiered Storage] Fix Jclouds Azure credential error (#8693)
    
    ### Motivation
    
    Currently, the tiered storage Azure credential is broken.
    
    ### Modifications
    
    Change the Azure supplier credential.
    
    (cherry picked from commit bf9f61969c3fd7d82b85502266a12f85a793c63a)
---
 .../impl/BlobStoreManagedLedgerOffloader.java      |  1 +
 .../jcloud/provider/JCloudBlobStoreProvider.java   | 27 +++++++++++++++++-----
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java b/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java
index 4f51713..39e6d41 100644
--- a/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java
+++ b/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java
@@ -103,6 +103,7 @@ public class BlobStoreManagedLedgerOffloader implements LedgerOffloader {
                 config.getBucket(), config.getRegion());
 
         blobStores.putIfAbsent(config.getBlobStoreLocation(), config.getBlobStore());
+        log.info("The ledger offloader was created.");
     }
 
     @Override
diff --git a/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java b/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java
index df4b0d3..9d0871e 100644
--- a/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java
+++ b/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java
@@ -131,7 +131,21 @@ public enum JCloudBlobStoreProvider implements Serializable, ConfigValidation, B
 
         @Override
         public BlobStore getBlobStore(TieredStorageConfiguration config) {
-            return BLOB_STORE_BUILDER.getBlobStore(config);
+            ContextBuilder contextBuilder = ContextBuilder.newBuilder(config.getProviderMetadata());
+            contextBuilder.overrides(config.getOverrides());
+
+            if (config.getProviderCredentials() != null) {
+                Credentials credentials = config.getProviderCredentials().get();
+                return contextBuilder
+                        .credentials(credentials.identity, credentials.credential)
+                        .buildView(BlobStoreContext.class)
+                        .getBlobStore();
+            } else {
+                log.warn("The credentials is null. driver: {}, bucket: {}", config.getDriver(), config.getBucket());
+                return contextBuilder
+                        .buildView(BlobStoreContext.class)
+                        .getBlobStore();
+            }
         }
 
         @Override
@@ -254,11 +268,12 @@ public enum JCloudBlobStoreProvider implements Serializable, ConfigValidation, B
                         .credentialsSupplier(config.getCredentials())
                         .buildView(BlobStoreContext.class)
                         .getBlobStore();
-            } else {
-                return contextBuilder
-                        .buildView(BlobStoreContext.class)
-                        .getBlobStore();
-            }
+        } else {
+            log.warn("The credentials is null. driver: {}, bucket: {}", config.getDriver(), config.getBucket());
+            return contextBuilder
+                    .buildView(BlobStoreContext.class)
+                    .getBlobStore();
+        }
 
     };