You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by gu...@apache.org on 2020/06/30 10:34:57 UTC

[pulsar-manager] branch master updated: Solve compile error (#313)

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

guangning pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-manager.git


The following commit(s) were added to refs/heads/master by this push:
     new 6596c3f  Solve compile error (#313)
6596c3f is described below

commit 6596c3f9e03689fccad20b01c5cd03d86e2e6981
Author: shustsud <51...@users.noreply.github.com>
AuthorDate: Tue Jun 30 19:34:47 2020 +0900

    Solve compile error (#313)
    
    * Fixed BrokerStatsServiceImpl class.
---
 .../pulsar/manager/service/impl/BrokerStatsServiceImpl.java      | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/pulsar/manager/service/impl/BrokerStatsServiceImpl.java b/src/main/java/org/apache/pulsar/manager/service/impl/BrokerStatsServiceImpl.java
index 99fa696..4e8114b 100644
--- a/src/main/java/org/apache/pulsar/manager/service/impl/BrokerStatsServiceImpl.java
+++ b/src/main/java/org/apache/pulsar/manager/service/impl/BrokerStatsServiceImpl.java
@@ -26,6 +26,7 @@ import org.apache.pulsar.manager.service.BrokerStatsService;
 import org.apache.pulsar.manager.service.BrokersService;
 import org.apache.pulsar.manager.service.ClustersService;
 import org.apache.pulsar.manager.service.PulsarAdminService;
+import org.apache.pulsar.manager.utils.HttpUtil;
 import org.apache.pulsar.manager.entity.ConsumerStatsEntity;
 import org.apache.pulsar.manager.entity.ConsumersStatsRepository;
 import org.apache.pulsar.manager.entity.EnvironmentEntity;
@@ -43,13 +44,13 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.http.ResponseEntity;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
@@ -66,6 +67,9 @@ public class BrokerStatsServiceImpl implements BrokerStatsService {
     @Value("${backend.directRequestHost}")
     private String directRequestHost;
 
+    @Value("${backend.jwt.token}")
+    private String pulsarJwtToken;
+
     @Value("${clear.stats.interval}")
     private Long clearStatsInterval;
 
@@ -79,6 +83,8 @@ public class BrokerStatsServiceImpl implements BrokerStatsService {
     private final ConsumersStatsRepository consumersStatsRepository;
     private final PulsarAdminService pulsarAdminService;
 
+    private static final Map<String, String> header = new HashMap<>();
+
     @Autowired
     public BrokerStatsServiceImpl(
             EnvironmentsRepository environmentsRepository,
@@ -136,6 +142,7 @@ public class BrokerStatsServiceImpl implements BrokerStatsService {
                         if (!url.contains("http://")) {
                             url = "http://" + url;
                         }
+                        // TODO Use Pulsar Admin instead of HttpUtil.
                         String httpTestResult = HttpUtil.doGet( url + "/admin/v2/brokers/health", header);
                         if (httpTestResult == null) {
                             log.error("This service {} is down, please check", url);