optimize code and fix sql in hippo4j-server (#782)

* init code for verify module

* init code for verify module

* create application for config modify in thread pool manage

* finish rejectModification

* finish rejectModification

* add todo

* finish threadPoolManage accept

* finish threadPoolManage accept

* finish threadPoolManage config verify

* formatting code

* optimize ConfigModifyVerifyService

* finish config modification verify

* finish config modification verify

* finish webConfig modification verify

* finish webConfig modification verify

* finish webConfig modification verify

* finish threadPoolInstanceConfig modification verify

* finish adapterThreadPoolConfig modification verify

* finish adapterThreadPoolConfig modification verify

* finish adapterThreadPoolConfig modification verify

* optmize ConfigVerifyController

* optmize ConfigVerifyController

* optmize ConfigVerifyController

* fix ConfigModifyVerifyReqDTO

* fix bug

* optimize verifyController

* optimize verifyController

* fix request param

* finish modify application query page

* finish modify application query page

* finish modify application query detail

* finish modify application query detail

* finish thread pool config modification verify module

* optimize accept modification logic

* formatting code

* fix bug

* formatting code

* formatting code

* update sql file

* add annotation

* add annotation and formatting code

* add annotation and formatting code

* remove useless code

* fix sql

* fix bug in web thread pool verify and adapter thread pool

* fix sql && update hippo4j.core.auth.enabled=true in server properties && optimize code in AdapterThreadPoolConfigModificationVerifyServiceImpl and WebThreadPoolConfigModificationVerifyServiceImpl

* fix sql && update hippo4j.core.auth.enabled=true in server properties && optimize code in AdapterThreadPoolConfigModificationVerifyServiceImpl and WebThreadPoolConfigModificationVerifyServiceImpl

* fix sql && update hippo4j.core.auth.enabled=true in server properties && optimize code in AdapterThreadPoolConfigModificationVerifyServiceImpl and WebThreadPoolConfigModificationVerifyServiceImpl

Co-authored-by: airoger <czzx201101136>
pull/784/head
shanjianq 2 years ago committed by GitHub
parent 65ae17241d
commit 3d3a5d4579
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -139,11 +139,8 @@ public class ThreadPoolAdapterService {
public static void remove(String identify) {
synchronized (ThreadPoolAdapterService.class) {
THREAD_POOL_ADAPTER_MAP.values().forEach(each -> each.forEach((key, val) ->
val.forEach((threadPoolKey, states) ->
states.removeIf(adapterState -> Objects.equals(adapterState.getIdentify(), identify))
)
));
THREAD_POOL_ADAPTER_MAP.values()
.forEach(each -> each.forEach((key, val) -> val.forEach((threadPoolKey, states) -> states.removeIf(adapterState -> Objects.equals(adapterState.getIdentify(), identify)))));
}
}

@ -46,7 +46,6 @@ public class AdapterThreadPoolConfigModificationVerifyServiceImpl extends Abstra
protected void updateThreadPoolParameter(ConfigModifyVerifyReqDTO reqDTO) {
for (String each : getClientAddress(reqDTO)) {
String urlString = StringUtil.newBuilder("http://", each, "/adapter/thread-pool/update");
RestTemplate restTemplate = new RestTemplate();
// again appoint MediaType
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(MediaType.APPLICATION_JSON);

@ -46,7 +46,6 @@ public class WebThreadPoolConfigModificationVerifyServiceImpl extends AbstractCo
protected void updateThreadPoolParameter(ConfigModifyVerifyReqDTO reqDTO) {
for (String each : getClientAddress(reqDTO)) {
String urlString = StringUtil.newBuilder("http://", each, "/web/update/pool");
RestTemplate restTemplate = new RestTemplate();
// again appoint MediaType
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(MediaType.APPLICATION_JSON);

@ -15,8 +15,8 @@ spring.dynamic.thread-pool.server-addr=http://localhost:6691
# spring.dynamic.thread-pool.netty-server-port=8899
spring.dynamic.thread-pool.namespace=prescription
spring.dynamic.thread-pool.item-id=dynamic-threadpool-example
#spring.dynamic.thread-pool.username=admin
#spring.dynamic.thread-pool.password=123456
spring.dynamic.thread-pool.username=admin
spring.dynamic.thread-pool.password=123456
# Enable server and micrometer monitoring at the same time
spring.dynamic.thread-pool.collect-type=server,micrometer

@ -21,7 +21,7 @@ hippo4j.core.clean-history-data-period=30
hippo4j.core.clean-history-data-enable=true
### Whether to enable authentication.
hippo4j.core.auth.enabled=false
hippo4j.core.auth.enabled=true
### Use netty to report thread pool monitoring data. The default is http.
# hippo4j.core.monitor.report-type=netty

@ -22,7 +22,7 @@ hippo4j.core.clean-history-data-period=30
hippo4j.core.clean-history-data-enable=true
### Whether to enable authentication.
hippo4j.core.auth.enabled=false
hippo4j.core.auth.enabled=true
### Initialize the database dialect class.
hippo4j.database.dialect=mysql

@ -201,8 +201,7 @@ CREATE TABLE IF NOT EXISTS `notify` (
-- ----------------------------
-- Table structure for his_config_verify
-- ----------------------------
DROP TABLE IF EXISTS `his_config_verify`;
CREATE TABLE `his_config_verify` (
CREATE TABLE IF NOT EXISTS `his_config_verify` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`type` int NULL DEFAULT NULL COMMENT '变更类型',
`mark` varchar(128) DEFAULT NULL COMMENT '框架线程池类型',

Loading…
Cancel
Save