Merge pull request #458 from mabaiwan/develop

Code formatting and redundant code removal
pull/467/head
小马哥 2 years ago committed by GitHub
commit 42756b88ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,9 +25,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
/** /**
* Bootstrap properties. * Bootstrap properties.
*
* @author chen.ma
* @date 2021/6/22 09:14
*/ */
@Slf4j @Slf4j
@Getter @Getter

@ -37,9 +37,6 @@ import static cn.hippo4j.core.toolkit.IdentifyUtil.CLIENT_IDENTIFICATION_VALUE;
/** /**
* Dynamic threadPool discovery config. * Dynamic threadPool discovery config.
*
* @author chen.ma
* @date 2021/8/6 21:35
*/ */
@AllArgsConstructor @AllArgsConstructor
public class DiscoveryConfiguration { public class DiscoveryConfiguration {

@ -59,9 +59,6 @@ import org.springframework.core.env.ConfigurableEnvironment;
/** /**
* Dynamic thread-pool auto-configuration. * Dynamic thread-pool auto-configuration.
*
* @author chen.ma
* @date 2021/6/22 09:20
*/ */
@Configuration @Configuration
@AllArgsConstructor @AllArgsConstructor

@ -32,9 +32,6 @@ import java.util.concurrent.TimeUnit;
/** /**
* Http client config. * Http client config.
*
* @author chen.ma
* @date 2021/6/10 13:28
*/ */
public class HttpClientConfiguration { public class HttpClientConfiguration {

@ -25,9 +25,6 @@ import org.springframework.context.annotation.Bean;
/** /**
* Netty ClientCon figuration * Netty ClientCon figuration
*
* @author lk
* @date 2022/6/18
*/ */
@ConditionalOnProperty(prefix = BootstrapProperties.PREFIX, name = "report-type", matchIfMissing = false, havingValue = "netty") @ConditionalOnProperty(prefix = BootstrapProperties.PREFIX, name = "report-type", matchIfMissing = false, havingValue = "netty")
public class NettyClientConfiguration { public class NettyClientConfiguration {

@ -1,37 +0,0 @@
/*
* 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 cn.hippo4j.springboot.starter.config.condition;
import cn.hippo4j.common.toolkit.StringUtil;
import cn.hippo4j.springboot.starter.config.BootstrapProperties;
import com.example.monitor.base.MonitorTypeEnum;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
/**
* Prometheus monitor condition.
*/
public class PrometheusMonitorCondition implements Condition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
String collectType = context.getEnvironment().getProperty(BootstrapProperties.PREFIX + ".collect-type", "");
return StringUtil.isNotEmpty(collectType) && collectType.contains(MonitorTypeEnum.PROMETHEUS.name().toLowerCase()) ? true : false;
}
}

@ -33,11 +33,7 @@ import java.util.concurrent.ThreadPoolExecutor;
/** /**
* Base thread detail state handler. * Base thread detail state handler.
* *
* <p> The Java 8 implementation is temporarily provided, * <p> The Java 8 implementation is temporarily provided, {@link ThreadDetailState} interface can be customized.
* {@link ThreadDetailState} interface can be customized.
*
* @author chen.ma
* @date 2022/1/9 13:01
*/ */
@Slf4j @Slf4j
public class BaseThreadDetailStateHandler implements ThreadDetailState { public class BaseThreadDetailStateHandler implements ThreadDetailState {
@ -62,7 +58,6 @@ public class BaseThreadDetailStateHandler implements ThreadDetailState {
if (CollectionUtil.isEmpty(workers)) { if (CollectionUtil.isEmpty(workers)) {
return resultThreadState; return resultThreadState;
} }
for (Object worker : workers) { for (Object worker : workers) {
Thread thread; Thread thread;
try { try {
@ -75,7 +70,6 @@ public class BaseThreadDetailStateHandler implements ThreadDetailState {
log.error("Reflection get worker thread exception. Worker :: {}", worker, ex); log.error("Reflection get worker thread exception. Worker :: {}", worker, ex);
continue; continue;
} }
long threadId = thread.getId(); long threadId = thread.getId();
String threadName = thread.getName(); String threadName = thread.getName();
String threadStatus = thread.getState().name(); String threadStatus = thread.getState().name();

@ -28,9 +28,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
/** /**
* Cache data. * Cache data.
*
* @author chen.ma
* @date 2021/6/22 20:46
*/ */
@Slf4j @Slf4j
public class CacheData { public class CacheData {
@ -66,7 +63,6 @@ public class CacheData {
if (null == listener) { if (null == listener) {
throw new IllegalArgumentException("Listener is null."); throw new IllegalArgumentException("Listener is null.");
} }
ManagerListenerWrapper managerListenerWrap = new ManagerListenerWrapper(md5, listener); ManagerListenerWrapper managerListenerWrap = new ManagerListenerWrapper(md5, listener);
if (listeners.addIfAbsent(managerListenerWrap)) { if (listeners.addIfAbsent(managerListenerWrap)) {
log.info("Add listener status :: ok, thread pool id :: {}, listeners count :: {}", tpId, listeners.size()); log.info("Add listener status :: ok, thread pool id :: {}, listeners count :: {}", tpId, listeners.size());
@ -87,7 +83,6 @@ public class CacheData {
wrap.setLastCallMd5(md5); wrap.setLastCallMd5(md5);
listener.receiveConfigInfo(content); listener.receiveConfigInfo(content);
}; };
try { try {
listener.getExecutor().execute(runnable); listener.getExecutor().execute(runnable);
} catch (Exception ex) { } catch (Exception ex) {

@ -38,9 +38,6 @@ import static cn.hippo4j.common.constant.Constants.*;
/** /**
* Client worker. * Client worker.
*
* @author chen.ma
* @date 2021/6/20 18:34
*/ */
@Slf4j @Slf4j
public class ClientWorker { public class ClientWorker {
@ -109,7 +106,6 @@ public class ClientWorker {
List<CacheData> cacheDataList = new ArrayList(); List<CacheData> cacheDataList = new ArrayList();
List<String> inInitializingCacheList = new ArrayList(); List<String> inInitializingCacheList = new ArrayList();
cacheMap.forEach((key, val) -> cacheDataList.add(val)); cacheMap.forEach((key, val) -> cacheDataList.add(val));
List<String> changedTpIds = checkUpdateDataIds(cacheDataList, inInitializingCacheList); List<String> changedTpIds = checkUpdateDataIds(cacheDataList, inInitializingCacheList);
for (String groupKey : changedTpIds) { for (String groupKey : changedTpIds) {
String[] keys = groupKey.split(GROUP_KEY_DELIMITER_TRANSLATION); String[] keys = groupKey.split(GROUP_KEY_DELIMITER_TRANSLATION);
@ -121,12 +117,10 @@ public class ClientWorker {
CacheData cacheData = cacheMap.get(tpId); CacheData cacheData = cacheMap.get(tpId);
String poolContent = ContentUtil.getPoolContent(JSONUtil.parseObject(content, ThreadPoolParameterInfo.class)); String poolContent = ContentUtil.getPoolContent(JSONUtil.parseObject(content, ThreadPoolParameterInfo.class));
cacheData.setContent(poolContent); cacheData.setContent(poolContent);
} catch (Exception ex) { } catch (Exception ignored) {
// ignore log.error("Failed to get the latest thread pool configuration.", ignored);
log.error("Failed to get the latest thread pool configuration.", ex);
} }
} }
for (CacheData cacheData : cacheDataList) { for (CacheData cacheData : cacheDataList) {
if (!cacheData.isInitializing() || inInitializingCacheList if (!cacheData.isInitializing() || inInitializingCacheList
.contains(GroupKey.getKeyTenant(cacheData.tpId, cacheData.itemId, cacheData.tenantId))) { .contains(GroupKey.getKeyTenant(cacheData.tpId, cacheData.itemId, cacheData.tenantId))) {

@ -23,9 +23,6 @@ import org.springframework.boot.diagnostics.FailureAnalysis;
/** /**
* Config empty analyzer. * Config empty analyzer.
*
* @author chen.ma
* @date 2021/11/28 21:59
*/ */
public class ConfigEmptyAnalyzer extends AbstractFailureAnalyzer<ConfigEmptyException> { public class ConfigEmptyAnalyzer extends AbstractFailureAnalyzer<ConfigEmptyException> {

@ -19,9 +19,6 @@ package cn.hippo4j.springboot.starter.core;
/** /**
* Config service. * Config service.
*
* @author chen.ma
* @date 2021/6/21 21:49
*/ */
public interface ConfigService { public interface ConfigService {

@ -17,7 +17,6 @@
package cn.hippo4j.springboot.starter.core; package cn.hippo4j.springboot.starter.core;
import cn.hippo4j.adapter.base.ThreadPoolAdapter;
import cn.hippo4j.common.api.ClientCloseHookExecute; import cn.hippo4j.common.api.ClientCloseHookExecute;
import cn.hippo4j.common.config.ApplicationContextHolder; import cn.hippo4j.common.config.ApplicationContextHolder;
import cn.hippo4j.common.constant.Constants; import cn.hippo4j.common.constant.Constants;
@ -32,7 +31,6 @@ import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -41,9 +39,6 @@ import static cn.hippo4j.common.constant.Constants.BASE_PATH;
/** /**
* Discovery client. * Discovery client.
*
* @author chen.ma
* @date 2021/7/13 21:51
*/ */
@Slf4j @Slf4j
public class DiscoveryClient implements DisposableBean { public class DiscoveryClient implements DisposableBean {

@ -21,9 +21,6 @@ import java.util.concurrent.Executor;
/** /**
* Listener. * Listener.
*
* @author chen.ma
* @date 2021/6/22 20:20
*/ */
public interface Listener { public interface Listener {

@ -45,9 +45,6 @@ import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_THREAD
/** /**
* Thread pool dynamic refresh. * Thread pool dynamic refresh.
*
* @author chen.ma
* @date 2021/6/20 15:51
*/ */
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
@ -58,10 +55,8 @@ public class ServerThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh
@Override @Override
public void dynamicRefresh(String content) { public void dynamicRefresh(String content) {
ThreadPoolParameterInfo parameter = JSONUtil.parseObject(content, ThreadPoolParameterInfo.class); ThreadPoolParameterInfo parameter = JSONUtil.parseObject(content, ThreadPoolParameterInfo.class);
String threadPoolId = parameter.getTpId(); String threadPoolId = parameter.getTpId();
ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor(); ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor();
refreshDynamicPool(parameter, executor); refreshDynamicPool(parameter, executor);
} }
@ -79,7 +74,6 @@ public class ServerThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh
int originalCapacity = executor.getQueue().remainingCapacity() + executor.getQueue().size(); int originalCapacity = executor.getQueue().remainingCapacity() + executor.getQueue().size();
long originalKeepAliveTime = executor.getKeepAliveTime(TimeUnit.SECONDS); long originalKeepAliveTime = executor.getKeepAliveTime(TimeUnit.SECONDS);
boolean originalAllowCoreThreadTimeOut = executor.allowsCoreThreadTimeOut(); boolean originalAllowCoreThreadTimeOut = executor.allowsCoreThreadTimeOut();
Long originalExecuteTimeOut = null; Long originalExecuteTimeOut = null;
RejectedExecutionHandler rejectedExecutionHandler = executor.getRejectedExecutionHandler(); RejectedExecutionHandler rejectedExecutionHandler = executor.getRejectedExecutionHandler();
if (executor instanceof AbstractDynamicExecutorSupport) { if (executor instanceof AbstractDynamicExecutorSupport) {
@ -99,7 +93,6 @@ public class ServerThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh
request.setBeforeRejectedName(originalRejected); request.setBeforeRejectedName(originalRejected);
request.setBeforeExecuteTimeOut(originalExecuteTimeOut); request.setBeforeExecuteTimeOut(originalExecuteTimeOut);
request.setThreadPoolId(threadPoolId); request.setThreadPoolId(threadPoolId);
changePoolInfo(executor, parameter); changePoolInfo(executor, parameter);
ThreadPoolExecutor afterExecutor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor(); ThreadPoolExecutor afterExecutor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor();
request.setNowCorePoolSize(afterExecutor.getCorePoolSize()); request.setNowCorePoolSize(afterExecutor.getCorePoolSize());

@ -19,9 +19,6 @@ package cn.hippo4j.springboot.starter.core;
/** /**
* Shutdown execute exception. * Shutdown execute exception.
*
* @author chen.ma
* @date 2021/12/9 21:48
*/ */
public class ShutdownExecuteException extends Exception { public class ShutdownExecuteException extends Exception {

@ -26,9 +26,6 @@ import java.util.Arrays;
/** /**
* Thread-pool config service. * Thread-pool config service.
*
* @author chen.ma
* @date 2021/6/21 21:50
*/ */
public class ThreadPoolConfigService implements ConfigService, ApplicationListener<ApplicationCompleteEvent> { public class ThreadPoolConfigService implements ConfigService, ApplicationListener<ApplicationCompleteEvent> {

@ -23,9 +23,6 @@ import java.util.concurrent.Executor;
/** /**
* Thread-pool operation. * Thread-pool operation.
*
* @author chen.ma
* @date 2021/6/22 20:25
*/ */
public class ThreadPoolOperation { public class ThreadPoolOperation {

@ -19,9 +19,6 @@ package cn.hippo4j.springboot.starter.core;
/** /**
* ThreadPool subscribe callback. * ThreadPool subscribe callback.
*
* @author chen.ma
* @date 2021/6/22 20:26
*/ */
public interface ThreadPoolSubscribeCallback { public interface ThreadPoolSubscribeCallback {

@ -21,9 +21,6 @@ import org.springframework.context.ApplicationEvent;
/** /**
* Execute after the spring application context is successfully started. * Execute after the spring application context is successfully started.
*
* @author chen.ma
* @date 2021/12/25 21:19
*/ */
public class ApplicationCompleteEvent extends ApplicationEvent { public class ApplicationCompleteEvent extends ApplicationEvent {

@ -25,9 +25,6 @@ import javax.annotation.Resource;
/** /**
* Application content post processor. * Application content post processor.
*
* @author chen.ma
* @date 2021/12/25 20:21
*/ */
public class ApplicationContentPostProcessor implements ApplicationListener<ApplicationReadyEvent> { public class ApplicationContentPostProcessor implements ApplicationListener<ApplicationReadyEvent> {

@ -1,56 +0,0 @@
/*
* 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 cn.hippo4j.springboot.starter.event;
import cn.hippo4j.common.function.NoArgsConsumer;
import cn.hippo4j.core.executor.support.QueueTypeEnum;
import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ThreadPoolExecutor;
import static cn.hippo4j.common.constant.Constants.AVAILABLE_PROCESSORS;
/**
* 线.
*
* @author chen.ma
* @date 2021/11/8 23:44
*/
@Slf4j
public class MonitorEventExecutor {
private static final ExecutorService EVENT_EXECUTOR = ThreadPoolBuilder.builder()
.threadFactory("client.monitor.event.executor")
.corePoolSize(AVAILABLE_PROCESSORS)
.maxPoolNum(AVAILABLE_PROCESSORS)
.workQueue(QueueTypeEnum.LINKED_BLOCKING_QUEUE)
.capacity(4096)
.rejected(new ThreadPoolExecutor.AbortPolicy())
.build();
public static void publishEvent(NoArgsConsumer consumer) {
try {
EVENT_EXECUTOR.execute(consumer::accept);
} catch (RejectedExecutionException ex) {
log.error("Monitoring thread pool run events exceeded load.");
}
}
}

@ -53,11 +53,8 @@ import static cn.hippo4j.core.executor.manage.GlobalThreadPoolManage.getThreadPo
/** /**
* Dynamic thread pool collection and reporting event executor. * Dynamic thread pool collection and reporting event executor.
* <p>
* {@link BlockingQueue} Act as a buffer container, enabling a production-consumption model.
* *
* @author chen.ma * <p> {@link BlockingQueue} Act as a buffer container, enabling a production-consumption model.
* @date 2021/12/6 20:23
*/ */
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor

@ -21,9 +21,6 @@ import cn.hippo4j.common.monitor.Message;
/** /**
* Collect thread-pool data. * Collect thread-pool data.
*
* @author chen.ma
* @date 2021/12/7 20:11
*/ */
public interface Collector { public interface Collector {

@ -35,9 +35,6 @@ import static cn.hippo4j.core.toolkit.IdentifyUtil.getThreadPoolIdentify;
/** /**
* Thread pool runtime data collection. * Thread pool runtime data collection.
*
* @author chen.ma
* @date 2021/12/16 19:46
*/ */
@AllArgsConstructor @AllArgsConstructor
public class RunTimeInfoCollector extends AbstractThreadPoolRuntime implements Collector { public class RunTimeInfoCollector extends AbstractThreadPoolRuntime implements Collector {

@ -21,9 +21,6 @@ import cn.hippo4j.common.monitor.Message;
/** /**
* Message sender. * Message sender.
*
* @author chen.ma
* @date 2021/12/7 20:49
*/ */
public interface MessageSender { public interface MessageSender {

@ -29,9 +29,6 @@ import static cn.hippo4j.common.constant.Constants.MONITOR_PATH;
/** /**
* Http sender. * Http sender.
*
* @author chen.ma
* @date 2021/12/7 20:53
*/ */
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor

@ -33,13 +33,9 @@ import io.netty.handler.codec.serialization.ObjectDecoder;
import io.netty.handler.codec.serialization.ObjectEncoder; import io.netty.handler.codec.serialization.ObjectEncoder;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/** /**
* Netty ConnectSender * Netty connect sender.
*
* @author lk
* @date 2022/06/18
*/ */
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
@ -66,7 +62,6 @@ public class NettyConnectSender implements MessageSender {
pipeline.addLast(new SenderHandler(messageWrapper)); pipeline.addLast(new SenderHandler(messageWrapper));
} }
}); });
bootstrap.connect(serverNettyAgent.getNettyServerAddress(), serverNettyAgent.getNettyServerPort()).sync(); bootstrap.connect(serverNettyAgent.getNettyServerAddress(), serverNettyAgent.getNettyServerPort()).sync();
} catch (Exception e) { } catch (Exception e) {
log.error("netty send error ", e); log.error("netty send error ", e);

@ -24,10 +24,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /**
* SenderHandler * Sender handler.
*
* @author lk
* @date 2022/06/18
*/ */
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
@ -37,7 +34,6 @@ public class SenderHandler extends SimpleChannelInboundHandler<MessageWrapper> {
@Override @Override
protected void channelRead0(ChannelHandlerContext ctx, MessageWrapper msg) throws Exception { protected void channelRead0(ChannelHandlerContext ctx, MessageWrapper msg) throws Exception {
} }
@Override @Override

@ -42,9 +42,6 @@ import static cn.hippo4j.common.constant.Constants.BASE_PATH;
/** /**
* Server notify config builder. * Server notify config builder.
*
* @author chen.ma
* @date 2022/2/24 19:57
*/ */
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor

@ -36,9 +36,6 @@ import static cn.hippo4j.common.constant.Constants.HEALTH_CHECK_INTERVAL;
/** /**
* Abstract health check. * Abstract health check.
*
* @author chen.ma
* @date 2021/12/8 20:19
*/ */
@Slf4j @Slf4j
public abstract class AbstractHealthCheck implements ServerHealthCheck, InitializingBean, ApplicationListener<ApplicationCompleteEvent> { public abstract class AbstractHealthCheck implements ServerHealthCheck, InitializingBean, ApplicationListener<ApplicationCompleteEvent> {

@ -23,9 +23,6 @@ import java.util.Map;
/** /**
* Http agent. * Http agent.
*
* @author chen.ma
* @date 2021/6/23 20:45
*/ */
public interface HttpAgent { public interface HttpAgent {

@ -28,9 +28,6 @@ import static cn.hippo4j.common.constant.Constants.UP;
/** /**
* Server health check. * Server health check.
*
* @author chen.ma
* @date 2021/12/8 20:16
*/ */
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
@ -49,7 +46,6 @@ public class HttpScheduledHealthCheck extends AbstractHealthCheck {
} catch (Throwable ex) { } catch (Throwable ex) {
log.error("Failed to periodically check the health status of the server.", ex.getMessage()); log.error("Failed to periodically check the health status of the server.", ex.getMessage());
} }
return healthStatus; return healthStatus;
} }
} }

@ -19,9 +19,6 @@ package cn.hippo4j.springboot.starter.remote;
/** /**
* Server health check. * Server health check.
*
* @author chen.ma
* @date 2021/12/8 20:08
*/ */
public interface ServerHealthCheck { public interface ServerHealthCheck {

@ -34,9 +34,6 @@ import java.util.concurrent.TimeUnit;
/** /**
* Server http agent. * Server http agent.
*
* @author chen.ma
* @date 2021/6/23 20:50
*/ */
public class ServerHttpAgent implements HttpAgent { public class ServerHttpAgent implements HttpAgent {

@ -27,9 +27,6 @@ import java.util.*;
/** /**
* Server list manager. * Server list manager.
*
* @author chen.ma
* @date 2021/6/23 20:42
*/ */
@Slf4j @Slf4j
public class ServerListManager { public class ServerListManager {

@ -22,10 +22,7 @@ import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup;
/** /**
* Server Netty Agent * Server netty agent.
*
* @author lk
* @date 2022/6/18
*/ */
public class ServerNettyAgent { public class ServerNettyAgent {

@ -33,9 +33,6 @@ import java.util.concurrent.TimeUnit;
/** /**
* Security proxy. * Security proxy.
*
* @author chen.ma
* @date 2021/12/20 20:19
*/ */
@Slf4j @Slf4j
public class SecurityProxy { public class SecurityProxy {
@ -74,8 +71,7 @@ public class SecurityProxy {
return true; return true;
} }
} }
} catch (Throwable ignore) { } catch (Throwable ignored) {
// ignore
} }
return false; return false;
} }

@ -23,9 +23,6 @@ import org.springframework.core.env.PropertyResolver;
/** /**
* Cloud common id util. * Cloud common id util.
*
* @author chen.ma
* @date 2021/8/6 21:02
*/ */
public class CloudCommonIdUtil { public class CloudCommonIdUtil {
@ -51,8 +48,7 @@ public class CloudCommonIdUtil {
return combineParts(hostname, SEPARATOR, appName); return combineParts(hostname, SEPARATOR, appName);
} }
public static String combineParts(String firstPart, String separator, public static String combineParts(String firstPart, String separator, String secondPart) {
String secondPart) {
String combined = null; String combined = null;
if (firstPart != null && secondPart != null) { if (firstPart != null && secondPart != null) {
combined = firstPart + separator + secondPart; combined = firstPart + separator + secondPart;

@ -30,9 +30,6 @@ import java.util.concurrent.TimeUnit;
/** /**
* HttpClient util. * HttpClient util.
*
* @author chen.ma
* @date 2021/6/10 13:30
*/ */
@Slf4j @Slf4j
public class HttpClientUtil { public class HttpClientUtil {

@ -25,9 +25,6 @@ import lombok.Setter;
/** /**
* Manager listener wrapper. * Manager listener wrapper.
*
* @author chen.ma
* @date 2021/6/22 17:47
*/ */
@Getter @Getter
@Setter @Setter

Loading…
Cancel
Save