feat: 一阶段
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package com.codechecker.cache.detector;
|
||||
|
||||
/**
|
||||
* 一个 Redis value 写入点的静态描述。
|
||||
* 一个 Redis / MQ value 写入(投递)点的静态描述。
|
||||
*/
|
||||
public class WritePoint {
|
||||
|
||||
public static final String CHANNEL_REDIS = "REDIS";
|
||||
public static final String CHANNEL_ROCKETMQ = "ROCKETMQ";
|
||||
public static final String CHANNEL_KAFKA = "KAFKA";
|
||||
|
||||
private String filePath;
|
||||
private int lineNumber;
|
||||
private String enclosingClass;
|
||||
@@ -20,6 +24,9 @@ public class WritePoint {
|
||||
|
||||
private double confidence = 1.0;
|
||||
|
||||
/** REDIS / ROCKETMQ / KAFKA;默认 REDIS 兼容现网 */
|
||||
private String channel = CHANNEL_REDIS;
|
||||
|
||||
/** 稳定标识:用于在 old/new 两个版本间配对同一写入点 */
|
||||
public String signature() {
|
||||
return enclosingClass + "#" + enclosingMethod + "|" + normalizeKey();
|
||||
@@ -29,6 +36,10 @@ public class WritePoint {
|
||||
return keyExpression == null ? "" : keyExpression.replaceAll("\\s+", "");
|
||||
}
|
||||
|
||||
public boolean isMq() {
|
||||
return CHANNEL_ROCKETMQ.equals(channel) || CHANNEL_KAFKA.equals(channel);
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
@@ -117,6 +128,14 @@ public class WritePoint {
|
||||
this.confidence = confidence;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel == null || channel.isEmpty() ? CHANNEL_REDIS : channel;
|
||||
}
|
||||
|
||||
public String location() {
|
||||
String simpleClass = enclosingClass;
|
||||
if (simpleClass != null && simpleClass.contains(".")) {
|
||||
|
||||
Reference in New Issue
Block a user