Skip to content

Commit 27fc166

Browse files
committed
update new branch
1 parent 077559b commit 27fc166

File tree

797 files changed

+11394
-7442
lines changed

Some content is hidden

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

797 files changed

+11394
-7442
lines changed

build.gradle

Lines changed: 64 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,12 @@ def defaultEncoding = 'UTF-8'
3232
buildscript {
3333
repositories {
3434
mavenLocal()
35-
maven {
36-
url "http://maven.aliyun.com/nexus/content/groups/public/"
37-
}
38-
maven {
39-
url "http://maven.javastream.de/"
40-
}
41-
// mavenCentral()
35+
mavenCentral()
4236
}
4337

4438
dependencies {
4539
classpath 'net.sf.proguard:proguard-gradle:6.2.0'
46-
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.7.17'
40+
// classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.5.15.RELEASE'
4741
}
4842
}
4943

@@ -53,23 +47,18 @@ dependencies {
5347

5448
repositories {
5549
mavenLocal()
56-
maven {
57-
url "http://maven.aliyun.com/nexus/content/groups/public/"
58-
}
59-
maven {
60-
url "http://maven.javastream.de/"
61-
}
50+
mavenCentral()
6251
}
6352

6453
mainClassName = "com.webank.wedatasphere.qualitis.QualitisServer"
6554

6655
applicationDefaultJvmArgs =
67-
["-Xms256M", "-Xmx2G",
56+
["-javaagent:/data/app/weapm-agent/5375/weapm-agent-starter.jar", "-Xms256M", "-Xmx2G",
6857
"-XX:+UseG1GC", "-XX:MaxGCPauseMillis=20", "-XX:InitiatingHeapOccupancyPercent=50",
6958
"-Dfile.encoding=UTF-8", "-Djava.library.path=HADOOP_COMMON_LIB_NATIVE_DIR",
7059
"-Dlog.file=${project.name}-MY_USER-MY_HOSTNAME.log",
7160
"-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/appcom/logs/qualitis/heapdump.hprof",
72-
"-Dspring.config.location=classpath:application.yml"]
61+
"-Dspring.config.location=classpath:sdk.properties,classpath:rmb-client.properties,classpath:weservice.properties,classpath:application.yml"]
7362

7463
tasks.startScripts << {
7564
def scriptFile = file "${outputDir}/${applicationName}"
@@ -78,7 +67,7 @@ tasks.startScripts << {
7867
scriptFile.eachLine {
7968
line ->
8069
if (line.contains('CLASSPATH=\$APP_HOME/lib')) {
81-
scriptFile.text = scriptFile.text.replace(line, "CLASSPATH=\${YOUR_CONF_DIR:-\$APP_HOME/conf}:\${APP_HOME}/lib/*")
70+
scriptFile.text = scriptFile.text.replace(line, "CLASSPATH=/appcom/config/qualitis-config:\${APP_HOME}/lib/*")
8271
return
8372
}
8473
}
@@ -89,6 +78,53 @@ tasks.startScripts << {
8978

9079
// custom 'java.library.path'
9180
unixScript.text = unixScript.text.replace("HADOOP_COMMON_LIB_NATIVE_DIR", '\${HADOOP_COMMON_LIB_NATIVE_DIR}')
81+
82+
unixScript.text = unixScript.text.replace('MAX_FD="maximum"', '''\
83+
# 根据外部传参weapmEnabled判断是否移除挂载WeAPM
84+
weapmEnabled=$1
85+
if [ "${weapmEnabled}x" != "1x" ]; then
86+
# 将DEFAULT_JVM_OPTS转换为数组
87+
IFS=' ' read -r -a JVM_OPTS_ARRAY <<< "${DEFAULT_JVM_OPTS}"
88+
89+
# 遍历数组,查找并移除-javaagent参数
90+
UPDATED_JVM_OPTS=()
91+
for opt in "${JVM_OPTS_ARRAY[@]}"; do
92+
if [[ $opt != *-javaagent* ]]; then
93+
# 保留其他参数
94+
UPDATED_JVM_OPTS+=("$opt")
95+
fi
96+
done
97+
98+
# 重新组合数组为字符串
99+
DEFAULT_JVM_OPTS=$(IFS=' '; echo "${UPDATED_JVM_OPTS[*]}")
100+
101+
# 输出新的DEFAULT_JVM_OPTS
102+
echo "Updated DEFAULT_JVM_OPTS: $DEFAULT_JVM_OPTS"
103+
fi
104+
105+
# 如果是生产环境,则将堆内存修改为实时读取部署机器内存
106+
envName=$2
107+
if [ "${envName}x" = "prodx" ]; then
108+
IFS=' ' read -r -a JVM_OPTS_ARRAY <<< "${DEFAULT_JVM_OPTS}"
109+
110+
UPDATED_JVM_OPTS=()
111+
for opt in "${JVM_OPTS_ARRAY[@]}"; do
112+
if [[ $opt = *-Xms* ]]; then
113+
UPDATED_JVM_OPTS+=("-Xms$3")
114+
elif [[ $opt = *-Xmx* ]]; then
115+
UPDATED_JVM_OPTS+=("-Xmx$4")
116+
else
117+
UPDATED_JVM_OPTS+=("$opt")
118+
fi
119+
done
120+
121+
# 重新组合数组为字符串
122+
DEFAULT_JVM_OPTS=$(IFS=' '; echo "${UPDATED_JVM_OPTS[*]}")
123+
echo "Updated DEFAULT_JVM_OPTS: $DEFAULT_JVM_OPTS"
124+
fi
125+
126+
MAX_FD="maximum"
127+
''')
92128
}
93129

94130
distributions {
@@ -109,10 +145,17 @@ distributions {
109145
}
110146
def timestamp = new Date().format("yyyyMMddHHmmss")
111147
def projectVersion = project.property("version")
112-
def finalArchiveName = "WDSDQMS-CORE_${projectVersion}_0_R_${timestamp}.zip"
148+
def finalArchiveName = "WDSDQMS-CORE_${projectVersion}_0_R_${timestamp}"
149+
def suffix = ".zip"
113150

114151
distZip {
115-
archiveName = finalArchiveName
152+
archiveName = "${finalArchiveName}${suffix}"
153+
eachFile { file ->
154+
String path = file.relativePath
155+
file.setPath(path.replaceFirst("^${finalArchiveName}/", "qualitis_pkg/"))
156+
}
157+
158+
includeEmptyDirs = false
116159
}
117160

118161
subprojects {
@@ -142,12 +185,7 @@ subprojects {
142185

143186
repositories {
144187
mavenLocal()
145-
maven {
146-
url "http://maven.aliyun.com/nexus/content/groups/public/"
147-
}
148-
maven {
149-
url "http://maven.javastream.de/"
150-
}
188+
mavenCentral()
151189
}
152190

153191
processResources {
@@ -166,19 +204,16 @@ subprojects {
166204
configurations.all {
167205
resolutionStrategy {
168206
force 'org.apache.logging.log4j:log4j-slf4j2-impl:2.24.0'
169-
force 'org.apache.logging.log4j:log4j-api:2.24.0'
170-
force 'org.apache.logging.log4j:log4j-core:2.24.0'
171207
force 'org.apache.derby:derby:10.17.1.0'
172208
force 'org.slf4j:slf4j-api:2.0.11'
173209
}
174210
resolutionStrategy.cacheChangingModulesFor 60,'seconds'
175-
// exclude group: 'log4j', module: 'log4j'
211+
exclude group: 'log4j', module: 'log4j'
176212
exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
177213
exclude group: 'org.codehaus.jackson', module: 'jackson-mapper-asl'
178214
exclude group: 'com.zaxxer', module: 'HikariCP-java7'
179215
exclude group: 'org.apache.poi', module: 'poi-ooxml-schemas'
180216
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15to18'
181-
exclude group: 'javax.servlet', module: 'javax.servlet-api'
182217
}
183218

184219
apply from: "profile.gradle"

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/client/MailClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.webank.wedatasphere.qualitis.client;
22

33
/**
4-
4+
* @author
55
*/
66
public interface MailClient {
77

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/client/impl/EsbMailClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import java.util.zip.GZIPInputStream;
3636

3737
/**
38-
38+
* @author
3939
*/
4040
@Component
4141
public class EsbMailClient implements MailClient {
@@ -95,7 +95,7 @@ public void sendEsbMail(String result, String createUser) throws Exception {
9595
esbMailRecord.setAssemblyResult(result);
9696
esbMailRecord.setCreateTime(simpleDateFormat.format(new Date()));
9797
esbMailRecord.setCreateUser(createUser);
98-
// esbMailRecordDao.save(esbMailRecord);
98+
esbMailRecordDao.save(esbMailRecord);
9999
LOGGER.info(">>>>>>>>>> Esb Mail Record Object :<<<<<<<<<< : " + esbMailRecord.toString());
100100
}
101101

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/client/impl/ImsAlarmClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ImsAlarmClient implements AlarmClient {
4141
@Override
4242
public void sendAlarm(String receiver, String alertTitle, String alertInfo, String alertLevel, String subSystemId) {
4343
if (overseasVersionEnabled){
44-
LOGGER.info("skip send ims alarm.");
44+
LOGGER.info("[overseasVersion] skip send ims alarm.");
4545
return;
4646
}
4747
String url = imsConfig.getUrl() + imsConfig.getSendAlarmPath();

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/config/EsbSdkConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.springframework.context.annotation.Configuration;
55

66
/**
7-
7+
* @author
88
*/
99
@Configuration
1010
public class EsbSdkConfig {

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/config/OperateCiConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.springframework.context.annotation.Configuration;
55

66
/**
7-
7+
* @author
88
*/
99
@Configuration
1010
public class OperateCiConfig {

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/constant/AlertWayEnum.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.webank.wedatasphere.qualitis.constant;
22

33
/**
4-
4+
* @author
55
* @date 2024-03-20 16:11
66
* @description
77
*/

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/constant/MailConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.webank.wedatasphere.qualitis.constant;
22

33
/**
4-
4+
* @author
55
*/
66
public class MailConstants {
77

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/dao/EsbMailRecordDao.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.webank.wedatasphere.qualitis.entity.EsbMailRecord;
44

55
/**
6-
6+
* @author
77
*/
88
public interface EsbMailRecordDao {
99

@@ -13,13 +13,13 @@ public interface EsbMailRecordDao {
1313
* @param esbMailRecord
1414
* @return
1515
*/
16-
// EsbMailRecord save(EsbMailRecord esbMailRecord);
16+
EsbMailRecord save(EsbMailRecord esbMailRecord);
1717

1818
/**
1919
* find by id
2020
*
2121
* @param esbMailRecordId
2222
* @return
2323
*/
24-
// EsbMailRecord findById(Long esbMailRecordId);
24+
EsbMailRecord findById(Long esbMailRecordId);
2525
}

core/alarm/src/main/java/com/webank/wedatasphere/qualitis/dao/MailLockRecordDao.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.util.Date;
66

77
/**
8-
8+
* @author
99
*/
1010
public interface MailLockRecordDao {
1111

@@ -15,7 +15,7 @@ public interface MailLockRecordDao {
1515
* @param mailLockRecord
1616
* @return
1717
*/
18-
// MailLockRecord save(MailLockRecord mailLockRecord);
18+
MailLockRecord save(MailLockRecord mailLockRecord);
1919

2020
/**
2121
* Find with unique keys(status, upload date).
@@ -25,5 +25,5 @@ public interface MailLockRecordDao {
2525
* @param executionFrequency
2626
* @return
2727
*/
28-
// MailLockRecord findByUnique(Date recordDate, Boolean status, Integer executionFrequency);
28+
MailLockRecord findByUnique(Date recordDate, Boolean status, Integer executionFrequency);
2929
}

0 commit comments

Comments
 (0)