Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update the package path of the startup class #484

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
*/
@Slf4j
@SpringBootApplication
@DubboComponentScan(basePackages = "com.xiaomi.mone.app")
@MapperScan("com.xiaomi.mone.app.dao")
@DubboComponentScan(basePackages = "org.apache.ozhera.app")
@MapperScan("org.apache.ozhera.app.dao")
@EnableScheduling
public class AppBootstrap {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
@Slf4j
public class OperateAppBaseInfoAspect {

private final String appGetResultDataPoint = "execution(* com.xiaomi.mone.app.service.impl.HeraAppBaseInfoServiceImpl.appBaseInfoOperate(..))";
private final String appGetResultDataPoint = "execution(* org.apache.ozhera.app.service.impl.HeraAppBaseInfoServiceImpl.appBaseInfoOperate(..))";

@Value("${rocket.mq.hera.app.topic}")
private String topic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @date 2022/10/29 13:27
*/
@Slf4j
@RestControllerAdvice(basePackages = "com.xiaomi.mone.app.controller")
@RestControllerAdvice(basePackages = "org.apache.ozhera.app.controller")
public class AppExceptionControllerAdvice {

@ExceptionHandler(value = MethodArgumentNotValidException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spring.datasource.default.maxPoolSize=20
spring.datasource.default.minialPoolSize=10

mybatis-plus.mapper-locations=classpath:mapper/*.xml
mybatis-plus.type-aliases-package=com.xiaomi.mone.app.model
mybatis-plus.type-aliases-package=org.apache.ozhera.app.model
mybatis-plus.configuration.map-underscore-to-camel-case=true
mybatis-plus.global-config.db-config.id-type=auto
#mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* @author dingtao
*/
@EnableAutoConfiguration(exclude= {DataSourceAutoConfiguration.class})
@ComponentScan(basePackages = {"com.xiaomi.mone.hera.demo.client"})
@DubboComponentScan(basePackages = "com.xiaomi.mone.hera.demo.client")
@ComponentScan(basePackages = {"org.apache.ozhera.demo.client"})
@DubboComponentScan(basePackages = "org.apache.ozhera.demo.client")
@Slf4j
public class HeraDemoClientBootstrap {

Expand Down
2 changes: 1 addition & 1 deletion ozhera-demo-client/ozhera-demo-client-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</dependency>

<dependency>
<groupId>run.mone</groupId>
<groupId>org.apache.ozhera</groupId>
<artifactId>ozhera-demo-server-api</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class DubboHealthServiceImpl implements DubboHealthService {

@Reference(group = "${dubbo.group}",version = "1.0",timeout = 3000,retries = 0,check = false)
private com.xiaomi.mone.hera.demo.server.service.DubboHealthService dubboHealthService;
private org.apache.ozhera.demo.server.service.DubboHealthService dubboHealthService;

@Override
public int remoteHealth(int size) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
*/
@Slf4j
@SpringBootApplication
@ComponentScan(basePackages = {"com.xiaomi.mone.hera.demo.server"})
@DubboComponentScan(basePackages = {"com.xiaomi.mone.hera.demo.server"})
@DubboComponentScan(basePackages = {"org.apache.ozhera.demo.server"})
public class HeraDemoServerBootstrap {
public static void main(String... args) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.springframework.context.annotation.ComponentScan;

@EnableAutoConfiguration
@ComponentScan(basePackages = {"run.mone.hera.intelligence"})
@ComponentScan(basePackages = {"org.apache.ozhera.intelligence"})
@Slf4j
public class IntelligenceBootStrap {
public static void main(String... args) {
Expand Down
2 changes: 1 addition & 1 deletion ozhera-intelligence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<maven.compiler.target>21</maven.compiler.target>
<spring.version>5.3.29</spring.version>
<trace.etl.domain.version>1.0.1-jdk21</trace.etl.domain.version>
<ozhera.intelligence.version>1.0.0</ozhera.intelligence.version>
<ozhera.intelligence.version>2.0.0-SNAPSHOT</ozhera.intelligence.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Replace it with the absolute path of your own trace-etl project. issue#19-->
<maven.jcommonDirectory>~</maven.jcommonDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import com.xiaomi.data.push.rpc.RpcCmd;
import com.xiaomi.data.push.rpc.RpcServer;
import com.xiaomi.data.push.rpc.common.Pair;
import com.xiaomi.youpin.docean.Ioc;
import lombok.extern.slf4j.Slf4j;
import org.apache.ozhera.log.common.Config;
import org.apache.ozhera.log.common.Constant;
import org.apache.ozhera.log.server.porcessor.AgentCollectProgressProcessor;
import org.apache.ozhera.log.server.porcessor.AgentConfigProcessor;
import org.apache.ozhera.log.server.porcessor.PingProcessor;
import com.xiaomi.youpin.docean.Ioc;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

Expand Down Expand Up @@ -56,7 +56,7 @@ public static void main(String[] args) throws IOException {
rpcServer.start();

Ioc.ins().putBean(rpcServer);
Ioc.ins().init("com.xiaomi.mone", "com.xiaomi.youpin");
Ioc.ins().init("com.xiaomi.mone", "com.xiaomi.youpin", "org.apache.ozhera.log.server");
log.info("log server start finish");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static void main(String[] args) throws IOException {
client.waitStarted();
log.info("create rpc client finish");
Aop.ins().init(Maps.newLinkedHashMap());
Ioc.ins().putBean(client).init("com.xiaomi.mone.log.agent", "com.xiaomi.youpin.docean");
Ioc.ins().putBean(client).init("org.apache.ozhera.log.agent", "com.xiaomi.youpin.docean");
//Because the client life cycle is advanced, the processor needs to be re-registered here
client.registerProcessor();
System.in.read();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
*/
package org.apache.ozhera.log.agent.channel;

import cn.hutool.core.io.FileUtil;
import com.xiaomi.mone.file.ReadResult;
import com.xiaomi.mone.file.common.FileInfoCache;
import lombok.extern.slf4j.Slf4j;
import org.apache.ozhera.log.agent.channel.memory.ChannelMemory;
import org.apache.ozhera.log.agent.common.ChannelUtil;
import org.apache.ozhera.log.agent.input.Input;
import org.apache.ozhera.log.api.enums.LogTypeEnum;
import org.apache.ozhera.log.api.model.meta.LogPattern;
import org.apache.ozhera.log.api.model.msg.LineMessage;
import org.apache.ozhera.log.utils.NetUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -152,7 +153,7 @@ private Map<String, ChannelMemory.FileProgress> buildFileProgressMap(List<String
protected static void wildcardGraceShutdown(List<String> directory, String matchExpress) {
// Add a shutdown hook to gracefully shutdown FileInfoCache
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
log.info("wildcardGraceShutdown Shutdown,directory:{},express:{}", GSON.toJson(directory), matchExpress);
log.info("wildcardGraceShutdown Shutdown,directory:{},express:{},cacheSize:{}", GSON.toJson(directory), matchExpress, FileInfoCache.ins().caches().size());
FileInfoCache.ins().shutdown();
}));
}
Expand Down Expand Up @@ -192,7 +193,9 @@ protected void updateChannelMemory(ChannelMemory channelMemory, String fileName,
if (null != readResult.get().getFileMaxPointer()) {
fileProgress.setFileMaxPointer(readResult.get().getFileMaxPointer());
}
fileProgress.setUnixFileNode(ChannelUtil.buildUnixFileNode(fileName));
if (FileUtil.exist(fileName)) {
fileProgress.setUnixFileNode(ChannelUtil.buildUnixFileNode(fileName));
}
fileProgress.setPodType(channelDefine.getPodType());
fileProgress.setCtTime(ct);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package org.apache.ozhera.log.manager.bootstrap;

import org.apache.ozhera.log.common.Config;
import org.apache.ozhera.log.manager.controller.interceptor.HttpRequestInterceptor;
import com.xiaomi.youpin.docean.Aop;
import com.xiaomi.youpin.docean.Ioc;
import com.xiaomi.youpin.docean.anno.RequestMapping;
Expand All @@ -25,6 +23,8 @@
import com.xiaomi.youpin.docean.config.HttpServerConfig;
import com.xiaomi.youpin.docean.mvc.DoceanHttpServer;
import lombok.extern.slf4j.Slf4j;
import org.apache.ozhera.log.common.Config;
import org.apache.ozhera.log.manager.controller.interceptor.HttpRequestInterceptor;

import java.util.LinkedHashMap;

Expand All @@ -45,7 +45,7 @@ public static void main(String[] args) throws InterruptedException {
Aop.ins().init(m);

Ioc.ins().putBean(Cons.AUTO_FIND_IMPL, "true")
.init("com.xiaomi.mone", "com.xiaomi.youpin");
.init("com.xiaomi.mone", "com.xiaomi.youpin", "org.apache.ozhera.log.manager");
Config ins = Config.ins();

int port = Integer.parseInt(ins.get("serverPort", ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void main(String[] args) {
private static void initializeApplication() {
OkHttpClient okHttpClient = getOkHttpClient();
Ioc.ins().putBean(okHttpClient)
.init("com.xiaomi.mone.log.stream", "com.xiaomi.youpin.docean");
.init("org.apache.ozhera.log.stream", "com.xiaomi.youpin.docean");
}

private static void startHealthCheckTask() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

@Slf4j
@EnableAutoConfiguration
@ComponentScan(basePackages = {"com.xiaomi.mone.monitor"})
@DubboComponentScan(basePackages = "com.xiaomi.mone.monitor")
@ServletComponentScan("com.xiaomi.mone.monitor.filter")
@ComponentScan(basePackages = {"org.apache.ozhera.monitor"})
@DubboComponentScan(basePackages = "org.apache.ozhera.monitor")
@ServletComponentScan("org.apache.ozhera.monitor.filter")
public class MiMonitorBootstrap {

public static void main(String[] args) throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class HeraBootstrap {

public static void main(String[] args) throws InterruptedException {
Ioc.ins().init("run.mone.docean.plugin","com.xiaomi.youpin.docean.plugin","run.mone.hera.operator");
Ioc.ins().init("run.mone.docean.plugin","com.xiaomi.youpin.docean.plugin","org.apache.ozhera.operator");
//Mvc.ins();
Mvc.ins().getMvcConfig().setResponseOriginalValue(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
* @author dingtao
*/
@EnableAutoConfiguration
@ComponentScan(basePackages = {"com.xiaomi.youpin.prometheus.agent", "com.xiaomi.youpin"})
@DubboComponentScan(basePackages = "com.xiaomi.youpin.prometheus.agent")
@ComponentScan(basePackages = {"org.apache.ozhera.prometheus.agent", "com.xiaomi.youpin"})
@DubboComponentScan(basePackages = "org.apache.ozhera.prometheus.agent")
@Slf4j
public class PrometheusAgentBootstrap {
private static final Logger logger = LoggerFactory.getLogger(PrometheusAgentBootstrap.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author dingtao
*/
@EnableAutoConfiguration
@ComponentScan(basePackages = {"run.mone.hera.webhook"})
@ComponentScan(basePackages = {"org.apache.ozhera.webhook"})
@Slf4j
public class Bootstrap {

Expand Down
2 changes: 1 addition & 1 deletion prometheus-starter-all/prometheus-diy-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>org.apache.ozhera</groupId>
<artifactId>prometheus-diy-client</artifactId>
<version>0.0.1-opensource-jdk21</version>
<version>${prometheus-all.version}</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
* @author dingtao
*/
@EnableAutoConfiguration
@ComponentScan(basePackages = {"com.xiaomi.hera.trace.etl", "com.xiaomi.data.push.redis", "run.mone.trace.etl"})
@DubboComponentScan(basePackages = "com.xiaomi.hera.trace.etl.es.dubbo")
@MapperScan("com.xiaomi.hera.trace.etl.mapper")
@ComponentScan(basePackages = {"org.apache.ozhera.trace.etl.es", "com.xiaomi.data.push.redis", "run.mone.trace.etl"})
@DubboComponentScan(basePackages = "org.apache.ozhera.trace.etl.es.dubbo")
@MapperScan("org.apache.ozhera.trace.etl.mapper")
@Slf4j
public class TraceEtlEsBootstrap {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
* @author dingtao
*/
@EnableAutoConfiguration
@ComponentScan(basePackages = {"com.xiaomi.hera.trace.etl", "run.mone.trace.etl"})
@DubboComponentScan(basePackages = "com.xiaomi.hera.trace.etl")
@MapperScan("com.xiaomi.hera.trace.etl.mapper")
@ComponentScan(basePackages = {"org.apache.ozhera.trace.etl", "run.mone.trace.etl"})
@DubboComponentScan(basePackages = "org.apache.ozhera.trace.etl")
@MapperScan("org.apache.ozhera.trace.etl.mapper")
public class TraceEtlManagerBootstrap {

public static void main(String... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author dingtao
*/
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@ComponentScan(basePackages = {"com.xiaomi.hera.trace.etl.nginx"})
@ComponentScan(basePackages = {"org.apache.ozhera.trace.etl.nginx"})
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
@Slf4j
public class TraceEtlNginxBootstrap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
* @author dingtao
*/
@EnableAutoConfiguration
@ComponentScan(basePackages = {"com.xiaomi.hera.trace.etl", "com.xiaomi.data.push.redis", "run.mone.trace.etl"})
@DubboComponentScan(basePackages = "com.xiaomi.hera.trace.etl.dubbo")
@MapperScan("com.xiaomi.hera.trace.etl.mapper")
@ComponentScan(basePackages = {"org.apache.ozhera.trace.etl", "com.xiaomi.data.push.redis", "run.mone.trace.etl"})
@DubboComponentScan(basePackages = "org.apache.ozhera.trace.etl.dubbo")
@MapperScan("org.apache.ozhera.trace.etl.mapper")
@Slf4j
public class TraceEtlBootstrap {

Expand Down
Loading