forked from didi/KnowStreaming
-
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.
[Optimize]增加Connector运行状态指标 (didi#1110)
1、增加Connector运行状态指标; 2、将Connector指标上报普罗米修斯; 3、调整代码继承关系;
- Loading branch information
Showing
14 changed files
with
156 additions
and
85 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
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
50 changes: 50 additions & 0 deletions
50
...rc/main/java/com/xiaojukeji/know/streaming/km/common/enums/connect/ConnectStatusEnum.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,50 @@ | ||
package com.xiaojukeji.know.streaming.km.common.enums.connect; | ||
|
||
import org.apache.kafka.connect.runtime.AbstractStatus; | ||
|
||
/** | ||
* connector运行状态 | ||
* @see AbstractStatus | ||
*/ | ||
public enum ConnectStatusEnum { | ||
UNASSIGNED(0, "UNASSIGNED"), | ||
|
||
RUNNING(1,"RUNNING"), | ||
|
||
PAUSED(2,"PAUSED"), | ||
|
||
FAILED(3, "FAILED"), | ||
|
||
DESTROYED(4, "DESTROYED"), | ||
|
||
UNKNOWN(-1, "UNKNOWN") | ||
|
||
; | ||
|
||
ConnectStatusEnum(int status, String value) { | ||
this.status = status; | ||
this.value = value; | ||
} | ||
|
||
private final int status; | ||
|
||
private final String value; | ||
|
||
public static ConnectStatusEnum getByValue(String value) { | ||
for (ConnectStatusEnum statusEnum: ConnectStatusEnum.values()) { | ||
if (statusEnum.value.equals(value)) { | ||
return statusEnum; | ||
} | ||
} | ||
|
||
return ConnectStatusEnum.UNKNOWN; | ||
} | ||
|
||
public int getStatus() { | ||
return status; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
} |
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
Oops, something went wrong.