-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'apache:dev' into connector-teradata
- Loading branch information
Showing
13 changed files
with
289 additions
and
19 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
47 changes: 47 additions & 0 deletions
47
seatunnel-api/src/main/java/org/apache/seatunnel/api/common/SeaTunnelAPIErrorCode.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,47 @@ | ||
/* | ||
* 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 org.apache.seatunnel.api.common; | ||
|
||
import org.apache.seatunnel.common.exception.SeaTunnelErrorCode; | ||
|
||
public enum SeaTunnelAPIErrorCode implements SeaTunnelErrorCode { | ||
CONFIG_VALIDATION_FAILED("API-01", "Configuration item validate failed"), | ||
OPTION_VALIDATION_FAILED("API-02", "Option item validate failed"), | ||
CATALOG_INITIALIZE_FAILED("API-03", "Catalog initialize failed"), | ||
DATABASE_NOT_EXISTED("API-04", "Database not existed"), | ||
TABLE_NOT_EXISTED("API-05", "Table not existed"), | ||
FACTORY_INITIALIZE_FAILED("API-06", "Factory initialize failed"),; | ||
|
||
private final String code; | ||
private final String description; | ||
|
||
SeaTunnelAPIErrorCode(String code, String description) { | ||
this.code = code; | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return description; | ||
} | ||
} |
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
52 changes: 52 additions & 0 deletions
52
seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.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,52 @@ | ||
/* | ||
* 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 org.apache.seatunnel.common.exception; | ||
|
||
public enum CommonErrorCode implements SeaTunnelErrorCode { | ||
FILE_OPERATION_FAILED("COMMON-01", "File operation failed, such as (read,list,write,move,copy,sync) etc..."), | ||
JSON_OPERATION_FAILED("COMMON-02", "Json covert/parse operation failed"), | ||
REFLECT_CLASS_OPERATION_FAILED("COMMON-03", "Reflect class operation failed"), | ||
SERIALIZE_OPERATION_FAILED("COMMON-04", "Serialize class operation failed"), | ||
UNSUPPORTED_OPERATION("COMMON-05", "Unsupported operation"), | ||
ILLEGAL_ARGUMENT("COMMON-06", "Illegal argument"), | ||
UNSUPPORTED_DATA_TYPE("COMMON-07", "Unsupported data type"), | ||
SQL_OPERATION_FAILED("COMMON-08", "Sql operation failed, such as (execute,addBatch,close) etc..."), | ||
TABLE_SCHEMA_GET_FAILED("COMMON-09", "Get table schema from upstream data failed"), | ||
FLUSH_DATA_FAILED("COMMON-10", "Flush data operation that in sink connector failed"), | ||
WRITER_OPERATION_FAILED("COMMON-11", "Sink writer operation failed, such as (open, close) etc..."), | ||
READER_OPERATION_FAILED("COMMON-12", "Source reader operation failed, such as (open, close) etc..."), | ||
HTTP_OPERATION_FAILED("COMMON-13", "Http operation failed, such as (open, close, response) etc..."); | ||
|
||
private final String code; | ||
private final String description; | ||
|
||
CommonErrorCode(String code, String description) { | ||
this.code = code; | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return description; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/SeaTunnelErrorCode.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,39 @@ | ||
/* | ||
* 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 org.apache.seatunnel.common.exception; | ||
|
||
/** | ||
* SeaTunnel connector error code interface | ||
*/ | ||
public interface SeaTunnelErrorCode { | ||
/** | ||
* Get error code | ||
* @return error code | ||
*/ | ||
String getCode(); | ||
|
||
/** | ||
* Get error description | ||
* @return error description | ||
*/ | ||
String getDescription(); | ||
|
||
default String getErrorMessage() { | ||
return String.format("ErrorCode:[%s], ErrorDescription:[%s]", getCode(), getDescription()); | ||
} | ||
} |
Oops, something went wrong.