forked from apache/eventmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
880 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...esh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/AdminGrpcServer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...esh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/DBThreadPool.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.apache.eventmesh.admin.server.web.db; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.eventmesh.common.EventMeshThreadFactory; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.PreDestroy; | ||
import java.util.concurrent.LinkedBlockingQueue; | ||
import java.util.concurrent.ThreadPoolExecutor; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Component | ||
@Slf4j | ||
public class DBThreadPool { | ||
private final ThreadPoolExecutor executor = | ||
new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors() * 2, | ||
Runtime.getRuntime().availableProcessors() * 2, 0L, TimeUnit.SECONDS, | ||
new LinkedBlockingQueue<>(1000), new EventMeshThreadFactory("admin-server-db"), | ||
new ThreadPoolExecutor.DiscardOldestPolicy()); | ||
@PreDestroy | ||
private void destroy() { | ||
if (!executor.isShutdown()) { | ||
try { | ||
executor.shutdown(); | ||
if (!executor.awaitTermination(30, TimeUnit.SECONDS)) { | ||
log.info("wait heart beat handler thread pool shutdown timeout, it will shutdown immediately"); | ||
executor.shutdownNow(); | ||
} | ||
} catch (InterruptedException e) { | ||
log.warn("wait heart beat handler thread pool shutdown fail"); | ||
} | ||
} | ||
} | ||
|
||
public ThreadPoolExecutor getExecutors() { | ||
return executor; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...ava/com/apache/eventmesh/admin/server/web/db/entity/EventMeshPositionReporterHistory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.apache.eventmesh.admin.server.web.db.entity; | ||
|
||
import com.baomidou.mybatisplus.annotation.IdType; | ||
import com.baomidou.mybatisplus.annotation.TableId; | ||
import com.baomidou.mybatisplus.annotation.TableName; | ||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
|
||
/** | ||
* @TableName event_mesh_position_reporter_history | ||
*/ | ||
@TableName(value ="event_mesh_position_reporter_history") | ||
@Data | ||
public class EventMeshPositionReporterHistory implements Serializable { | ||
@TableId(type = IdType.AUTO) | ||
private Long id; | ||
|
||
private Integer job; | ||
|
||
private String record; | ||
|
||
private String address; | ||
|
||
private Date createTime; | ||
|
||
private static final long serialVersionUID = 1L; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...rc/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHistory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.apache.eventmesh.admin.server.web.db.entity; | ||
|
||
import com.baomidou.mybatisplus.annotation.IdType; | ||
import com.baomidou.mybatisplus.annotation.TableId; | ||
import com.baomidou.mybatisplus.annotation.TableName; | ||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
|
||
/** | ||
* @TableName event_mesh_runtime_history | ||
*/ | ||
@TableName(value ="event_mesh_runtime_history") | ||
@Data | ||
public class EventMeshRuntimeHistory implements Serializable { | ||
@TableId(type = IdType.AUTO) | ||
private Long id; | ||
|
||
private Integer job; | ||
|
||
private String address; | ||
|
||
private Date createTime; | ||
|
||
private static final long serialVersionUID = 1L; | ||
} |
40 changes: 20 additions & 20 deletions
40
.../main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshDataSourceMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_data_source】的数据库操作Mapper | ||
* @createDate 2024-05-09 15:52:49 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource | ||
*/ | ||
@Mapper | ||
public interface EventMeshDataSourceMapper extends BaseMapper<EventMeshDataSource> { | ||
|
||
} | ||
|
||
|
||
|
||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_data_source】的数据库操作Mapper | ||
* @createDate 2024-05-09 15:52:49 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource | ||
*/ | ||
@Mapper | ||
public interface EventMeshDataSourceMapper extends BaseMapper<EventMeshDataSource> { | ||
|
||
} | ||
|
||
|
||
|
||
|
40 changes: 20 additions & 20 deletions
40
...src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshJobInfoMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_job_info】的数据库操作Mapper | ||
* @createDate 2024-05-09 15:51:45 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo | ||
*/ | ||
@Mapper | ||
public interface EventMeshJobInfoMapper extends BaseMapper<EventMeshJobInfo> { | ||
|
||
} | ||
|
||
|
||
|
||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_job_info】的数据库操作Mapper | ||
* @createDate 2024-05-09 15:51:45 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo | ||
*/ | ||
@Mapper | ||
public interface EventMeshJobInfoMapper extends BaseMapper<EventMeshJobInfo> { | ||
|
||
} | ||
|
||
|
||
|
||
|
40 changes: 20 additions & 20 deletions
40
...b/db/mapper/EventMeshHeartbeatMapper.java → .../mapper/EventMeshMysqlPositionMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshHeartbeat; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_heartbeat】的数据库操作Mapper | ||
* @createDate 2024-05-10 16:05:00 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshHeartbeat | ||
*/ | ||
@Mapper | ||
public interface EventMeshHeartbeatMapper extends BaseMapper<EventMeshHeartbeat> { | ||
|
||
} | ||
|
||
|
||
|
||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshMysqlPosition; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_mysql_position】的数据库操作Mapper | ||
* @createDate 2024-05-14 17:15:03 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshMysqlPosition | ||
*/ | ||
@Mapper | ||
public interface EventMeshMysqlPositionMapper extends BaseMapper<EventMeshMysqlPosition> { | ||
|
||
} | ||
|
||
|
||
|
||
|
20 changes: 20 additions & 0 deletions
20
...m/apache/eventmesh/admin/server/web/db/mapper/EventMeshPositionReporterHistoryMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshPositionReporterHistory; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_position_reporter_history(记录position上报者变更时,老记录)】的数据库操作Mapper | ||
* @createDate 2024-05-14 17:15:03 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshPositionReporterHistory | ||
*/ | ||
@Mapper | ||
public interface EventMeshPositionReporterHistoryMapper extends BaseMapper<EventMeshPositionReporterHistory> { | ||
|
||
} | ||
|
||
|
||
|
||
|
40 changes: 20 additions & 20 deletions
40
...db/mapper/EventMeshJobPositionMapper.java → ...pper/EventMeshRuntimeHeartbeatMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobPosition; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_job_position】的数据库操作Mapper | ||
* @createDate 2024-05-09 09:33:01 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobPosition | ||
*/ | ||
@Mapper | ||
public interface EventMeshJobPositionMapper extends BaseMapper<EventMeshJobPosition> { | ||
|
||
} | ||
|
||
|
||
|
||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Mapper | ||
* @createDate 2024-05-14 17:15:03 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat | ||
*/ | ||
@Mapper | ||
public interface EventMeshRuntimeHeartbeatMapper extends BaseMapper<EventMeshRuntimeHeartbeat> { | ||
|
||
} | ||
|
||
|
||
|
||
|
20 changes: 20 additions & 0 deletions
20
...n/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHistoryMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.apache.eventmesh.admin.server.web.db.mapper; | ||
|
||
import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHistory; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
/** | ||
* @author sodafang | ||
* @description 针对表【event_mesh_runtime_history(记录runtime上运行任务的变更)】的数据库操作Mapper | ||
* @createDate 2024-05-14 17:15:03 | ||
* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHistory | ||
*/ | ||
@Mapper | ||
public interface EventMeshRuntimeHistoryMapper extends BaseMapper<EventMeshRuntimeHistory> { | ||
|
||
} | ||
|
||
|
||
|
||
|
Oops, something went wrong.