Skip to content

Commit

Permalink
remove log
Browse files Browse the repository at this point in the history
  • Loading branch information
lhpqaq committed Dec 16, 2024
1 parent 48b33e5 commit c33fb8a
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -134,11 +131,8 @@ private void genFullCaches() {
serviceConfigMap = new HashMap<>();
for (ServiceConfigPO serviceConfigPO : serviceConfigPOList) {
List<Map<String, Object>> properties = JsonUtils.readFromString(serviceConfigPO.getPropertiesJson());
log.info(properties.toString());
Map<String, Object> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,4 @@ public interface ServiceConverter {
ServiceVO fromPO2VO(ServicePO servicePO);

List<ServiceVO> fromPO2VO(List<ServicePO> 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());
// }
// }
// }
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ public List<StackVO> list() {
List<ServiceDTO> serviceDTOList = entry.getValue();
for (ServiceDTO serviceDTO : serviceDTOList) {
serviceDTO.setConfigs(StackUtils.SERVICE_CONFIG_MAP.get(serviceDTO.getName()));
// if (serviceDTO.getName().equals("grafana")) {
// List<ServiceConfigDTO> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand All @@ -49,9 +46,6 @@ public static List<PropertyDTO> loadConfig(String fileName) {
List<PropertyDTO> propertyDTOList = new ArrayList<>();
for (PropertyModel propertyModel : propertyModels) {
PropertyDTO propertyDTO = getPropertyDTO(propertyModel);
if (propertyDTO.getValues() != null) {
log.info(propertyDTO.toString());
}
propertyDTOList.add(propertyDTO);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ public String dataDir() {
return MessageFormat.format("{0}/data", serviceHome());
}

@GlobalParams
public Map<String, Object> grafanaConfig() {
Map<String, Object> grafanaConfig = LocalSettings.configurations(getServiceName(), "grafana");
log.info(grafanaConfig.toString());
return grafanaConfig;
}

@Override
public String getServiceName() {
return "grafana";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,22 @@ public String getServiceName() {
public Map<String, Object> scrapeConfigs() {
List<Map<String, Object>> jobs = new ArrayList<>();
Map<String, Object> configuration = LocalSettings.configurations(getServiceName(), "prometheus");

prometheusContent = (String) configuration.get("content");
prometheusScrapeInterval = (String) configuration.get("scrape_interval");
log.info(configuration.toString());

@SuppressWarnings("unchecked")
Map<String, Object> scrapeJobs = (Map<String, Object>) configuration.get("scrape_jobs");
log.info(scrapeJobs.toString());
for (Map.Entry<String, Object> entry : scrapeJobs.entrySet()) {
@SuppressWarnings("unchecked")
Map<String, Object> scrapeJob = (Map<String, Object>) entry.getValue();

Map<String, Object> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit c33fb8a

Please sign in to comment.