Skip to content

Commit a85a154

Browse files
authored
fix: Fix the Apache file header. (#667)
* fix: Addressing issues that arise during release deployment * fix: add apache header
1 parent 43f1294 commit a85a154

11 files changed

Lines changed: 123 additions & 80 deletions

File tree

.github/workflows/ozhera-demo-client-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444

4545
- run: echo '<settings> <interactiveMode>false</interactiveMode> <profiles> <profile> <repositories> <repository> <snapshots /> <id>ossrh</id> <name>ossrh-snapshot</name> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <snapshots /> <id>ossrh</id> <name>ossrh-snapshot</name> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </pluginRepository> </pluginRepositories> <id>artifactory</id> </profile> </profiles> <activeProfiles> <activeProfile>artifactory</activeProfile> </activeProfiles> <servers> <server> <id>github</id> <username>${env.GITHUB_ACTOR}</username> <password>${env.GITHUB_TOKEN}</password> </server> </servers> <mirrors/> <proxies/></settings>' > ~/.m2/settings.xml
4646

47-
- run: cd ozhera-demo-client; mvn -U clean package
47+
- run: mvn -U clean install -pl ozhera-demo-server/ozhera-demo-server-api -am -DskipTests && cd ozhera-demo-client && mvn -U clean package

.github/workflows/ozhera-intelligence-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444

4545
- run: echo '<settings> <interactiveMode>false</interactiveMode> <profiles> <profile> <repositories> <repository> <snapshots /> <id>ossrh</id> <name>ossrh-snapshot</name> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <snapshots /> <id>ossrh</id> <name>ossrh-snapshot</name> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </pluginRepository> </pluginRepositories> <id>artifactory</id> </profile> </profiles> <activeProfiles> <activeProfile>artifactory</activeProfile> </activeProfiles> <servers> <server> <id>github</id> <username>${env.GITHUB_ACTOR}</username> <password>${env.GITHUB_TOKEN}</password> </server> </servers> <mirrors/> <proxies/></settings>' > ~/.m2/settings.xml
4646

47-
- run: cd ozhera-intelligence; mvn -U clean package
47+
- run: mvn -U clean install -pl trace-etl/trace-etl-domain -am -DskipTests && cd ozhera-intelligence && mvn -U clean package

ozhera-log/log-agent-server/src/main/java/org/apache/ozhera/log/server/porcessor/AgentCollectProgressProcessor.java

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import cn.hutool.json.JSONUtil;
2222
import com.google.common.util.concurrent.RateLimiter;
23-
import com.xiaomi.data.push.rpc.common.CompressionUtil;
2423
import com.xiaomi.data.push.rpc.netty.NettyRequestProcessor;
2524
import com.xiaomi.data.push.rpc.protocol.RemotingCommand;
2625
import com.xiaomi.youpin.docean.Ioc;
@@ -88,32 +87,20 @@ public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand
8887
* try to parse the request body
8988
*/
9089
private UpdateLogProcessCmd parseRequestBody(byte[] bodyBytes, ChannelHandlerContext ctx) {
91-
String bodyStr = null;
92-
93-
try {
94-
bodyStr = new String(bodyBytes, StandardCharsets.UTF_8);
95-
if (JSONUtil.isTypeJSON(bodyStr)) {
96-
UpdateLogProcessCmd cmd = GSON.fromJson(bodyStr, UpdateLogProcessCmd.class);
97-
if (StringUtils.isBlank(cmd.getIp())) {
98-
log.warn("Invalid agent request, ip={}, body={}", getIp(ctx), brief(bodyStr));
99-
return null;
100-
}
101-
log.debug("Parsed request from agent: ip={}", cmd.getIp());
102-
return cmd;
103-
}
104-
} catch (Exception ignored) {
105-
}
90+
String bodyStr = new String(bodyBytes, StandardCharsets.UTF_8);
10691
try {
107-
bodyStr = new String(CompressionUtil.decompress(bodyBytes), StandardCharsets.UTF_8);
10892
if (!JSONUtil.isTypeJSON(bodyStr)) {
10993
log.warn("Invalid agent request, ip={}, body={}", getIp(ctx), brief(bodyStr));
11094
return null;
11195
}
11296
UpdateLogProcessCmd cmd = GSON.fromJson(bodyStr, UpdateLogProcessCmd.class);
113-
log.debug("Parsed decompressed request from agent: ip={}", cmd.getIp());
97+
if (StringUtils.isBlank(cmd.getIp())) {
98+
log.warn("Invalid agent request, ip={}, body={}", getIp(ctx), brief(bodyStr));
99+
return null;
100+
}
101+
log.debug("Parsed request from agent: ip={}", cmd.getIp());
114102
return cmd;
115103
} catch (Exception e) {
116-
assert bodyStr != null;
117104
log.error("processRequest error, ip={}, body={}", getIp(ctx), brief(bodyStr), e);
118105
return null;
119106
}

ozhera-log/log-agent-server/src/main/java/org/apache/ozhera/log/server/service/DefaultPublishConfigService.java

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545

4646
import static org.apache.ozhera.log.common.Constant.GSON;
4747
import static org.apache.ozhera.log.common.Constant.SYMBOL_COLON;
48-
import static org.apache.ozhera.log.server.common.Utils.getConfig;
4948

5049
/**
5150
* @author wtt
@@ -61,13 +60,6 @@ public class DefaultPublishConfigService implements PublishConfigService {
6160
@Resource
6261
private RpcServer rpcServer;
6362

64-
private static final String CONFIG_COMPRESS_KEY = "CONFIG_COMPRESS_ENABLED";
65-
private static final String CONFIG_COMPRESS_MACHINE_KEY = "CONFIG_COMPRESS_MACHINE";
66-
67-
private volatile boolean configCompressValue = false;
68-
69-
private volatile String configCompressMachine;
70-
7163
private final Random random = new Random();
7264

7365
private static final ExecutorService SEND_CONFIG_EXECUTOR;
@@ -110,20 +102,6 @@ public Long load(String key) {
110102
);
111103
}
112104

113-
public void init() {
114-
String compressRaw = getConfig(CONFIG_COMPRESS_KEY);
115-
configCompressMachine = getConfig(CONFIG_COMPRESS_MACHINE_KEY);
116-
log.info("init configCompressValue {},configCompressMachine {}", configCompressValue, configCompressMachine);
117-
if (StringUtils.isNotBlank(compressRaw)) {
118-
try {
119-
configCompressValue = Boolean.parseBoolean(compressRaw);
120-
log.info("configCompressValue {},configCompressMachine{}", configCompressValue, configCompressMachine);
121-
} catch (Exception e) {
122-
log.error("parse {} error,use default value:{},config value:{}", CONFIG_COMPRESS_KEY, configCompressValue, compressRaw);
123-
}
124-
}
125-
}
126-
127105
/**
128106
* dubbo interface, the timeout period cannot be too long
129107
*
@@ -164,13 +142,6 @@ private void doSendConfigSync(String agentIp, LogCollectMeta meta) {
164142
RemotingCommand req = RemotingCommand.createRequestCommand(LogCmd.LOG_REQ);
165143
req.setBody(sendStr.getBytes());
166144

167-
if (configCompressValue || (StringUtils.isNotBlank(configCompressMachine) &&
168-
StringUtils.isNotBlank(meta.getAgentMachine()) &&
169-
configCompressMachine.contains(meta.getAgentMachine()))) {
170-
req.enableCompression();
171-
log.info("The configuration is compressed,agent ip:{},Configuration information:{}", agentCurrentIp, sendStr);
172-
}
173-
174145
log.info("Send the configuration,agent ip:{},Configuration information:{}", agentCurrentIp, sendStr);
175146
Stopwatch started = Stopwatch.createStarted();
176147
RemotingCommand res = rpcServer.sendMessage(logAgentMap.get(agentCurrentIp), req, 10000);
@@ -301,13 +272,6 @@ private CompletableFuture<Boolean> trySendOnce(String agentIp,
301272
RemotingCommand req = RemotingCommand.createRequestCommand(LogCmd.LOG_REQ);
302273
req.setBody(sendStr.getBytes());
303274

304-
if (configCompressValue || (StringUtils.isNotBlank(configCompressMachine) &&
305-
StringUtils.isNotBlank(meta.getAgentMachine()) &&
306-
configCompressMachine.contains(meta.getAgentMachine()))) {
307-
req.enableCompression();
308-
log.info("The configuration is compressed,agent ip:{},Configuration information:{}", agentCurrentIp, sendStr);
309-
}
310-
311275
Stopwatch started = Stopwatch.createStarted();
312276

313277
log.info("Send the configuration asynchronously,agent ip:{},Configuration information:{}", agentCurrentIp, sendStr);
@@ -317,7 +281,7 @@ private CompletableFuture<Boolean> trySendOnce(String agentIp,
317281
try {
318282

319283
rpcServer.send(
320-
logAgentMap.get(agentCurrentIp).getChannel(),
284+
agentCurrentIp,
321285
req,
322286
10000,
323287
response -> {

ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/channel/ChannelEngine.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,8 @@ public class ChannelEngine {
101101

102102
private static final String PROGRESS_ENV_KEY = "CHANNEL_STATE_PERIOD_SECONDS";
103103

104-
private static final String COMPRESS_KEY = "CHANNEL_STATE_COMPRESS_ENABLED";
105-
106104
private static final long DEFAULT_PERIOD_SECONDS = 10L;
107105

108-
private volatile boolean progressCompressValue = false;
109-
110106
@Getter
111107
private volatile boolean initComplete;
112108

@@ -153,26 +149,13 @@ public void init() {
153149
log.info("current channelDefineList:{},current channelServiceList:{}", gson.toJson(this.channelDefineList), gson.toJson(this.channelServiceList.stream().map(ChannelService::instanceId).collect(Collectors.toList())));
154150
monitorFilesClean();
155151
executorFileClean();
156-
resolveCompressEnabled();
157152
} catch (Exception e) {
158153
log.error("ChannelEngine init exception", e);
159154
} finally {
160155
initComplete = true;
161156
}
162157
}
163158

164-
private void resolveCompressEnabled() {
165-
String raw = ChannelUtil.getConfig(COMPRESS_KEY, config);
166-
if (StringUtils.isNotBlank(raw)) {
167-
try {
168-
progressCompressValue = Boolean.parseBoolean(raw);
169-
log.info("progressCompressValue {}", progressCompressValue);
170-
} catch (Exception e) {
171-
log.error("parse {} error,use default value:{},config value:{}", COMPRESS_KEY, progressCompressValue, raw);
172-
}
173-
}
174-
}
175-
176159
/**
177160
* Thread pool cleaning, many wasted files don't need to keep wasting threads, they should be cleaned up directly.
178161
*/
@@ -680,11 +663,6 @@ private void sendCollectionProgress(List<ChannelState> channelStateList) {
680663
RpcClient rpcClient = Ioc.ins().getBean(RpcClient.class);
681664
RemotingCommand req = RemotingCommand.createRequestCommand(Constant.RPCCMD_AGENT_CODE);
682665

683-
if (progressCompressValue) {
684-
// enable collection progress compression
685-
req.enableCompression();
686-
}
687-
688666
req.setBody(GSON.toJson(processCmd).getBytes());
689667
rpcClient.sendToAllMessage(req);
690668
log.debug("send collect progress,data:{}", gson.toJson(processCmd));

ozhera-log/log-agent/src/test/java/org/apache/ozhera/log/agent/channel/listener/InodeChangeDetectionTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
package org.apache.ozhera.log.agent.channel.listener;
221

322
import org.apache.ozhera.log.agent.channel.AbstractChannelService;

ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/model/dto/LogAiAnalysisDTO.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
package org.apache.ozhera.log.manager.model.dto;
221

322
import lombok.Data;

ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/model/vo/LogAiAnalysisResponse.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
package org.apache.ozhera.log.manager.model.vo;
221

322
import lombok.Data;

ozhera-metrics-all/ozhera-metrics-sdk-config/src/main/java/org/apache/ozhera/metrics/config/LogFileNameUtil.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
package org.apache.ozhera.metrics.config;
221

322
/**

ozhera-metrics-all/ozhera-metrics-sdk-config/src/main/java/org/apache/ozhera/metrics/config/PromEnvEnum.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
package org.apache.ozhera.metrics.config;
221

322
public enum PromEnvEnum {

0 commit comments

Comments
 (0)