nirtsruya commented on a change in pull request #18449: URL: https://github.com/apache/flink/pull/18449#discussion_r790558456
########## File path: flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/writer/FatalExceptionHandler.java ########## @@ -0,0 +1,37 @@ +/* + * 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.base.sink.writer; + +import org.apache.flink.annotation.PublicEvolving; + +import java.io.Serializable; +import java.util.List; + +/** + * This interface specifies how the sink should handle an exception raised by {@code + * AsyncSinkWriter} that should not be retried. The mapping is provided by the end-user of a sink, + * not the sink creator. + * + * @param <RequestEntryT> Corresponds to the type parameter of the same name in {@code * + * AsyncSinkWriter} + */ +@PublicEvolving +public interface FatalExceptionHandler<RequestEntryT> extends Serializable { + void handle(List<RequestEntryT> failedRequestEntries, Exception fatalException) + throws Exception; Review comment: Hey @dannycranmer thanks for the comment. The idea was to let the user add some custom code in case of sink failure, like publishing the failed records to a DLQ maybe. I understand that there might be some performance constraints there - but in that case it is user's implementation. Returning the classification makes sense - are we planning this mechanism will replace the current implementation and calling getFatalExceptionCons()? And instead the framework will push the requestEntries to the correct consumer? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
