-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version 1.3.0 dashbaord support (#115)
version 1.3.0 dashbaord support * 增加Dashboard支持 * 修复由于ClassLoader不同导致的接口proxy创建失败 * 修复泛型导致的编译问题 * 兼容Oracle
- Loading branch information
Showing
72 changed files
with
2,147 additions
and
46 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
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
12 changes: 12 additions & 0 deletions
12
easytrans-core/src/main/java/com/yiqiniu/easytrans/monitor/EtMonitor.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,12 @@ | ||
package com.yiqiniu.easytrans.monitor; | ||
|
||
/** | ||
* 本接口用户表明某个接口是EasyTransaction的Monitor接口 | ||
* 其只能被接口继承,否则不生效 | ||
* Monitor的接口方法的入参请用简单类型,如字符串和数字,否则可能出现问题 | ||
* | ||
* @author deyou | ||
* @date 2019.04.03 | ||
*/ | ||
public interface EtMonitor { | ||
} |
18 changes: 18 additions & 0 deletions
18
easytrans-core/src/main/java/com/yiqiniu/easytrans/monitor/MonitorConsumerFactory.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,18 @@ | ||
package com.yiqiniu.easytrans.monitor; | ||
|
||
/** | ||
* | ||
* @author deyou | ||
* @date 2019/04/02 | ||
* | ||
*/ | ||
public interface MonitorConsumerFactory { | ||
|
||
/** | ||
* use for methods to call | ||
* @param monitorInterface | ||
* @return | ||
*/ | ||
public <T extends EtMonitor> T getRemoteProxy(String appId, Class<T> monitorInterface); | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
easytrans-core/src/main/java/com/yiqiniu/easytrans/monitor/StringCodecMonitor.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,10 @@ | ||
package com.yiqiniu.easytrans.monitor; | ||
|
||
/** | ||
* | ||
* @author deyou | ||
* | ||
*/ | ||
public interface StringCodecMonitor extends EtMonitor { | ||
Object getString2IdMap(); | ||
} |
13 changes: 13 additions & 0 deletions
13
easytrans-core/src/main/java/com/yiqiniu/easytrans/monitor/TransactionLogMonitor.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,13 @@ | ||
package com.yiqiniu.easytrans.monitor; | ||
|
||
/** | ||
* | ||
* @author deyou | ||
* | ||
*/ | ||
public interface TransactionLogMonitor extends EtMonitor { | ||
Object getUnfinishedLogs(int pageSize,Long latestTimeStamp); | ||
|
||
Object consistentProcess(String busCode, long trxId); | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
...core/src/main/java/com/yiqiniu/easytrans/monitor/server/ServerSideStringCodecMonitor.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.yiqiniu.easytrans.monitor.server; | ||
|
||
import com.yiqiniu.easytrans.monitor.StringCodecMonitor; | ||
import com.yiqiniu.easytrans.stringcodec.ListableStringCodec; | ||
import com.yiqiniu.easytrans.stringcodec.StringCodec; | ||
|
||
public class ServerSideStringCodecMonitor implements StringCodecMonitor { | ||
|
||
|
||
private StringCodec stringCodec; | ||
|
||
public ServerSideStringCodecMonitor(StringCodec stringCodec) { | ||
super(); | ||
this.stringCodec = stringCodec; | ||
} | ||
|
||
@Override | ||
public Object getString2IdMap() { | ||
|
||
if(stringCodec instanceof ListableStringCodec) { | ||
ListableStringCodec lsc = (ListableStringCodec) stringCodec; | ||
return lsc.getMapStr2Id(); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
|
||
} |
44 changes: 44 additions & 0 deletions
44
...e/src/main/java/com/yiqiniu/easytrans/monitor/server/ServerSideTransactionLogMonitor.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,44 @@ | ||
package com.yiqiniu.easytrans.monitor.server; | ||
|
||
import java.util.Arrays; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
import com.alibaba.nacos.client.naming.utils.CollectionUtils; | ||
import com.yiqiniu.easytrans.core.ConsistentGuardian; | ||
import com.yiqiniu.easytrans.log.TransactionLogReader; | ||
import com.yiqiniu.easytrans.log.vo.LogCollection; | ||
import com.yiqiniu.easytrans.monitor.TransactionLogMonitor; | ||
import com.yiqiniu.easytrans.protocol.TransactionId; | ||
|
||
public class ServerSideTransactionLogMonitor implements TransactionLogMonitor { | ||
|
||
private String appId; | ||
private TransactionLogReader logReader; | ||
private ConsistentGuardian consistentGuardian; | ||
|
||
|
||
public ServerSideTransactionLogMonitor(String appId, TransactionLogReader logReader, ConsistentGuardian consistentGuardian) { | ||
super(); | ||
this.appId = appId; | ||
this.logReader = logReader; | ||
this.consistentGuardian = consistentGuardian; | ||
} | ||
|
||
@Override | ||
public Object getUnfinishedLogs(int pageSize, Long latestTimeStamp) { | ||
return logReader.getUnfinishedLogs(null, pageSize, latestTimeStamp != null?new Date(latestTimeStamp):new Date()); | ||
} | ||
|
||
@Override | ||
public Object consistentProcess(String busCode, long trxId) { | ||
List<LogCollection> transactionLogById = logReader.getTransactionLogById(Arrays.asList(new TransactionId(appId,busCode,trxId))); | ||
if(CollectionUtils.isEmpty(transactionLogById)) { | ||
return false; | ||
} | ||
|
||
consistentGuardian.process(transactionLogById.get(0)); | ||
return true; | ||
} | ||
|
||
} |
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
12 changes: 12 additions & 0 deletions
12
easytrans-core/src/main/java/com/yiqiniu/easytrans/stringcodec/ListableStringCodec.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,12 @@ | ||
package com.yiqiniu.easytrans.stringcodec; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* @author xu deyou | ||
* | ||
*/ | ||
public interface ListableStringCodec extends StringCodec { | ||
Map<String/*type*/, Map<String,Integer>> getMapStr2Id(); | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
server_back.properties | ||
*.class | ||
*.log | ||
*.log.* | ||
.factorypath | ||
/target/* | ||
/.settings/* | ||
/bin/* | ||
/.project | ||
/.classpath | ||
/logs | ||
/target/ | ||
.DS_Store | ||
.springBeans |
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,88 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<name>EasyTransaction dashboard</name> | ||
|
||
<artifactId>easytrans-dashboard</artifactId> | ||
|
||
<parent> | ||
<groupId>com.yiqiniu.easytrans</groupId> | ||
<artifactId>easytrans</artifactId> | ||
<version>${revision}</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<java.version>1.8</java.version> | ||
</properties> | ||
|
||
|
||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
</dependency> | ||
|
||
<!-- <dependency> | ||
<groupId>com.yiqiniu.easytrans</groupId> | ||
<artifactId>easytrans-starter</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.yiqiniu.easytrans</groupId> | ||
<artifactId> | ||
easytrans-log-database-starter | ||
</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.yiqiniu.easytrans</groupId> | ||
<artifactId> | ||
easytrans-queue-kafka-starter | ||
</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> --> | ||
|
||
<dependency> | ||
<groupId>com.yiqiniu.easytrans</groupId> | ||
<artifactId>easytrans-rpc-rest-ribbon-starter</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.yiqiniu.easytrans</groupId> | ||
<artifactId>easytrans-rpc-dubbo-starter</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
Oops, something went wrong.