You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "samuelsiebenmann (via GitHub)" <gi...@apache.org> on 2023/03/22 14:31:04 UTC

[GitHub] [flink-connector-aws] samuelsiebenmann opened a new pull request, #59: [Flink 31492][Connectors/AWS] Add support for exception classification based on AWS error codes

samuelsiebenmann opened a new pull request, #59:
URL: https://github.com/apache/flink-connector-aws/pull/59

   <!--
   *Thank you for contributing to Apache Flink AWS Connectors - we are happy that you want to help us improve our Flink connectors. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   ## Contribution Checklist
   
   - The name of the pull request should correspond to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
   - Commits should be in the form of "[FLINK-XXXX][component] Title of the pull request", where [FLINK-XXXX] should be replaced by the actual issue number. 
       Generally, [component] should be the connector you are working on.
       For example: "[FLINK-XXXX][Connectors/Kinesis] XXXX" if you are working on the Kinesis connector or "[FLINK-XXXX][Connectors/AWS] XXXX" if you are working on components shared among all the connectors.
   - Each pull request should only have one JIRA issue.
   - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   -->
   
   ## Purpose of the change
   
   Add support for exception classification based on AWS error codes:
   - Add AWSExceptionClassifierUtil to create FatalExceptionClassifiers to classify AWSServiceExceptions
      based on AWSErrorDetails error code.
   - Add AWSExceptionHandler to provide improved semantics over FatalExceptionClassifier.
   
   Add exception classification based on AWS error codes for the AWS Firehose sink:
   - Move Firehose sink exception classifiers into their own class: AWSFirehoseExceptionClassifiers.
   - Add FatalExceptionClassifiers for FirehoseExceptions with errorCode "NotAuthorized" and "AccessDeniedException".
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   - Added unit tests
   
   ## Significant changes
   *(Please check any boxes [x] if the answer is "yes". You can first publish the PR and check them afterwards, for convenience.)*
   - [ ] Dependencies have been added or upgraded
   - [ ] Public API has been changed (Public API is any class annotated with `@Public(Evolving)`)
   - [ ] Serializers have been changed
   - [ ] New feature has been introduced
     - If yes, how is this documented? (not applicable / docs / JavaDocs / not documented)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-connector-aws] boring-cyborg[bot] commented on pull request #59: [Flink 31492][Connectors/AWS] Add support for exception classification based on AWS error codes

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #59:
URL: https://github.com/apache/flink-connector-aws/pull/59#issuecomment-1487304948

   Awesome work, congrats on your first merged pull request!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-connector-aws] dannycranmer commented on a diff in pull request #59: [Flink 31492][Connectors/AWS] Add support for exception classification based on AWS error codes

Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer commented on code in PR #59:
URL: https://github.com/apache/flink-connector-aws/pull/59#discussion_r1150602424


##########
flink-connector-aws-base/src/main/java/org/apache/flink/connector/aws/sink/throwable/AWSExceptionClassifierUtil.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.flink.connector.aws.sink.throwable;
+
+import org.apache.flink.connector.base.sink.throwable.FatalExceptionClassifier;
+import org.apache.flink.util.ExceptionUtils;
+
+import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Function;
+
+/**
+ * Util class to create {@link FatalExceptionClassifier} to classify {@link AwsServiceException}
+ * based on {@link AwsErrorDetails#errorCode()}.
+ */
+public class AWSExceptionClassifierUtil {

Review Comment:
   Please annotate classes with appropriate support annotations. `@PublicEvolving` or `@Internal` . I imagine these will be internal



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-connector-aws] boring-cyborg[bot] commented on pull request #59: [Flink 31492][Connectors/AWS] Add support for exception classification based on AWS error codes

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #59:
URL: https://github.com/apache/flink-connector-aws/pull/59#issuecomment-1479674540

   Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-connector-aws] dannycranmer merged pull request #59: [Flink 31492][Connectors/AWS] Add support for exception classification based on AWS error codes

Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer merged PR #59:
URL: https://github.com/apache/flink-connector-aws/pull/59


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-connector-aws] samuelsiebenmann commented on a diff in pull request #59: [Flink 31492][Connectors/AWS] Add support for exception classification based on AWS error codes

Posted by "samuelsiebenmann (via GitHub)" <gi...@apache.org>.
samuelsiebenmann commented on code in PR #59:
URL: https://github.com/apache/flink-connector-aws/pull/59#discussion_r1150629006


##########
flink-connector-aws-base/src/main/java/org/apache/flink/connector/aws/sink/throwable/AWSExceptionClassifierUtil.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.flink.connector.aws.sink.throwable;
+
+import org.apache.flink.connector.base.sink.throwable.FatalExceptionClassifier;
+import org.apache.flink.util.ExceptionUtils;
+
+import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Function;
+
+/**
+ * Util class to create {@link FatalExceptionClassifier} to classify {@link AwsServiceException}
+ * based on {@link AwsErrorDetails#errorCode()}.
+ */
+public class AWSExceptionClassifierUtil {

Review Comment:
   Thanks. I've marked them as `@Internal`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org