Skip to content

Commit 4757e00

Browse files
authored
Code optimization and logic refactoring (opengoofy#909)
* Code optimization and logic refactoring * Code optimization and logic refactoring * Remove useless modules and refactor code * Remove kafka modules * Remove kafka code
1 parent e7863ac commit 4757e00

File tree

62 files changed

+85
-655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+85
-655
lines changed

hippo4j-adapter/hippo4j-adapter-base/src/main/java/cn/hippo4j/adapter/base/ThreadPoolAdapterBeanContainer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public class ThreadPoolAdapterBeanContainer implements InitializingBean {
3030

3131
/**
32-
* Store three-party thread pool framework bean instances.
32+
* Store three-party thread pool framework bean instances
3333
*/
3434
public static final Map<String, ThreadPoolAdapter> THREAD_POOL_ADAPTER_BEAN_CONTAINER = new ConcurrentHashMap<>();
3535

hippo4j-adapter/hippo4j-adapter-base/src/main/java/cn/hippo4j/adapter/base/ThreadPoolAdapterRegisterAction.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@ public interface ThreadPoolAdapterRegisterAction {
2828
/**
2929
* Get thread pool adapter cache configs.
3030
*
31-
* @param threadPoolAdapterMap
31+
* @param threadPoolAdapterMap thread-pool adapter map
3232
* @return List<ThreadPoolAdapterCacheConfig>
3333
*/
3434
List<ThreadPoolAdapterCacheConfig> getThreadPoolAdapterCacheConfigs(Map<String, ThreadPoolAdapter> threadPoolAdapterMap);
3535

3636
/**
3737
* Do register.
3838
*
39-
* @param cacheConfigList
40-
* @return
39+
* @param cacheConfigList cache config list
4140
*/
4241
void doRegister(List<ThreadPoolAdapterCacheConfig> cacheConfigList);
4342
}

hippo4j-adapter/hippo4j-adapter-hystrix/src/main/java/cn/hippo4j/adapter/hystrix/ThreadPoolAdapterScheduler.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package cn.hippo4j.adapter.hystrix;
1919

2020
import cn.hippo4j.common.design.builder.ThreadFactoryBuilder;
21+
import lombok.Getter;
2122
import lombok.extern.slf4j.Slf4j;
2223

2324
import java.util.concurrent.ScheduledExecutorService;
@@ -31,6 +32,7 @@ public class ThreadPoolAdapterScheduler {
3132

3233
private static final int TASK_INTERVAL_SECONDS = 10;
3334

35+
@Getter
3436
private final ScheduledExecutorService scheduler;
3537

3638
public ThreadPoolAdapterScheduler() {
@@ -41,10 +43,11 @@ public ThreadPoolAdapterScheduler() {
4143
.build());
4244
}
4345

44-
public ScheduledExecutorService getScheduler() {
45-
return scheduler;
46-
}
47-
46+
/**
47+
* Gt task interval seconds.
48+
*
49+
* @return task interval seconds
50+
*/
4851
public int getTaskIntervalSeconds() {
4952
return TASK_INTERVAL_SECONDS;
5053
}

hippo4j-adapter/hippo4j-adapter-kafka/pom.xml

-18
This file was deleted.

hippo4j-adapter/hippo4j-adapter-kafka/src/main/java/cn/hippo4j/adapter/kafka/KafkaThreadPoolAdapter.java

-52
This file was deleted.

hippo4j-adapter/hippo4j-adapter-rabbitmq/src/main/java/cn/hippo4j/adapter/rabbitmq/RabbitMQThreadPoolAdapter.java

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public void onApplicationEvent(ApplicationStartedEvent event) {
105105
log.warn("Custom thread pools only support ThreadPoolExecutor");
106106
}
107107
}
108-
109108
});
110109
}
111110
}

hippo4j-adapter/hippo4j-adapter-spring-cloud-stream-kafka/pom.xml

-18
This file was deleted.

hippo4j-adapter/hippo4j-adapter-spring-cloud-stream-kafka/src/main/java/cn/hippo4j/adapter/springcloud/stream/kafka/SpringCloudStreamKafkaThreadPoolAdapter.java

-59
This file was deleted.

hippo4j-adapter/hippo4j-adapter-spring-cloud-stream-rabbitmq/src/main/java/cn/hippo4j/adapter/springcloud/stream/rabbitmq/SpringCloudStreamRabbitMQThreadPoolAdapter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_DELIMITER;
4040

4141
/**
42-
* Spring cloud stream rabbimq thread-pool adapter.
42+
* Spring cloud stream rabbit-mq thread-pool adapter.
4343
*/
4444
@Slf4j
4545
public class SpringCloudStreamRabbitMQThreadPoolAdapter implements ThreadPoolAdapter, ApplicationListener<ApplicationStartedEvent> {

hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/AbstractWebThreadPoolService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
public abstract class AbstractWebThreadPoolService implements WebThreadPoolService, ApplicationRunner {
3535

3636
/**
37-
* Thread pool executor.
37+
* Thread pool executor
3838
*/
3939
protected volatile Executor executor;
4040

4141
/**
42-
* Get web thread pool by server.
42+
* Get web thread pool by server
4343
*
4444
* @param webServer
4545
* @return

hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/WebThreadPoolHandlerChoose.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class WebThreadPoolHandlerChoose {
3030
/**
3131
* Choose the web thread pool service bean.
3232
*
33-
* @return
33+
* @return web thread pool service bean
3434
*/
3535
public WebThreadPoolService choose() {
3636
WebThreadPoolService webThreadPoolService;

hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/WebThreadPoolRunStateHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo poolRunStateInfo
3535
long used = MemoryUtil.heapMemoryUsed();
3636
long max = MemoryUtil.heapMemoryMax();
3737
String memoryProportion = StringUtil.newBuilder(
38-
"已分配: ",
38+
"Allocation: ",
3939
ByteConvertUtil.getPrintSize(used),
40-
" / 最大可用: ",
40+
" / Maximum available: ",
4141
ByteConvertUtil.getPrintSize(max));
4242
poolRunStateInfo.setCurrentLoad(poolRunStateInfo.getCurrentLoad() + "%");
4343
poolRunStateInfo.setPeakLoad(poolRunStateInfo.getPeakLoad() + "%");

hippo4j-adapter/pom.xml

-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
<module>hippo4j-adapter-base</module>
1515
<module>hippo4j-adapter-dubbo</module>
1616
<module>hippo4j-adapter-alibaba-dubbo</module>
17-
<module>hippo4j-adapter-kafka</module>
1817
<module>hippo4j-adapter-rabbitmq</module>
1918
<module>hippo4j-adapter-rocketmq</module>
2019
<module>hippo4j-adapter-hystrix</module>
2120
<module>hippo4j-adapter-spring-cloud-stream-rocketmq</module>
22-
<module>hippo4j-adapter-spring-cloud-stream-kafka</module>
2321
<module>hippo4j-adapter-spring-cloud-stream-rabbitmq</module>
2422
<module>hippo4j-adapter-web</module>
2523
</modules>

hippo4j-example/hippo4j-spring-boot-starter-adapter-kafka-example/pom.xml

-56
This file was deleted.

hippo4j-example/hippo4j-spring-boot-starter-adapter-kafka-example/src/main/java/cn/hippo4j/springboot/starter/adapter/kafka/example/ServerAdapterKafkaExampleApplication.java

-31
This file was deleted.

0 commit comments

Comments
 (0)