From ca38c2e31483c310366e4ea751302c1659be64db Mon Sep 17 00:00:00 2001 From: imbajin Date: Sun, 21 Apr 2024 20:42:29 +0800 Subject: [PATCH] chore: delete license package --- .../hugegraph/pd/boot/HugePDServer.java | 3 +- .../pd/license/LicenseVerifierService.java | 426 ------------------ .../pd/license/LicenseVerifyManager.java | 77 ---- .../hugegraph/pd/metrics/PDMetrics.java | 4 +- .../pd/model/RegistryRestResponse.java | 1 - .../pd/notice/NoticeBroadcaster.java | 1 + .../hugegraph/pd/pulse/PDPulseSubject.java | 1 - .../apache/hugegraph/pd/rest/MemberAPI.java | 6 +- 8 files changed, 8 insertions(+), 511 deletions(-) delete mode 100644 hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/license/LicenseVerifierService.java delete mode 100644 hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/license/LicenseVerifyManager.java diff --git a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/boot/HugePDServer.java b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/boot/HugePDServer.java index e6fff5e1b2..815005259a 100644 --- a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/boot/HugePDServer.java +++ b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/boot/HugePDServer.java @@ -24,7 +24,7 @@ import com.alipay.remoting.util.StringUtils; /** - * PD服务启动类 + * PD 服务启动类 */ @ComponentScan(basePackages = {"org.apache.hugegraph.pd"}) @SpringBootApplication @@ -33,6 +33,7 @@ public class HugePDServer { public static void main(String[] args) { String logPath = System.getProperty("logging.path"); if (StringUtils.isBlank(logPath)) { + // TODO: enhance logging configuration System.setProperty("logging.path", "logs"); System.setProperty("com.alipay.remoting.client.log.level", "error"); } diff --git a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/license/LicenseVerifierService.java b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/license/LicenseVerifierService.java deleted file mode 100644 index 6c88c73211..0000000000 --- a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/license/LicenseVerifierService.java +++ /dev/null @@ -1,426 +0,0 @@ -// TODO: uncomment later - maybe useless (license related) -///* -// * 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. -// */ -// -//package org.apache.hugegraph.pd.license; -// -//import java.io.File; -//import java.io.IOException; -//import java.net.InetAddress; -//import java.net.UnknownHostException; -//import java.nio.charset.Charset; -//import java.text.SimpleDateFormat; -//import java.time.Duration; -//import java.time.Instant; -//import java.util.Date; -//import java.util.HashMap; -//import java.util.List; -//import java.util.concurrent.CountDownLatch; -//import java.util.prefs.Preferences; -// -//import org.apache.commons.lang3.StringUtils; -//import org.apache.hugegraph.license.ExtraParam; -//import org.apache.hugegraph.license.LicenseVerifyParam; -//import org.apache.hugegraph.license.MachineInfo; -//import org.apache.hugegraph.pd.KvService; -//import org.apache.hugegraph.pd.common.PDRuntimeException; -//import org.apache.hugegraph.pd.config.PDConfig; -//import org.apache.hugegraph.pd.grpc.Pdpb; -//import org.apache.hugegraph.pd.grpc.kv.KvServiceGrpc; -//import org.apache.hugegraph.pd.grpc.kv.TTLRequest; -//import org.apache.hugegraph.pd.grpc.kv.TTLResponse; -//import org.apache.hugegraph.pd.raft.RaftEngine; -//import org.springframework.stereotype.Service; -//import org.springframework.util.Base64Utils; -// -//import com.fasterxml.jackson.databind.ObjectMapper; -//import com.google.gson.Gson; -//import com.google.gson.internal.LinkedTreeMap; -// -//import de.schlichtherle.license.CipherParam; -//import de.schlichtherle.license.DefaultCipherParam; -//import de.schlichtherle.license.DefaultKeyStoreParam; -//import de.schlichtherle.license.DefaultLicenseParam; -//import de.schlichtherle.license.KeyStoreParam; -//import de.schlichtherle.license.LicenseContent; -//import de.schlichtherle.license.LicenseParam; -//import io.grpc.CallOptions; -//import io.grpc.ManagedChannel; -//import io.grpc.ManagedChannelBuilder; -//import io.grpc.MethodDescriptor; -//import io.grpc.stub.AbstractBlockingStub; -//import io.grpc.stub.StreamObserver; -//import lombok.extern.slf4j.Slf4j; -// -//@Service -//@Slf4j -//public class LicenseVerifierService { -// -// private static final Duration CHECK_INTERVAL = Duration.ofMinutes(10); -// private static final String contentKey = "contentKey"; -// private static final Gson mapper = new Gson(); -// private static LicenseContent content; -// private static KvService kvService; -// private static volatile boolean installed = false; -// private final MachineInfo machineInfo; -// private final PDConfig pdConfig; -// private final Instant lastCheckTime = Instant.now(); -// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// // private final LicenseVerifyParam verifyParam; -// private LicenseVerifyManager manager; -// private ManagedChannel channel; -// -// // public static LicenseVerifierService instance() { -// // if (INSTANCE == null) { -// // synchronized (LicenseVerifierService.class) { -// // if (INSTANCE == null) { -// // INSTANCE = new LicenseVerifierService(); -// // } -// // } -// // } -// // return INSTANCE; -// // } -// -// // public void verifyIfNeeded() { -// // Instant now = Instant.now(); -// // Duration interval = Duration.between(this.lastCheckTime, now); -// // if (!interval.minus(CHECK_INTERVAL).isNegative()) { -// // this.verify(); -// // this.lastCheckTime = now; -// // } -// // } -// -// public LicenseVerifierService(PDConfig pdConfig) { -// this.pdConfig = pdConfig; -// machineInfo = new MachineInfo(); -// kvService = new KvService(pdConfig); -// // verifyParam = initLicense(pdConfig); -// } -// -// private static LicenseVerifyParam buildVerifyParam(String path) { -// // NOTE: can't use JsonUtil due to it bind tinkerpop jackson -// try { -// ObjectMapper mapper = new ObjectMapper(); -// File licenseParamFile = new File(path); -// if (!licenseParamFile.exists()) { -// log.warn("failed to get file:{}", path); -// return null; -// } -// return mapper.readValue(licenseParamFile, LicenseVerifyParam.class); -// } catch (IOException e) { -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, -// String.format("Failed to read json stream to %s", -// LicenseVerifyParam.class)); -// } -// } -// -// public LicenseVerifyParam init() { -// LicenseVerifyParam verifyParam = null; -// if (!installed) { -// synchronized (LicenseVerifierService.class) { -// if (!installed) { -// verifyParam = buildVerifyParam(pdConfig.getVerifyPath()); -// log.info("get license param: {}", pdConfig.getVerifyPath()); -// if (verifyParam != null) { -// LicenseParam licenseParam = this.initLicenseParam(verifyParam); -// this.manager = new LicenseVerifyManager(licenseParam); -// // this.install("d01e1814cd9edb01a05671bebf3919cc"); -// try { -// // this.verifyPublicCert(md5); -// File licenseFile = new File(pdConfig.getLicensePath()); -// if (!licenseFile.exists()) { -// log.warn("invalid parameter:license-path"); -// return null; -// } else { -// log.info("get license file....{}", licenseFile.getAbsolutePath()); -// } -// this.manager.uninstall(); -// content = this.manager.install(licenseFile); -// ExtraParam param = LicenseVerifyManager.getExtraParams(content); -// content.setExtra(param); -// this.checkIpAndMac(param); -// // 获取有效期,并设置过期时间,通知 leader,将 content 保存到... -// Date notAfter = content.getNotAfter(); -// long ttl = notAfter.getTime() - System.currentTimeMillis(); -// final TTLResponse[] info = {null}; -// if (!isLeader()) { -// while (RaftEngine.getInstance().getLeader() == null) { -// this.wait(200); -// } -// if (RaftEngine.getInstance().getLeader() != null) { -// CountDownLatch latch = new CountDownLatch(1); -// TTLRequest request = -// TTLRequest.newBuilder().setKey(contentKey).setValue( -// mapper.toJson(content, -// LicenseContent.class)) -// .setTtl(ttl).build(); -// StreamObserver observer = -// new StreamObserver() { -// @Override -// public void onNext(TTLResponse value) { -// info[0] = value; -// latch.countDown(); -// } -// -// @Override -// public void onError(Throwable t) { -// latch.countDown(); -// } -// -// @Override -// public void onCompleted() { -// latch.countDown(); -// } -// }; -// redirectToLeader(KvServiceGrpc.getPutTTLMethod(), request, -// observer); -// latch.await(); -// Pdpb.Error error = info[0].getHeader().getError(); -// if (!error.getType().equals(Pdpb.ErrorType.OK)) { -// throw new Exception(error.getMessage()); -// } -// } else { -// log.warn("wait for leader to put the license content......"); -// } -// -// } else { -// kvService.put(contentKey, -// mapper.toJson(content, LicenseContent.class), ttl); -// } -// installed = true; -// log.info("The license is successfully installed, valid for {} - {}", -// content.getNotBefore(), notAfter); -// } catch (Exception e) { -// log.error("Failed to install license", e); -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_ERROR_VALUE, -// "Failed to install license, ", e); -// } -// } -// } -// } -// } -// return verifyParam; -// } -// -// public synchronized void install(String md5) { -// -// } -// -// public HashMap getContext() throws Exception { -// try { -// String value = kvService.get(contentKey); -// if (StringUtils.isEmpty(value)) { -// throw new Exception("can not find license content from storage"); -// } -// LicenseContent content = mapper.fromJson(value, LicenseContent.class); -// Date notAfter = content.getNotAfter(); -// Date notBefore = content.getNotBefore(); -// Date issued = content.getIssued(); -// // long currentTimeMillis = System.currentTimeMillis(); -// // long diff = notAfter - currentTimeMillis; -// // boolean expired = diff <= 0; -// HashMap result = mapper.fromJson(value, HashMap.class); -// result.put("current", formatter.format(new Date())); -// result.put("notAfter", formatter.format(notAfter)); -// result.put("issued", formatter.format(issued)); -// result.put("notBefore", formatter.format(notBefore)); -// return result; -// } catch (Exception e) { -// throw new Exception("can not find license content from storage:" + e.getMessage()); -// } -// } -// -// public LicenseContent verify(int cores, int nodeCount) { -// try { -// String value = kvService.get(contentKey); -// if (StringUtils.isEmpty(value)) { -// throw new Exception("can not find license content from storage"); -// } -// LicenseContent content = mapper.fromJson(value, LicenseContent.class); -// LinkedTreeMap param = (LinkedTreeMap) content.getExtra(); -// int licCpus = ((Double) param.get("cpus")).intValue(); -// int licNodes = ((Double) param.get("nodes")).intValue(); -// if (param != null) { -// if (licCpus != -1) { -// // licCpus 为 -1 时,表示不限制 cpu 核数 -// if (cores <= 0 || cores > licCpus) { -// String msg = -// String.format("无效的 cpu 核数:%s,授权数:%s", cores, licCpus); -// throw new PDRuntimeException( -// Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, msg); -// } -// } -// -// if (licNodes != -1) { -// // licNodes 为 -1 时,表示不限制服务节点数目 -// if (nodeCount > licNodes) { -// String msg = -// String.format("无效的节点个数:%s,授权数:%s", nodeCount, licNodes); -// throw new PDRuntimeException( -// Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, msg); -// } -// } -// } -// return content; -// } catch (Exception e) { -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, -// "授权信息校验异常," + e.getMessage()); -// } -// } -// -// public boolean isLeader() { -// return RaftEngine.getInstance().isLeader(); -// } -// -// // private void verifyPublicCert(String expectMD5) { -// // String path = this.verifyParam.publicKeyPath(); -// // try (InputStream is = LicenseVerifierService.class.getResourceAsStream(path)) { -// // String actualMD5 = DigestUtils.md5Hex(is); -// // if (!actualMD5.equals(expectMD5)) { -// // throw new PDRuntimeException(PDRuntimeException.LICENSE_ERROR, "Invalid public -// // cert"); -// // } -// // } catch (IOException e) { -// // log.error("Failed to read public cert", e); -// // throw new PDRuntimeException(PDRuntimeException.LICENSE_ERROR, "Failed to read -// // public cert", e); -// // } -// // } -// -// private > void redirectToLeader( -// MethodDescriptor method, ReqT req, -// io.grpc.stub.StreamObserver observer) { -// try { -// if (channel == null) { -// synchronized (this) { -// if (channel == null) { -// channel = ManagedChannelBuilder -// .forTarget(RaftEngine.getInstance().getLeaderGrpcAddress()) -// .usePlaintext() -// .build(); -// } -// } -// log.info("Grpc get leader address {}", -// RaftEngine.getInstance().getLeaderGrpcAddress()); -// } -// -// io.grpc.stub.ClientCalls.asyncUnaryCall(channel.newCall(method, CallOptions.DEFAULT), -// req, -// observer); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// } -// -// private LicenseParam initLicenseParam(LicenseVerifyParam param) { -// Preferences preferences = Preferences.userNodeForPackage(LicenseVerifierService.class); -// CipherParam cipherParam = new DefaultCipherParam(param.storePassword()); -// KeyStoreParam keyStoreParam = new DefaultKeyStoreParam(LicenseVerifierService.class, -// param.publicKeyPath(), -// param.publicAlias(), -// param.storePassword(), null); -// return new DefaultLicenseParam(param.subject(), preferences, keyStoreParam, cipherParam); -// } -// -// public String getIpAndMac() { -// List actualIps = this.machineInfo.getIpAddress(); -// String host = pdConfig.getHost(); -// String licenseHost = host; -// if (!actualIps.contains(host)) { -// licenseHost = actualIps.get(0); -// } -// try { -// String mac = this.machineInfo.getMacByInetAddress(InetAddress.getByName(licenseHost)); -// HashMap ipAndMac = new HashMap<>(); -// ipAndMac.put("ip", licenseHost); -// ipAndMac.put("mac", mac); -// String json = new Gson().toJson(ipAndMac); -// String encode = Base64Utils.encodeToString(json.getBytes(Charset.defaultCharset())); -// return encode; -// } catch (Exception e) { -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_ERROR_VALUE, -// String.format("Failed to get ip and mac for %s", -// e.getMessage())); -// } -// } -// -// private void checkIpAndMac(ExtraParam param) { -// String expectIp = param.ip(); -// boolean matched = false; -// List actualIps = null; -// if (StringUtils.isEmpty(expectIp)) { -// matched = true; -// } else { -// actualIps = this.machineInfo.getIpAddress(); -// for (String actualIp : actualIps) { -// if (actualIp.equalsIgnoreCase(expectIp)) { -// matched = true; -// break; -// } -// } -// } -// if (!matched) { -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, String.format( -// "The server's ip '%s' doesn't match the authorized '%s'", actualIps, -// expectIp)); -// } -// String expectMac = param.mac(); -// if (StringUtils.isEmpty(expectMac)) { -// return; -// } -// // The mac must be not empty here -// if (!StringUtils.isEmpty(expectIp)) { -// String actualMac; -// try { -// actualMac = this.machineInfo.getMacByInetAddress(InetAddress.getByName(expectIp)); -// } catch (UnknownHostException e) { -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, -// String.format("Failed to get mac address for ip -// '%s'", -// expectIp)); -// } -// String expectFormatMac = expectMac.replaceAll(":", "-"); -// String actualFormatMac = actualMac.replaceAll(":", "-"); -// if (!actualFormatMac.equalsIgnoreCase(expectFormatMac)) { -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, -// String.format( -// "The server's mac '%s' doesn't match the " + -// "authorized '%s'", -// actualMac, expectMac)); -// } -// } else { -// String expectFormatMac = expectMac.replaceAll(":", "-"); -// List actualMacs = this.machineInfo.getMacAddress(); -// matched = false; -// for (String actualMac : actualMacs) { -// String actualFormatMac = actualMac.replaceAll(":", "-"); -// if (actualFormatMac.equalsIgnoreCase(expectFormatMac)) { -// matched = true; -// break; -// } -// } -// if (!matched) { -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, -// String.format( -// "The server's macs %s don't match the " + -// "authorized '%s'", -// actualMacs, expectMac)); -// } -// } -// } -//} diff --git a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/license/LicenseVerifyManager.java b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/license/LicenseVerifyManager.java deleted file mode 100644 index 14e95323e0..0000000000 --- a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/license/LicenseVerifyManager.java +++ /dev/null @@ -1,77 +0,0 @@ -// TODO: uncomment later - maybe useless (license related) -///* -// * 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. -// */ -// -//package org.apache.hugegraph.pd.license; -// -//import java.io.IOException; -//import java.util.List; -// -//import org.apache.hugegraph.license.CommonLicenseManager; -//import org.apache.hugegraph.license.ExtraParam; -//import org.apache.hugegraph.pd.common.PDRuntimeException; -//import org.apache.hugegraph.pd.grpc.Pdpb; -// -//import com.fasterxml.jackson.core.type.TypeReference; -//import com.fasterxml.jackson.databind.ObjectMapper; -// -//import de.schlichtherle.license.LicenseContent; -//import de.schlichtherle.license.LicenseContentException; -//import de.schlichtherle.license.LicenseParam; -//import lombok.extern.slf4j.Slf4j; -// -//@Slf4j -//public class LicenseVerifyManager extends CommonLicenseManager { -// -// private static final ObjectMapper MAPPER = new ObjectMapper(); -// private static final int NO_LIMIT = -1; -// -// public LicenseVerifyManager(LicenseParam param) { -// super(param); -// } -// -// public static ExtraParam getExtraParams(LicenseContent content) { -// List params; -// try { -// TypeReference> type; -// type = new TypeReference>() { -// }; -// params = MAPPER.readValue((String) content.getExtra(), type); -// if (params != null && params.size() > 0) { -// return params.get(0); -// } -// } catch (IOException e) { -// log.error("Failed to read extra params", e); -// throw new PDRuntimeException(Pdpb.ErrorType.LICENSE_VERIFY_ERROR_VALUE, -// "Failed to read extra params", e); -// } -// return null; -// } -// -// @Override -// protected synchronized void validate(LicenseContent content) throws LicenseContentException { -// // Call super validate firstly to verify the common license parameters -// try { -// super.validate(content); -// } catch (LicenseContentException e) { -// // log.error("Failed to verify license", e); -// throw e; -// } -// // Verify the customized license parameters. -// getExtraParams(content); -// } -//} diff --git a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/metrics/PDMetrics.java b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/metrics/PDMetrics.java index bbebfbe513..427d19c114 100644 --- a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/metrics/PDMetrics.java +++ b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/metrics/PDMetrics.java @@ -54,11 +54,11 @@ public synchronized void init(MeterRegistry meterRegistry) { private void registerMeters() { Gauge.builder(PREFIX + ".up", () -> 1).register(registry); - Gauge.builder(PREFIX + ".graphs", () -> updateGraphs()) + Gauge.builder(PREFIX + ".graphs", this::updateGraphs) .description("Number of graphs registered in PD") .register(registry); - Gauge.builder(PREFIX + ".stores", () -> updateStores()) + Gauge.builder(PREFIX + ".stores", this::updateStores) .description("Number of stores registered in PD") .register(registry); diff --git a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/model/RegistryRestResponse.java b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/model/RegistryRestResponse.java index fda5ef8c75..32956eb450 100644 --- a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/model/RegistryRestResponse.java +++ b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/model/RegistryRestResponse.java @@ -29,5 +29,4 @@ public class RegistryRestResponse { Pdpb.ErrorType errorType; String message; Serializable data; - } diff --git a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/notice/NoticeBroadcaster.java b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/notice/NoticeBroadcaster.java index 03ff2c11c6..9644e78c19 100644 --- a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/notice/NoticeBroadcaster.java +++ b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/notice/NoticeBroadcaster.java @@ -24,6 +24,7 @@ import lombok.extern.slf4j.Slf4j; +// TODO: merge/move to another package @Slf4j public class NoticeBroadcaster { diff --git a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/pulse/PDPulseSubject.java b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/pulse/PDPulseSubject.java index 48fe2d7727..6c7c21818b 100644 --- a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/pulse/PDPulseSubject.java +++ b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/pulse/PDPulseSubject.java @@ -94,7 +94,6 @@ private static void doSchedule() { expireQueue(); //retry broadcasterQueue.forEach(e -> { - e.notifying(); }); } diff --git a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/MemberAPI.java b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/MemberAPI.java index b28b20a583..d0078b5db6 100644 --- a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/MemberAPI.java +++ b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/MemberAPI.java @@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletRequest; +import org.apache.hugegraph.pd.common.Useless; import org.apache.hugegraph.pd.grpc.Metapb; import org.apache.hugegraph.pd.grpc.Pdpb; import org.apache.hugegraph.pd.model.PeerRestRequest; @@ -234,8 +235,7 @@ public Member(Metapb.Member member) { } - public Member() { - - } + @Useless("delete later") + public Member() {} } }