-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor][Connector] Refactor connector comfig
- Loading branch information
Showing
76 changed files
with
1,053 additions
and
285 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
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
75 changes: 75 additions & 0 deletions
75
datavines-common/src/main/java/io/datavines/common/enums/IssueStatusType.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,75 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.datavines.common.enums; | ||
|
||
import com.baomidou.mybatisplus.annotation.EnumValue; | ||
|
||
import java.util.HashMap; | ||
|
||
/** | ||
* job type | ||
*/ | ||
public enum IssueStatusType { | ||
/** | ||
* wait_process | ||
* processed | ||
* ignored | ||
*/ | ||
WAIT_PROCESS("wait_process", "WAIT_PROCESS", "待处理"), | ||
PROCESSED("processed", "PROCESSED","已处理"), | ||
IGNORED("ignored", "IGNORED","已忽略"); | ||
|
||
IssueStatusType(String code, String description, String zhDescription) { | ||
this.code = code; | ||
this.description = description; | ||
this.zhDescription = zhDescription; | ||
} | ||
|
||
@EnumValue | ||
private final String code; | ||
|
||
private final String description; | ||
|
||
private final String zhDescription; | ||
|
||
public String getCode() { | ||
return code; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public String getZhDescription() { | ||
return zhDescription; | ||
} | ||
|
||
private static final HashMap<String, IssueStatusType> JOB_TYPE_MAP = new HashMap<>(); | ||
|
||
static { | ||
for (IssueStatusType jobType: IssueStatusType.values()){ | ||
JOB_TYPE_MAP.put(jobType.code, jobType); | ||
} | ||
} | ||
|
||
public static IssueStatusType of(String jobType){ | ||
if(JOB_TYPE_MAP.containsKey(jobType)){ | ||
return JOB_TYPE_MAP.get(jobType); | ||
} | ||
throw new IllegalArgumentException("invalid job type : " + jobType); | ||
} | ||
} |
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
58 changes: 58 additions & 0 deletions
58
datavines-common/src/main/java/io/datavines/common/enums/MetricCategoryType.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,58 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.datavines.common.enums; | ||
|
||
import com.baomidou.mybatisplus.annotation.EnumValue; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import lombok.Getter; | ||
|
||
import java.util.HashMap; | ||
|
||
public enum MetricCategoryType { | ||
BASIC("basic", "基础规则"), | ||
TEMPLATE("template", "规则模版"), | ||
; | ||
|
||
@JsonValue | ||
@EnumValue | ||
@Getter | ||
private final String code; | ||
|
||
@Getter | ||
private final String description; | ||
|
||
MetricCategoryType(String code, String description) { | ||
this.code = code; | ||
this.description = description; | ||
} | ||
|
||
private static final HashMap<String, MetricCategoryType> METRIC_CATEGORY_TYPE_MAP = new HashMap<>(); | ||
|
||
static { | ||
for (MetricCategoryType categoryType: MetricCategoryType.values()){ | ||
METRIC_CATEGORY_TYPE_MAP.put(categoryType.getCode(), categoryType); | ||
} | ||
} | ||
|
||
public static MetricCategoryType of(String code){ | ||
if (METRIC_CATEGORY_TYPE_MAP.containsKey(code)){ | ||
return METRIC_CATEGORY_TYPE_MAP.get(code); | ||
} | ||
throw new IllegalArgumentException("invalid code : " + code); | ||
} | ||
} |
Oops, something went wrong.