From c33fb8acfa5fc20c326cc18dc4ecb3319ac975da Mon Sep 17 00:00:00 2001 From: lhpqaq <657407891@qq.com> Date: Mon, 16 Dec 2024 15:09:49 +0800 Subject: [PATCH] remove log --- .../server/command/task/CacheFileUpdateTask.java | 6 ------ .../server/model/converter/ServiceConverter.java | 12 ------------ .../server/service/impl/StackServiceImpl.java | 7 ------- .../manager/server/utils/StackConfigUtils.java | 6 ------ .../stack/infra/v1_0_0/grafana/GrafanaParams.java | 7 ------- .../stack/infra/v1_0_0/grafana/GrafanaSetup.java | 2 +- .../infra/v1_0_0/prometheus/PrometheusParams.java | 7 +++---- .../infra/v1_0_0/prometheus/PrometheusSetup.java | 3 +-- 8 files changed, 5 insertions(+), 45 deletions(-) diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/command/task/CacheFileUpdateTask.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/command/task/CacheFileUpdateTask.java index 23acd451..92f28eb7 100644 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/command/task/CacheFileUpdateTask.java +++ b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/command/task/CacheFileUpdateTask.java @@ -43,8 +43,6 @@ import org.apache.bigtop.manager.server.model.dto.StackDTO; import org.apache.bigtop.manager.server.utils.StackUtils; -import lombok.extern.slf4j.Slf4j; - import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -55,7 +53,6 @@ import static org.apache.bigtop.manager.common.constants.Constants.ALL_HOST_KEY; -@Slf4j public class CacheFileUpdateTask extends AbstractTask { private ClusterDao clusterDao; @@ -134,11 +131,8 @@ private void genFullCaches() { serviceConfigMap = new HashMap<>(); for (ServiceConfigPO serviceConfigPO : serviceConfigPOList) { List> properties = JsonUtils.readFromString(serviceConfigPO.getPropertiesJson()); - log.info(properties.toString()); Map kvMap = parseProperties(properties); - log.info(kvMap.toString()); String kvString = JsonUtils.writeAsString(kvMap); - log.info(kvString); if (serviceConfigMap.containsKey(serviceConfigPO.getServiceName())) { serviceConfigMap.get(serviceConfigPO.getServiceName()).put(serviceConfigPO.getName(), kvString); diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/model/converter/ServiceConverter.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/model/converter/ServiceConverter.java index aa694898..f63cfb94 100644 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/model/converter/ServiceConverter.java +++ b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/model/converter/ServiceConverter.java @@ -47,16 +47,4 @@ public interface ServiceConverter { ServiceVO fromPO2VO(ServicePO servicePO); List fromPO2VO(List servicePOList); - - // @AfterMapping - // default void afterMapping(@MappingTarget ServiceVO serviceVO, ServiceDTO serviceDTO) { - // for (int i = 0; i < serviceDTO.getConfigs().size(); i++) { - // for (int j = 0; j < serviceDTO.getConfigs().get(i).getProperties().size(); j++) { - // if (serviceDTO.getConfigs().get(i).getProperties().get(j).getValues() != null) { - // System.out.println(serviceDTO.getConfigs().get(i).getProperties().get(j).getValues()); - // System.out.println(serviceVO.getConfigs().get(i).getProperties().get(j).getValues()); - // } - // } - // } - // } } diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/StackServiceImpl.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/StackServiceImpl.java index 983f00a4..3d777a99 100644 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/StackServiceImpl.java +++ b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/StackServiceImpl.java @@ -47,13 +47,6 @@ public List list() { List serviceDTOList = entry.getValue(); for (ServiceDTO serviceDTO : serviceDTOList) { serviceDTO.setConfigs(StackUtils.SERVICE_CONFIG_MAP.get(serviceDTO.getName())); - // if (serviceDTO.getName().equals("grafana")) { - // List serviceConfigDTOList = - // StackUtils.SERVICE_CONFIG_MAP.get(serviceDTO.getName()); - // - // log.info(String.valueOf(PropertyConverter.INSTANCE.fromDTO2VO(serviceConfigDTOList.get(0).getProperties()))); - // log.info(ServiceConverter.INSTANCE.fromDTO2VO(serviceDTO).toString()); - // } } StackVO stackVO = StackConverter.INSTANCE.fromDTO2VO(stackDTO); diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/utils/StackConfigUtils.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/utils/StackConfigUtils.java index 73f9dee8..cee5fa29 100644 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/utils/StackConfigUtils.java +++ b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/utils/StackConfigUtils.java @@ -26,14 +26,11 @@ import org.apache.commons.lang3.StringUtils; -import lombok.extern.slf4j.Slf4j; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -@Slf4j public class StackConfigUtils { /** @@ -49,9 +46,6 @@ public static List loadConfig(String fileName) { List propertyDTOList = new ArrayList<>(); for (PropertyModel propertyModel : propertyModels) { PropertyDTO propertyDTO = getPropertyDTO(propertyModel); - if (propertyDTO.getValues() != null) { - log.info(propertyDTO.toString()); - } propertyDTOList.add(propertyDTO); } diff --git a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaParams.java b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaParams.java index 68cc5f52..f3f4cfe4 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaParams.java +++ b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaParams.java @@ -46,13 +46,6 @@ public String dataDir() { return MessageFormat.format("{0}/data", serviceHome()); } - @GlobalParams - public Map grafanaConfig() { - Map grafanaConfig = LocalSettings.configurations(getServiceName(), "grafana"); - log.info(grafanaConfig.toString()); - return grafanaConfig; - } - @Override public String getServiceName() { return "grafana"; diff --git a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaSetup.java b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaSetup.java index f1cccda2..7a61555c 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaSetup.java +++ b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaSetup.java @@ -35,7 +35,7 @@ public static ShellResult config(Params params) { GrafanaParams grafanaParams = (GrafanaParams) params; String user = grafanaParams.user(); String group = grafanaParams.group(); - log.info(String.valueOf(grafanaParams)); + LinuxFileUtils.createDirectories(grafanaParams.dataDir(), user, group, Constants.PERMISSION_755, true); return ShellResult.success("Grafana Configure success!"); diff --git a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusParams.java b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusParams.java index 9ee3f5e4..7a122e05 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusParams.java +++ b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusParams.java @@ -68,23 +68,22 @@ public String getServiceName() { public Map scrapeConfigs() { List> jobs = new ArrayList<>(); Map configuration = LocalSettings.configurations(getServiceName(), "prometheus"); + prometheusContent = (String) configuration.get("content"); prometheusScrapeInterval = (String) configuration.get("scrape_interval"); - log.info(configuration.toString()); + @SuppressWarnings("unchecked") Map scrapeJobs = (Map) configuration.get("scrape_jobs"); - log.info(scrapeJobs.toString()); for (Map.Entry entry : scrapeJobs.entrySet()) { @SuppressWarnings("unchecked") Map scrapeJob = (Map) entry.getValue(); + Map job = new HashMap<>(); job.put("name", scrapeJob.get("job_name")); job.put("targets", scrapeJob.get("job_targets")); job.put("scrape_interval", scrapeJob.get("job_scrape_interval")); jobs.add(job); - log.info(job.toString()); } - log.info(jobs.toString()); prometheusScrapeJobs = jobs; return configuration; } diff --git a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusSetup.java b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusSetup.java index 90fb3b26..1a986e79 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusSetup.java +++ b/bigtop-manager-stack/bigtop-manager-stack-infra/src/main/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusSetup.java @@ -39,8 +39,7 @@ public static ShellResult config(Params params) { String group = prometheusParams.group(); LinuxFileUtils.createDirectories(prometheusParams.dataDir(), user, group, Constants.PERMISSION_755, true); - log.info(prometheusParams.getPrometheusContent()); - log.info(prometheusParams.getGlobalParamsMap().toString()); + LinuxFileUtils.toFileByTemplate( prometheusParams.getPrometheusContent(), MessageFormat.format("{0}/prometheus.yml", prometheusParams.confDir()),