forked from DTStack/flinkStreamSQL
-
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.
Merge branch '1.10_release_4.0.x' into hotfix_1.10_4.0.x_30935
- Loading branch information
Showing
39 changed files
with
1,409 additions
and
211 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
61 changes: 61 additions & 0 deletions
61
core/src/main/java/com/dtstack/flink/sql/exception/BaseCodeEnum.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,61 @@ | ||
/* | ||
* 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 com.dtstack.flink.sql.exception; | ||
|
||
/** | ||
* @author: chuixue | ||
* @create: 2020-11-30 16:23 | ||
* @description: 公共错误码 | ||
**/ | ||
public enum BaseCodeEnum implements ErrorCode { | ||
/** | ||
* 未指明的异常 | ||
*/ | ||
UNSPECIFIED("000", "unknow exception"), | ||
; | ||
|
||
/** | ||
* 错误码 | ||
*/ | ||
private final String code; | ||
|
||
/** | ||
* 描述 | ||
*/ | ||
private final String description; | ||
|
||
/** | ||
* @param code 错误码 | ||
* @param description 描述 | ||
*/ | ||
private BaseCodeEnum(final String code, final String description) { | ||
this.code = code; | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return description; | ||
} | ||
} |
126 changes: 126 additions & 0 deletions
126
core/src/main/java/com/dtstack/flink/sql/exception/BaseException.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,126 @@ | ||
/* | ||
* 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 com.dtstack.flink.sql.exception; | ||
|
||
|
||
/** | ||
* @author: chuixue | ||
* @create: 2020-11-30 14:48 | ||
* @description:根异常 | ||
**/ | ||
public class BaseException extends RuntimeException { | ||
|
||
/** | ||
* 错误码 | ||
*/ | ||
protected final ErrorCode errorCode; | ||
|
||
/** | ||
* 无参默认构造UNSPECIFIED | ||
*/ | ||
public BaseException() { | ||
super(BaseCodeEnum.UNSPECIFIED.getDescription()); | ||
errorCode = BaseCodeEnum.UNSPECIFIED; | ||
} | ||
|
||
/** | ||
* 指定错误码构造通用异常 | ||
* | ||
* @param errorCode 错误码 | ||
*/ | ||
public BaseException(ErrorCode errorCode) { | ||
super(errorCode.getDescription()); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
/** | ||
* 指定详细描述构造通用异常 | ||
* | ||
* @param detailedMessage 详细描述 | ||
*/ | ||
public BaseException(final String detailedMessage) { | ||
super(detailedMessage); | ||
this.errorCode = BaseCodeEnum.UNSPECIFIED; | ||
} | ||
|
||
/** | ||
* 指定导火索构造通用异常 | ||
* | ||
* @param t 导火索 | ||
*/ | ||
public BaseException(final Throwable t) { | ||
super(t); | ||
this.errorCode = BaseCodeEnum.UNSPECIFIED; | ||
} | ||
|
||
/** | ||
* 构造通用异常 | ||
* | ||
* @param errorCode 错误码 | ||
* @param detailedMessage 详细描述 | ||
*/ | ||
public BaseException(final ErrorCode errorCode, final String detailedMessage) { | ||
super(detailedMessage); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
/** | ||
* 构造通用异常 | ||
* | ||
* @param errorCode 错误码 | ||
* @param t 导火索 | ||
*/ | ||
public BaseException(final ErrorCode errorCode, final Throwable t) { | ||
super(errorCode.getDescription(), t); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
/** | ||
* 构造通用异常 | ||
* | ||
* @param detailedMessage 详细描述 | ||
* @param t 导火索 | ||
*/ | ||
public BaseException(final String detailedMessage, final Throwable t) { | ||
super(detailedMessage, t); | ||
this.errorCode = BaseCodeEnum.UNSPECIFIED; | ||
} | ||
|
||
/** | ||
* 构造通用异常 | ||
* | ||
* @param errorCode 错误码 | ||
* @param detailedMessage 详细描述 | ||
* @param t 导火索 | ||
*/ | ||
public BaseException(final ErrorCode errorCode, final String detailedMessage, | ||
final Throwable t) { | ||
super(detailedMessage, t); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
/** | ||
* 获取错误码 | ||
* | ||
* @return | ||
*/ | ||
public ErrorCode getErrorCode() { | ||
return errorCode; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
core/src/main/java/com/dtstack/flink/sql/exception/ErrorCode.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,21 @@ | ||
package com.dtstack.flink.sql.exception; | ||
|
||
/** | ||
* 错误码 | ||
*/ | ||
public interface ErrorCode { | ||
|
||
/** | ||
* 获取错误码 | ||
* | ||
* @return | ||
*/ | ||
String getCode(); | ||
|
||
/** | ||
* 获取错误信息 | ||
* | ||
* @return | ||
*/ | ||
String getDescription(); | ||
} |
63 changes: 63 additions & 0 deletions
63
core/src/main/java/com/dtstack/flink/sql/exception/sqlparse/SqlParseCodeEnum.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,63 @@ | ||
/* | ||
* 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 com.dtstack.flink.sql.exception.sqlparse; | ||
|
||
import com.dtstack.flink.sql.exception.ErrorCode; | ||
|
||
/** | ||
* @author: chuixue | ||
* @create: 2020-11-30 16:56 | ||
* @description:sql解析错误码 | ||
**/ | ||
public enum SqlParseCodeEnum implements ErrorCode { | ||
/** | ||
* 流join维表时,select、join、group by等字段未使用t.field | ||
*/ | ||
WITHOUT_TABLENAME("001", "field invalid , please use like t.field"), | ||
; | ||
|
||
/** | ||
* 错误码 | ||
*/ | ||
private final String code; | ||
|
||
/** | ||
* 描述 | ||
*/ | ||
private final String description; | ||
|
||
/** | ||
* @param code 错误码 | ||
* @param description 描述 | ||
*/ | ||
private SqlParseCodeEnum(final String code, final String description) { | ||
this.code = code; | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return description; | ||
} | ||
} |
Oops, something went wrong.